 Welcome to the show it's me John Park and it's time for John Park's workshop here we are we're ready to go and hello everyone over in the YouTube chat I see Noe and Pedro have joined us hey guys also Marie Meyer, Davo Dessa, Anthony Bekerra, Martin Colenac, Larry Beattie welcome one and all and of course we've got plenty of people over here in the Discord chat if you're wondering where some of these people are chatting and you're over on Twitch or some other place where there's a seeming ghost town of chat or lack thereof head to the Discord it's adafru.it slash Discord you'll get an instant invite and you'll want to head over to the live broadcast chat channel and that's where all these good folks are such as Andy Calloway Mr. Certainly okay you're on see Grover Jim Hendrickson hello and Mr. Certainly did I mention that yes welcome Darth Vader Lars all the good people and I think we should we should get going so let's see first of all what's what by popular demand people really liked the teardown of last week's Halloween animatronic eyeball doorbell and so I'm gonna go ahead and do the the hacking of said doorbell so we looked at how it works now we'll go ahead and start connecting up to our own microcontroller and driver boards so that we can make it do what we want make it play the sounds that we want should be a lot of fun I'm looking forward to that we'll also do a little bit of exploration of how to figure out what is actually in there what motors you need to drive and therefore what kind of hardware you need those kinds of things will learn a lot along the way and have fun I hope let's see what else is up I'm gonna get a sip of water that's something and let's see I think that's that's all the preamble so let's get into it first of all I want to mention that we've got some ate a fruit things to check out first of all always important to remind you to check out our jobs board if you're looking for work if you are looking to hire someone you can head to jobs dot ate a fruit dot com and if you head over to the jobs site you'll see that we've got a bunch of positions that are posted there it doesn't cost anything to use it it doesn't cost anything to post and you can also post your own info if you click at the top there's either search jobs or available for hire and there you can see a bunch of people available hire including 3D and CAD dash on J quote bracket double quote bracket ah in the United States I don't know what that's about and I'm scared to click on it but most the other ones don't look too scary so maybe check those out I'm sure what's happening there really and that's the jobs board so head on over to jobsidefruit.com, if you want to learn more. Let's see. Also, I want to mention, if you head to the Adabox site, go to adabox.com. That'll get you there. We are now making a shift to talking about these in terms of seasons. It's a little broader scope than particular holidays that they might have been, or dates that they might have been built around before. Seasonal, we have a winter Adabox coming up. So if you're interested in subscribing, you can head to adabox.com. You can also get a subscription for someone else as a gift, if you'd like. And that is going to be coming out sometime in the winter. So that's as specific as we can get right now. At the top here, it says, actually, January slash February 2022 is when this should be shipping. And this is going to be Adabox number 21. That's 21st of these that we've done. Wow. Boy, howdy. And should be a good one. Should be fun. I don't know yet what the theme is exactly. I know what we're planning as far as what's in the box, but as far as theming of it, there's some mysteries surrounding that right now, coming from Mr. Lady Ada and Lady Ada. And they won't tell me. So I've got to get my costumes and stuff together. Let's see. What else is up? The product show I do on Tuesdays, have you heard of this? This is called JP's product pick of the week, every week. I pick something from our catalog, our massive catalog of cool items. And I show it off. I demo it. I show you how it works. Software to code it. Hardware to hook it up. And there is usually a massive, massive discount available during the show. You don't need to do anything special other than buy it during the show. So there's not a coupon code that you need to worry about. No puzzles to solve, no secret links to discern, no steganography. You don't have to figure out secret codes inside of a number station. None of that. It's just buy it right then while the show is happening. And you'll get a discount. It's often an astonishing 50% off this week. It was the three pack of the Permaproto full-sized PCB breadboards. And I've done a little bit of a recap, so check this out. The Permaproto full-sized breadboards. These are perf boards in the shape and, more importantly, design of a breadboard. These are real nice, high-quality PCBs that you can use to transfer your circuits from a typical breadboard where you press your components in into a much more permanent home by soldering it into this guy, the Permaproto. These come in different sizes, but this is a really nice one if you're building a project that has a sort of luxurious amount of room on it for input. If you have a smaller microcontroller, you can get quite a few buttons and switches and encoders on there. And that is how I like to use these. It is the Permaproto full-sized PCB for making your projects a little more permanent. Boy, I was so hopeful and optimistic back then, back on Tuesday, that it was going to get fall-like and cooler out. And now you can see them in t-shirts again. I had a flannel shirt and everything. I was so excited, and now it's hot. But actually, that segues a little bit into the conversation about the seasons. Mike P. asks over in Discord if this is still going to be four times a year. And yes, the eight-a-box is still quarterly. We're just calling the theming around it season-based. So there'll be four a year, winter, summer, spring, and fall, which Mr. certainly says is the North American for seasons. Sure. And Steve O'Keefer on asks, can I get those in low-quality PCBs instead? I bet you can, but not at eight-a-fruit. We refuse to sell you the low-quality PCBs here at eight-a-fruit. All right. Yeah, and while joking aside, one thing that you'll find with the higher-quality PCBs. By the way, someone had asked the other day about cutting them in half. And I found one that I had cut in half. I can't remember what I was using half of one of these for. But with the higher quality, you get pads that don't lift off if you ever need to desodder them, or even while you're soldering them. So these are very nice quality. And I've never seen them corrode or do anything weird. I think these are probably gold-plated traces. So nice high quality. All right. What else have we got going on? Hey, this is a good time to do the Circuit Python Parsec. All right, let me get that set up right there. OK, so this is a nice back-to-basics one right here today for the Circuit Python Parsec. What I wanted to show is how you can use the eight-a-fruit wave form. Let me say that again. I want to show you how you can use the eight-a-fruit wave form library to import a sine wave and use that to generate a tone that you can hear. So what you'll see in my down-shooter here is I have a Circuit Playground blue fruit connected to our little Stemma amplifier and speaker breakout. And when I press the two buttons, I'm going to play different tones. So these are nice, smooth sine wave forms. And the way that those are created is with this code. I import the board for the pin definitions, digital I.O. so I can use the buttons to bouncer to make the buttons even friendlier to use. And then I'm importing audio cores, raw sample, and audio PWM I.O. so that I can output over that audio output pin. And then I'm importing eight-a-fruit wave forms sine. Then I am setting up two sine waves. I have sine wave low, which is created with this sine wave and then a sample rate of 8,000 and a pitch or frequency of 440. Then I take that sine wave that gets created and I essentially turn it into a table or an array. And that's what this raw sample does. Raw sample takes that array and turns it or takes that waveform, turns it into a sample array. And then I'm doing the same sort of thing again, except this time with a higher pitch, 660. So this is equivalent of an A and an E. Then I set up the audio output on the board's audio out pin. Sometimes that's A0 on this board. It's just called audio. Then I set up my buttons and then in the main loop when I press a button, it does this audio play, sine wave low sample, and then it loops that. So this is essentially a single waveform and just keeps looping that over and over again so it plays constantly. And then when I do that with the high sample we get the higher pitch. And so that is how you can use eight-a-fruit waveform to import a sine wave and play it back as a tone inside of Circuit Python. And that is your Circuit Python Parsec. Let's see, let me check. I saw some questions and activity over in the chat there. Why are all the pins on the screen connected to ground rail asks Adam Bryant? Which screen are we talking about? I'm not sure. If you can clarify, we'll try to answer that. All the pins on the screen connected to the ground rail. I don't know. What did I show? Now I don't know. Are you talking about this little guy here? This? Probably not. It's a mystery. All right, well, if you get this message please respond and I'll try to figure out what the question is. And by the way, with that waveform library there's also a square wave in it. And I'd love to lobby to get a sawtooth on a triangle and some other waveforms put in there which are useful for sound things of course but also stuff like making LEDs fade up and down or blink on and off using the square wave. A pulse wave would be cool. But since we don't want to compute those in real time we're actually just taking those and using that raw sample to generate kind of a little table, a little lookup table of values that we can play back. Which is pretty cool. So it becomes a sample in essence. Oh, Adam asks here too, why are all the pins on the screen connected to ground? Was it the cut PCB? Could be. The video of you in the plain shirt. Was that during the Circuit Python parsec? It might have been. Now I don't remember. I don't have a quick easy way to review that. Now I'm dying to know. Let's see, I don't think I can play this without it playing its audio. I'll have to go back and, yeah, something I did in the, well, here's the Permaproto. Okay, so, oh, I know. You're talking about the display. Okay, that was something I explained in the larger show. I didn't actually connect the screen to the ground plane. I actually am using the STEMIQT cable for this connection. So it's I squared C connection. But I just wanted to essentially bolt the screen onto here mechanically. If I put it somewhere where it just wasn't gonna use any pins, it was kind of off center. So I created a whole bunch of confusion for everyone by using a couple of these right angle headers, which allows me to slide that screen into some header pins that look like they're connected to ground, but they're actually not. So it's a big fake out. So sorry about that. I could have just and probably should have just plugged it in down there and maybe really wired it, but I didn't feel like it or left it alone. But instead I got a little fancy and hooked it on there. And these, by the way, I didn't drill holes through for these nylon fasteners. They're just acting essentially as feet so that this thing doesn't tilt at an angle. Mystery solved, I hope. The other way to deal with that, by the way, is to cut traces. So if you do need to use something like that where those traces are connected, you can score with a hobby knife between them and remove that connection and then plug into them and use it just as a mechanical connection to solder to. Thank you for asking, Adam. That was a very good question. And maybe I got a little fancy for my own good and confused things. All right, so let's see. Next up, oh, lovely AE72 says make a Commodore SID simulator with the Adafruit Waveform, that would be cool. There are a couple of SID-based synthesizers that I've seen that just use that chip and allow you to play the synthesis on that chip without having a full Commodore 64, which is kind of cool. All right, let's see. Next up, so let's get into this. I'm gonna head back to my browser window here for a second and let's talk about this doorbell a little bit. So this is what I'm working with. This is a little $15 doorbell. You can get them all over the place anywhere from Halloween stores to hardware stores, big box stores, probably Target, Amazon. They're available all over the place. And this company called Jemi, they make a lot of motor sound, animatronic types of things for holidays in particular. They also do a lot of the, I found out last week from someone on our chat, some of the best lawn inflatable types of animatronic things, giant spiders that sit up on your roof and stuff like that. I think they maybe even have done some of the stuff that uses versions of the Halloween mask. What's the mask call? I'm forgetting now, but our digital eyes. Do I have one around? What's it called? Monster mask, that's it. Some of those, I've seen at least one werewolf that uses the monster mask, which is pretty cool. Or a version of that, TFT eyeballs. So last week I took this apart and we looked at how it works. And I was actually surprised to see I didn't find any teardowns online. People collect these and this fandom wiki page goes through the history of them and where you can buy them, which versions exist, what phrases are on them. And the one I have does these four, enter at your own risk, welcome good evening and you rang. I think those are the ones that are on mine. One thing that's popular among people of the internet who are fans of these is to rip the sound from them. So they'll either get a microphone or even better create a sort of line in by soldering to the speaker output and then going through a audio interface into their computer and they'll make high quality recordings of the sounds. So I wanted to try taking this set of phrases which are on the spider, which is not the version I have, and be able to play those on mine as well as control the timing of the eyelid and eye motion, maybe change the eye motion myself. So this is sort of the answer to the question, why would you want to connect your microcontroller? There's a perfectly good one already in there that does everything, but for the sake of customization, modification, understanding how it works, it's all a lot of fun to go in there and figure out what makes this thing tick and how to drive it yourself. So the first thing we'll do is actually take a look at determining what is actually in one of these so you know sort of the specifications that you need to be able to handle when you're gonna drive it yourself. So let's head over to the workbench and I will start off by exploring the motors here and figuring out what their specifications are. And before I do that, I'm gonna get my chat up so that I can see you there, hello. So since I have this set up right now, the first thing I'm gonna do is actually check the current of the motors. But before I do that, let's zoom in here on the motors a bit, try to focus on them. And if you're not experienced with these, the first question is just, what kind of motors are we dealing with? And the options for motors in electronics tend to be three kinds typically for spinning motors. So there's gonna be simple DC motors, either brushless, generally brushless DC motors. Servo motors, which are a little more expensive but can be controlled to go to specific angles. And then stepper motors, which are even more complicated to control, so more expensive, can go to very precise positions and you will not find those in toys. You're not super likely to find servo motors in toys unless they're remote control things generally. So nine times out of 10, if you open up an inexpensive Gizmo like this, you're gonna find DC motors. Other clues that we have DC motors are gonna be just the general shape. So I don't have any out, let me see if I have one I can grab from somewhere else, but just learning to identify what these motors look like is helpful. Do I have any? No, I don't have any readily available. So, but this metal, flatted cylinder type of shape with a plastic end, very typically the DC motors, this one's blue. You usually see them in this white, the plastic part. And then another clue is this capacitor here. You will often see a, let me get something to point with, you'll often see a little sort of beige colored disc soldered between two terminals, which help to deal with a lot of the noise that comes off of these motors so we don't interfere with the electronics on the microcontroller itself. Other things that we have to look at, okay, what's the power supply that's driving this? What's the voltage of that? And then we also have in the case of this one, an LED to consider and a speaker. We have audio on here and we have a little speaker built into the back lid. So the first clue for us in figuring out what we're gonna be, where our requirements for driving this thing are just gonna be the voltage that is supplied by the batteries. So this is three batteries, three alkaline AAA batteries are what came in the toy. And that's what we'll start with there. If you need to replace your batteries, this is what you're gonna be looking at. It's these guys right here. And these are actually the ones it came with. So these start off life at a, nominally at 1.5 volts. So that's gonna be four and a half volts of DC that drive this thing. So the somewhat reasonable thing to guess at first with toys like this is if they aren't doing anything terribly fancy with boost converters and buck converters is that probably these motors can handle something close to just that straight up battery voltage. And it's pretty common for these to be able to handle anywhere from maybe three volts at the low end, three, four volts at the low end and they'll still turn up to nine or 12 volts. But in this case, I'm just gonna guess that something around four and a half, five volts will be safe to drive those with. The next thing we can do after guessing is to check the voltage. But just cause I have things set up for this and I don't wanna reset it up before I do that, let's just check the current draw. So the way that I'm doing this is first of all, I took a picture of this board here before I started pulling the connectors off. And one thing that we saw last week that I thought was great is that this board connects to almost all the peripherals using two pin JSTXH connectors, which are pretty much the same connectors that you find in our battery packs. If you look at the battery pack for our LED glasses, same type of connector there, or similar type of connector. Actually, these are pH size and these are XH size. But the JST connector is a pretty common one. Adafruit happens to have some things that make it handy for dealing with this. One thing that I had laying around was a kit of JSTXH connectors. So that's the exact connector here. Here's a spare one of them. So those are kind of useful for interfacing, especially if you're gonna make a circuit board and you wanna lay down, maybe use one of our PromaProtos and lay down some connectors that you can plug stuff into. And we also have, I don't have any right here that are the ones we sell, so I made some of my own. We have in the store some little pigtails that are in different numbers. So these are the two pin JSTXH. So what I've made here is essentially something that I could plug one of these motors into and then I have bare wires on the end that I can plug into whatever I've got driving it or we can terminate that in other things. I'm gonna use screw terminals, but I've got one case where I did some little pins on the end of it. So this gives me a connector that allows me to hook up all these peripherals to my own microcontroller and avoid the board there. So looking now at the layout of things, the eyelid motor, so that's this motor here, when this turns, it pulls the eyelid open. And I don't know if I can make it do that without actually driving the motor, but we'll see that happen in a second. So what I've done is I've connected my multimeter and I'm gonna be using it in current measuring mode. So we switch our leads out to measure current and then I've got the output, this is the port that drives the motor. And what I've done is I've set one wire from that motor, so this is the motor connector. One of those goes directly to the board. The other one travels through my multimeter in current measuring mode. So that means with the power coming from this battery pack, I still have that connected, and the button that's on the front to ring the doorbell is still connected, so I'm gonna reach around there and press that. I'll put this multimeter into min-max mode and I'll press the button and we'll see it's drawing about 0.1, maximum, okay, 0.2, about 0.2 amps or 200 milliamps. So I know that my current draw needs to be roughly that, this is measuring the max, so it probably didn't go any higher than that if this thing is measuring quickly enough, but you can give yourself some leeway there too just to be safe. So we know we need to be able to supply about 0.2, 0.3 or 200, 300 milliamps to that motor. The other motor is actually drawing less and that's the one that moves the eyeball side to side and it's because this one is essentially stalling, it's pulling and stopping and holding actually, it's pulling and holding in that eyelid open position and I can just turn that around for fun so you can see that. So again, we'll clear this out, let me set the range, put it in min-max and it'll stay on max. Press this, it opened up and I don't have the speaker connected right now so it's not, you're not hearing any of the audio out of it but it does still also do the audio. So that was less that time and it probably had to do with me flipping this upside down so it was easier for the motor to pull that stuff. That's my only guess is that we gotta assist from gravity, could be wrong there but that's my guess. So next thing I'll do is I'll detach that and we'll do the sort of easier measurement and the one I actually did first which is just what's the voltage it's supplying. So let's look at that same connection there. Let me put some stuff here. So I'm gonna disconnect the leads that are going there. I'm gonna disconnect the motor entirely so that motor there plugs into that port and now I'm gonna switch my multimeter into voltage measuring and I have the leads of my multimeter going into some little Dupont connector wires so that I can plug those in and you'll either get a negative or a positive on here depending on what you pick. This one you might not be able to see it actually says plus on it before I bring this up a little higher. This has a little plus sign right next to it so I know what happens to be plus. It doesn't matter. Either way we're just finding out the voltage on this and it will in this case go, it should go positive and negative because the motor heads in one direction and then the other is a chance this one only goes in one direction and then just let's go. So it might not go negative. This one does for sure. So let's try them both. So again, I'll set this to min max and I'll press the button. So it's trying to turn the motor to pull that eyelid and we get a max here of 4.4. So like I said about, oh, you can't see that. So 4.5, 4.4 volts. That's what we were getting off of that one. This I think I'll, let me consult my photo. I took a photo last week before I took everything apart that I'd remember where it goes and actually it's down here at the bottom. Yeah, so these are the two motors down at the bottom. So let me switch this out and this one actually has the same orientation. So the positive is marked on the board on the right and I will clear this, hit the button. And so you can see this one goes up to 4.5 and then goes down negative 4.5 roughly. And so that's the eyeball kind of sweeping back and forth as it turns positive and negative. So there's some kind of a motor driver, like an H bridge motor driver that can send positive and negative voltage which the DC motor is happy with. And this is another clue that it's a DC motor you're dealing with. I don't think you're gonna see that with something like a stepper or a servo motor. They're gonna get positive voltage and then other methods of controlling them. So if we look at the minimum and maximums, it didn't store them. All right, why not? Let me try that again. So 4.3 max and then it should drop negative. Yeah, minimum is negative. All right, so those are our clues on that. Then I'm not gonna mess with the LED right now. We can, yes, that it's gonna require something like a 2.2 volt, 2.5 volt, something like that. You can even just look up based on the color. You could detach this and do the full current draw if you wanted to as well. And then there's the speaker. And actually this is one that I need to find out. Just generally you find somewhere between like four and eight ohm speakers in these things. So it's a safe bet to start with a audio amplifier that can drive that as a, that can drive four or eight ohm speakers. If someone knows of some of the better ways to figure out what we're dealing with with the speaker or with checking the audio signal coming out of it, I'd love to know. I'd like to write that up. In this case I guessed and it just turned out okay and it didn't ruin anything. But that's another part that you'd wanna figure out. So let's see, what I'm gonna do next is take a look at how we can drive this. So what I decided to go with, if you look at our requirements, we have two motors. We have a switch we wanna read. So I wanna read pressing that switch. We have a speaker we wanna drive with the audio amp. And we have five volt roughly motors and the current draw is actually nothing too strong. So the Adafruit Cricut is a really good candidate for that. There's our Cricut board. And I can drive this from a feather. There's also versions that you can drive from a Raspberry Pi, from a micro bit and from a circuit playground express or circuit playground blue fruit. I'm using a feather RP2040 in this case. And what we wanna do here is actually, I'm gonna remove some of these and put in these nicer connectors I made. What I wanna do is be able to just plug in stuff from the doorbell into the Cricut and then write code on the feather that will drive those things. So the Cricut takes care of, it has a port here that we can plug in a battery pack, alkaline battery pack or wall power depending on how you're using this thing with a DC AC DC converter, wall wart. And then I'm using one or two of these signal inputs here or in-outs, I'll use the input to read the button. When it gets pressed, we could use one of these outputs to drive the LED in here inside of the eyeball. I've got audio output. And by the way, one of the gotchas with audio output on the Cricut that I forgot at first and thought, what's not working here? There's a jumper that you need to close when you're using the audio system on here. So I've closed that little pair of pins on there with a jumper so that I know the audio amplifier is gonna work. It's a little class D amplifier. We'll connect to that. This may or may not be necessary. You can place a capacitor across ground in five volts to avoid brownouts, even out, smoothing out the voltage on the whole board. And then I've got two motor ports that I'm using to drive DC motors. So what I'll do is I'll take these nice little guys here. We might as well use these and connect those up. So I used silicon wire and connected and soldered to the little loose guys, but we sell these pigtails essentially, I think a five pack in the store. So they might be a better way to go. So I'm using silicon wire, which one of my favorite things is you can just trim the insulation with your fingernail and then we'll plug in to our Cricut board. Let me zoom in here to my maximum zoom and get you some focus. So for this, again, with these you can change in code which is positive and which is negative. So it actually doesn't matter too much, which way you go for the DC motors. The stranded wire is a good choice for these terminal blocks. In fact, better than what I had in there before, which was little Dupont connector pins. So I will connect that up. And so this is the eyeball side to side motor and I'm plugging that into motor one. These are marked on the silkscreen as motor one and motor two. So motor one will be to drive the eyeball left and right and that'll just connect like so. Well, we get all of these connected up. So next we have the eyelid. I don't need that anymore. This one is orange and gray. I was able to match the colors pretty well of what's in there which helps you to not get so confused. I think that's how I had that. I hope so, cause this is the one I don't wanna get wrong cause it will yank the thing open when it's already open, if I get it wrong. It is actually a pretty sturdy mechanism. I didn't break anything so far. So let's see. One thing you can do is move things just a little bit lower power and not for very long at first to see which direction motors are going. You can also loosen up the motor mounts so that they wiggle in there instead of binding. Then audio. So the speaker is this little green wire connected here and it's nicely mounted into the plastic here and it uses this whole cavity as a resonator so you don't wanna mess with that if you can leave that connected and use the speaker that they used that'll work best. So for green wire that's gonna go either of those, polarity doesn't matter in this case into the little audio out. I'm gonna twist this a little bit. This is the one trick with stranded wire and screw terminals is you don't want like one little bitty thread to bridge their connections and it happens sometimes. But you also don't really wanna solder like tin those because they don't get grabbed as neatly by the screw terminal. And then lastly I've got my switch connection already there so let's start hooking some things up. I can move my, clear out my space here a little bit. Out again. Okay, so we'll do, I'm not gonna use this battery power for now. I may, we'll see. So this is gonna be the speaker and now it connects right in like that. We can do the switch which I have plugged into signal one and ground here. Do the motor for the eyeball and then motor for the lid. And I think I got those right. All right, so why don't we give it a shot right here and then we'll go and look at the code but I've got this doing some stuff already. Not quite everything but I'm gonna give this power and I happen to have a really beefy five volt wall wart switching power supply actually. Okay, so with the Cricut, if you're not familiar with these, the power is supplied by the Cricut board. You can program the feather here over USB-C but you're not using that for powering the whole thing. And then there's also a little micro USB B connector for flashing the firmware of the Seesaw chip on the Cricut. I don't need to touch that most of the time. Should just be fine. Maybe flash it once. So now I'm not really doing anything on the board physically. I'm actually gonna use this button here when I press that that should be read over signal one on here and then it should tell our motors and speaker to do stuff. So let's see what happens. Okay, so I got the lid backwards. So it opened at the end. Let's turn this off and I will switch those around. Yeah, so that motor only goes one direction during the animation. The eyeball goes side to side but the lid only pulls open. So what I'm gonna do just for safety of the device is I'm gonna unplug this connector so that it doesn't try to open itself a second time when it starts up. And then I'll plug it in once it's running. Power that up, press the button. Okay, now I can close that. Here you can see it scooted when it closes up. Okay, so now it should work. So what you're gonna hear now is a different voice track, a different audio file. It'll do the ding-dong and then it's gonna do a different voice track. That guy loves to scream. So let's take a look now at the code that I've got running on there so far and maybe we can mess around with that a little bit. Let's see, can I, I might have to bring this power supply over there. You know, in fact, let's just look at the code first and then we'll see if we wanna mess around with it. Adam Bryant says use an analog meter to measure the speaker. Oh, that's an interesting idea. Right, so let's jump over to the code. We can leave that there. And yeah, it does sound a bit like a Wilhelm scream. That's a good point. Work, okay. So let me grab the code here. Okay, so here's what I've got running on there. I'm importing the Cricut library. It's a little cut off there. Importing the Adafruit Cricut library as Cricut and that actually takes care of a whole bunch of stuff at a high level other than the audio. Audio is handled on the feather and it's just using the amplifier circuit on the Cricut. But everything else is handled essentially by the seesaw chip on the Cricut and these are the commands we're using. So for example, for the button, we're just saying button is a variable for Cricut signal one. So signal one is that part of that little block of six input output pins that we have there. Then I'm setting that pin mode to be an input pull up. Audio I'm setting up as a PWM audio on the, this is a feather RP2040 so it does PWM knot, doesn't have a DAC and it does that over A0. And then I'm setting up a set of audio MP3 files as this little list called ring one, two, three, four and five. I should probably give them a different name because these aren't the rings, the ring is this one here called ring zero. These are actually the voice files. And I start off with the first one in this list. So I have a variable called current audio file and that starts off as this one here, the first one. Then I set up the MP3 decoder. So this is using audio MP3 which is built into Cricut Python. MP3 decoder, open the ring zero, zero MP3 file. That's just the ding dong part. Then I'm setting up my two motors. So I called the motor I and motor lid and those are the motor one DC motor one and DC motor two outputs of the Cricut. Then I've created a function here for opening a lid and this is mostly through trial and error. I just figured out that setting the throttle to full speed, it's actually not backwards, full speed ahead is the direction I need to send it. And remember before when I ended up switching the leads we could have also just switched it in code if we wanted to. So I set that for just a quarter of a second. So time sleep 0.25 is enough to get it open. And then I set the throttle to zero which is essentially like stalling the motor. It holds it open. I believe the stop it might be the stop command or idle there's something that kind of just puts it into neutral. But this I think is holding it there so that it can fight the springs that would pull it closed. And then close lid is my function for closing it. And this is just for clarity. You could of course do this other way is like just have one lid function that you give an argument to zero or one that sort of thing. But for clarity I made two functions. And then that's all the setup that's necessary. And here's what happens in my main loop. And again I've kept it pretty verbose for clarity. So first thing is we check the button. If the button goes low that means we've pressed it. So that's why it says if not SS which is for seesaw digital read button it'll print that it's been pressed. It will set the decoder to be the ring and then I play the decoder file. Then I open the lid after it plays that ding dong. So that's why it says while audio playing pass. So this means we don't have to do something like know how long it is and set that in as of time. Instead just say while audio is playing what do we do inside the loop we just pass. Then that means we're just gonna hang out here until that audio file is done playing. So it goes ding dong. Then we run the open lid function. And then I'm changing what this decoder value is. And there may be a better way to do this. I think if I looked at some of RMP3 player code like stuff that Jepler did there may be a better way but the way I decided to do it, first way I tried it that actually worked is this. So I just decoder change what file it's pointing at which is that audio files list and whatever the current audio file is. So it starts out as zero. So it's the first item in that list. And then I play. This time I don't wanna wait for the audio file and I in fact wanna do all of the looking around. So while it's playing I'm essentially looping this over and over again. So however long that audio file is it's going to drive for half a second in one direction at almost half speed, .6 speed throttle. Then it's gonna pause there for a second. Then it's gonna go for three quarters of a second. The rest of that direction. Then it's gonna switch and back and forth. So it's this little kind of look, stop, look, stop, look, stop that's ideally gonna look like it's picking out different trick or treaters in your front yard. It'll loop through that cycle. So I don't want that cycle to be too long because I don't want it to go on forever and ever after the audio clip is done. And you could make this a shorter cycle and then it would stop pretty much right when the audio ends. But when the audio ends it's done doing that and it does this, throttle zero. So I stop that motor and then I run the closed lid and then I increment the audio playback file. So the next time we press the button it will go to the next one in the list. And I'm using modulo of the length of the list minus one so that we loop back around over and over. So every time we press it we'll just run through those five audio cycles. And so that is the basics of how this works. The, some of the setup for it was just finding the audio files. You could use anything you want, right? Any MP3 file that you can play back. The ones that they recorded for these devices sound particularly good because they're in sort of a range that works really well for that speaker, sort of the sonic range that it's in works really well. I tried playing a little song that I'd written and it sounded terrible because it needed a lot more bass than that speaker could give, but that screaming guy and all of his creepy sayings works really well on there. And let's see. So if, yeah I think that's probably a good place to stop with that. You can imagine it's free to you to code up whatever you want it to do. I haven't got the LED hooked up yet only because that's the only thing on there that wasn't on a connector so I will have to cut or splice the wiring on that to use that and then still be able to put the thing back together. I was hoping for a totally non-destructive hack but I will have to cut the wires for the LED or desolder them to be able to use that. So let's just have one more look at this guy before we wrap up. We'll hear a different phrase this time because I haven't turned it off so it's ready to cycle to the next one. Also one thing I did was I have, let's see can I put me in the corner there. I have not opened the eyeball all the way. It'll actually open that far if we drove that motor for a little longer so I decided it looked kind of neat to have it creepily partway open. So again that's the kind of choice you get when you're driving it with your own microcontroller. Other reasons you would do this is we can have wireless, right? If we used a, let's say ESP32S2, we could connect this to the internet over wifi. If we used a NRF52840 based feather we could do Bluetooth stuff, trigger things off of your phone. Also you can add a lot of other sensors so you could maybe add a light sensor or a distance sensor to the project if you want. And the other thing I'm thinking is it may be plausible, let me unplug this for a second to turn it off. It may be plausible to fit this in here either as is, we may have clearance or more likely extend the back. So make a longer back or 3D print your own back on there if you wanted to or you could sort of neatly wrap all those wires through a little hole in this maybe come through the battery port and have this extended in somewhere else. So you've got options there. Again, not to disrespect the designers of this cause it's fantastic they've done what they've done for the low, low cost of $15 for this thing mass produced. It does what it does, it does it really well but we get to kind of explore and hack and modify if we want to. And in this case, the chip on here is just an epoxy covered blob. So there's no reverse engineering it or taking over and putting different audio on there. You're not gonna be able to do that unless you're super, super Uber hacker. But for me, I just wanna take over these and they made it really easy with these connectors. So I get to mostly take advantage of the physical form, layout, enclosure and mechatronics that they've designed but with my own audio in this case and my own animations. You can imagine I've gotten really tired of that guy screaming, oh by the way, one other thing let me go back over there. The original was louder than this and another thing to know about the Cricut is that it has a little potentiometer that you can turn with a screwdriver. This is tying a little trimmer pot that you can adjust the volume with. So check this out, let me get set up for it and then I'll, so we can get really loud or much quieter while we're testing which is nice. Unbelievably loud, sorry about that. I don't know if I'll have a ringing in my ears for this to the day based on that one. So thanks for coming by and hanging out. Lots of fun to play around with these and hopefully it inspires you to go and look through your bin and Halloween stuff or holiday stuff. These jemmy people make all sorts of Christmas stuff, Santa things, reindeer. I don't know what other, they definitely do Halloween and holiday, Christmas, winter holiday kind of stuff but there's probably more. I think they did SpongeBob stuff though, it'd be kind of a fun one to hack so. Especially you can get these on clearance. I see people finding these for a couple bucks on clearance mostly because the batteries have leaked out at the store over time. So get them cheap and hack at them. Have a lot of fun. All right, check in with our Discord before I go. Where'd my Discord go? Have I lost it? There you are. Hey Discord. Thanks, yeah thanks Jim Hendrickson and Halloway, Foamy Guy. Foamy Guy, volume knob for testing is so nice. Working gadgets like that before and hearing it play a million times so your work can get sold. Oh, one other funny story I want to share. While I was in process of this, I had unplugged a motor and I plugged it back in to test it into the main board, the original board and I had the speaker unplugged but when I hit play I was hearing sound and I was like that's weird. Do they have like a tiny speaker built onto the board or something? No, it turns out I plugged the DC motor into the speaker output and the DC motor was acting as a speaker which is, I'm sure makes a lot of sense to some electrical engineers out there but for me I was like whoa, why is the DC motor a speaker? But it is, everything's a speaker and every speaker is actually a microphone. So, transducers man, how about it? Let's see, other thoughts and questions. Marie Meyer asks, do you have a link for that site? So they're called Jemi, J-E-M-M-Y. They may or may not even have their own site. I think they just manufacture stuff and sell it to retailers. So the site I was looking at was a fan site, fandom.com, so jemi.fandom.com. And this is just, this one just happens to be about their eyeball doorbells but I think if you hit the Jemi Industries Wiki you'll see their number one for Halloween and Christmas. These are some of the kinds of things. Novelties, yeah, they did Billy Bass. I don't know if they were the inventors of it but I see their name around Billy Bass. Probably they are, were the manufacturers originally. And so yeah, tons of stuff, large scale things, werewolves and so on. Probably Paint Your Dragon or on Phil Burgess has knowledge of this. See, Grimaces DC motors do that. The cheaper the motor, the louder the sound. Yeah, it was definitely discernible. Sounded like a tiny speaker, freaked me out. All right, I think that's gonna do it for today. So thanks everyone for stopping by and I'll see you on Tuesday for another John Park's product pick of the week. Tune in tomorrow for Scott's Deep Dive where he continues to put Circuit Python onto the bare metal of raspberry pies and upsets the natural order of the universe in doing so, but very exciting. Imagine the power we'll have. I think that'll do it. So thanks everyone. See you next week.