 It's 11 p.m. Do you know where your child's toy is? Hey, everybody. It's time for a special edition of My Little Hacker here at my desk, where it's me, Lady Aida, with me, Mr. Lady Aida, and the little hacker is asleep in the bassinet. Yeah, so this is the only electronic show that I know of that I'll just do a little behind the scenes photo here. So here she is, she's sleeping right next to me. This is just a still photo. We hide her because we don't want her on the internet. So luckily she was kind enough to cover her face with her sloth. She has a little sloth toy. And then here's Lady Aida's desk. So this is what it looks like behind the scenes. And we're currently hacking one of the more popular and low-cost and fun toys that a lot of people have. A lot of parents already told us, oh, thank god. We're going to show how to hack and mod the baby Einstein take-along tunes. Yeah, that's the first one. Yeah, we have a bunch of videos that we already have. You can check it out on all our different places. But what are you up to tonight on this hack? So last time we did a video, I showed and we traced out the PCB and I started to like outline it to create a custom PCB using the ESP32-S2. But I realized before I lay down any parts I should verify that they like actually work since we have modules for all the individual pieces. And so what I did is I put together a really quick like proof of concept to check all the components. And the components I'm using are the ESP32-S2. So let's go to the overhead. I've got the ESP32-S2 cutie pie. And the chip is on the back. This is a kind of a hollow set up there. So you can see the back of the board. You're going to plug this. So I really like the ESP32-S2, it's really stable. It's got great Arduino and circuit Python support. It's Wi-Fi, it's single core, it's pretty powerful. It does have a DAC, but the DAC can't be DMA'd to. And so even though like in theory, if I wanted to save money, I would skip the I2S amplifier. It's not that much more expensive than just a normal analog amplifier. And the board has great I2S support. And like I said, like the DAC, you can't DMA out of it. So you would have to sit there and like push every sample in, which could cause some data underflowing issues, which would have a weird sound effect. So this cutie pie, there's two little battery pins that you can connect to for external battery. And then this is the two AA battery pack from the toy itself. And I, you know, it's like, could you update this to use a lithium polymer or a lithium ion or chargeable battery? Sure. But first off, those don't really mix with kids. And especially... You could do wireless charging. Yeah, well, you could do wireless charging, but then it would only make sense if this was fully waterproof and it isn't. There's plenty of holes for liquids and spit up and all sorts of, and there's like a lot of fluids in the house right now. So sticking with the AA's is good. And, you know, here I've got some more chargeables, which means that this voltage can dip down to easily, you know, 2.2, 2.4 volts. The original circuitry, you know, could run at such a low voltage. I think it had a small switch cap for the green, blue LEDs and maybe biasing the speaker. You know, I didn't really do a full analysis of that. But for me, I need, you know, I need to make sure that I'm getting a good solid three volts. And so I've got this boost converter here, the TPS 61023. And I'm boosting to five volts. Like, yes, I could do to three. And on the board that I make, I'll probably do a boost converter to 3.3 volts rather than, you know, doing this five and then regulating it down to three. But that said, the amplifier does, you know, work best from five volts. So we'll see what the final version is. But this, again, just a proof of concept. So this gives me, you know, three volts to five volts here. And then this goes into the input. There's diode protection into the three volt regulator and runs the chip. And then this is the little add on board that I designed and got the prototype PCBs a couple of days ago. It provides a single I2S amplifier, which means I can get, you know, 24 bit quality digital audio. And you can DMA that from the ESP32S2 so you get really good quality audio effects. And then to do the prototype, I'm using circuit Python because one of the things that I like about circuit Python is we have very easy audio support and audio mixer support. So you can actually do stuff like volume control dynamically in ITOS, not using a potentiometer, like you can do digitally. And you can play multiple waves. You can play, not in the ESP series, but you can play MP3s on the Cortex series because we use the real player MP3 decoder. And then I just took this Molex picoblade connector because this is a Molex picoblade connector here and I made a little cable and using the speaker on board. And then we just wrote a little bit of code. So let's go to the computer. Let's test if the computer comes in. Okay, great. This is a little bit of circuit Python code. And I'm gonna make the font a little bit bigger. Okay, so I've got a bunch of imports and then ITOS. What's nice about the ESP series is you can use any three pins for ITOS. So I just picked these three in a row. And then we use an audio mixer and the reason I use an audio mixer is actually turns out when I first did this, I didn't mix the audio and I had the speaker kind of like at full volume and it was pretty loud and it actually caused the power supply to dip and I got it brown out. So instead of, you know, in the end, what I'm gonna do is I'm going to change the gain of the amplifier to reduce it because right now I think it's like a max gain. So reduce that so that I don't have to necessarily use the mixer. But I was like, well, you know, it's a good excuse to do digital volume control. And then there's an onboard button on the QT pine. I wanted to use it to simulate when somebody pressed a button. And then I do this little chunk of code here. And what this does is what this again, like I love Python so much because instead of like an Arduino, this would be like a full convoluted thing with like memory management and like strings and like all this nonsense. What's cool is we have this built-in flash disk drive that uses the memory of the ESP32 S2 like a bottom, you know, get about like one megabyte. I just list what's in the directory and then I just convert it to lower case names in case it's mixed case, because we support long file names. And I just check, oh, is it a WAV file? And it's not a .file, which is like macOS creates these .files are really annoying. Then, you know, create a list of all the waves. So, you know, what would an Arduino be or it see would be just a huge amount of code is like four very easy to read lines. And then again, there's that mixer. So I set the volume to 50%. And then every time you press the button, again, so readable, I do a random choice of the waves and then I print out what I'm playing. If there's multiple waves, open the file, put it through the mixer. And then while the mixer is playing, I wait and then I close the file and then I wait for the, make sure the button is released. So then on the over, so yeah, sorry. And then on the disk itself, so I have only one WAV file right now, which is, Mr. Lady, I said this was a capture of the original audio. Yeah, someone was like, what are the songs on this thing? And they did like a music history thing and they posted up, oh, these are what they are. And then they recorded them and they put them online. I'm like, oh, instead of me recording them off the device, I'll just grab the recordings that someone else made. So this is recording from what's on the device. Yeah, and what's neat is, of course, the audio is actually a little bit like staticky, but it's not the amplifier. The amplifier is actually reproducing the static of the recording. Cause like the, you know, it's a recording of recording of like a playback that we're now playing back again. So it has a very, like a little bit of a hiss in the background. So if you hear that, that's actually not from the amplifier. It's from the amplifier. You're doing such a good job that it replicates the hiss. And then- It's that vinyl sound that you want for your child's toy. Yeah, and then audacity is what you'd use to create these wave files. We have a guy on this. Basically, you want to make sure that your project is a wave, 22 kilohertz is plenty. You can do 44, but you know, this isn't like high-fi here. So 22 kilohertz is, is fine. And then monophonic, it just, you know, you don't, there's only one speaker. So there's no point in having stereo. So you just fix your audio down to one channel and then export it at 22 kilohertz, 16 bit. And don't save. And then you save the wave file on here. Now, again, the onboard disk drive for the ESP32 is not that big. I think it's, yeah, it's only about like one megabyte, 940K. So, you know, you can't have a lot of audio clips. So this one is kind of short. I think it was one was, this is 300K. It's only seven seconds long. I mean, we could have... Oh yeah, that was because I just trimmed it so I could do this test. Yeah. The songs are longer. The songs are longer, but also we're gonna have a micro SD card that'll, you know, if you want to have more storage, because it's, you know, the module I'm using doesn't come with more than four megabytes of flash and you need that flash for the bootloader and for the firmware. So it's actually just easier, like you put a slot on and people can use like any, like 60 gigabyte card or whatever. Okay, so now let's go to the overhead and then maybe I'll hold this up. So you know what I could do? I could put a bunch of lullabies on it and I could call it Napster. Okay. Okay, so this is the button. This is this boot button. So let me play it and I'll hold it up to the speaker. Maybe you want to go to the full sized me. Okay, so let's do this. Okay, so that was just like an eight second clip of me just, you know, I pressed the button on here and the audio comes out to speaker. All right, and that's that. So basically, you know, this was just to prove like it can play the way files. They sound really good. You know, that sound clip didn't sound super great. But let me, did I have another audio? I actually don't think I have another audio at this time. But what I'll, yeah, I also didn't want to use an audio clip that would get us in trouble. But what I'm going to do next is maybe wire up a micro SD card to verify they can play audio clips off a micro SD. And I have a micro SD key pie add-on. So I'll just like stack it. I'll make it a little like a hacker stacker. And then read the SD card, read it off there and then we'll put longer files on and just make sure that they work. Yeah. So that's our, that's where next thing. Yeah, we'll maybe use some of our songs or some songs that I made. So YouTube doesn't put us in YouTube jail. Okay, so we'll do that next and then we'll go back to the PCB design because as I was doing, I was like, oh man, I really don't want to like, it takes time to like get PCBs ordered, you know, it took a couple of weeks and put the prototypes together. And I wanted to, you know, I would rather make sure that at least the concept was right before I get the hard word and realize that like, you know, I can't stream audio off of micro SD card or like there's some power issue. Like, you know, I realized that I needed a blues converter, for example. Originally I actually thought like, oh, I could just run off of the three volt from the battery but actually the battery totally didn't like it. Even freshly recharge ones. Okay. Okay. Stay tuned for the next episode of My Little Hacker. I have special thanks to Baby who helped run everything behind the scenes. Thank you, Baby. And I have a microphone there. So if Baby talks in future... Oh, you did. Future episodes. You can talk to Baby. Yeah, in future episodes, if Baby talks or babbles, we'll just do some breaking news. Well, it's funny, every time that you don't have a mic, she squeaks, but then the one time you... Exactly. You have a mic, so that's... Exactly. That's AV life with a baby. Yeah, if you put the microphone up and you're just like, come on, then they'll just be completely silent and sleep through the entire show. But if you don't, expect some baby singing. Okay. Okay. Thanks everybody. My Little Hacker, My Little Hacker Building a queue is magical. My Little Hacker, My Little Hacker It's time to build a show.