This in HPR episode 19118 entitled, Arnry Ngopampkin, it is posted by Groups and in about 7 minutes long. The summary is, Groups talks about how his classmate-upampkin has come online for Halloween. This episode of HPR is brought to you by an honest host.com. Get 15% discount on all shared hosting with the offer code HPR-15, that's HPR-15. Reach a web hosting that's honest and fair at an honest host.com. Welcome to HPR. This is Drupes and today I'm going to be talking about my Pumpkin. Now, this pumpkin was an idea that was found on Etsy or Pinterest or whatever, but somebody made a pumpkin that opened and closed its mouth. It was all electronic gold up and it was nerdy and it was cool. You can see videos and photos of our project on the HPR website. So go look at them right now, go do it right now because this will make so much more sense if you go look at it first. Go look. I'll wait on you. Some of my students help with building this monstrosity and my microcontroller class dissected the idea and they had some better ideas for the project. Now, when your students get to the point where they think they can do something cooler than you can do, then you know you're winning and they actually have sense back this up. Currently they're building some LCD-117 kits from modern device and are off on their own little awesome world of saying hi and getting things to work when they come into class and it's nice just to sit back and watch them go. So for this project we reused a perf board from an old project and a really bare bones board from modern device. That RBBB or really bones, bare bones board is a really cheap way to add an Arduino clone to a project. There's some smaller ones, there's some cheaper ones, but I like to be able to pull off the chip and from the project and so having that RBBB is really handy. The first we set about making sure that we could open and close the mouth of the pumpkin. In this project we were emulating, they used a servo to open and close the mouth but servo's are expensive especially when you're putting inside a nasty pumpkin that's gonna rot and last year my junior high class took apart some old BCRs which was awesome like we spent like a week taken apart BCRs and Google and parts and seeing how things worked and they didn't really know what those were. So we had a bunch of motors left over that had some large gears attached and thought that would be a handy way to do things. So we drilled a hole in the gear and we were able to add a coat hanger for the record coat hangers or almost as handy as electrical tape which obviously we also used and we used this coat hanger to lift the top of the pumpkin up on each rotation of the gear. Now I forgot to really talk about the pumpkin. I cut it like a kind of like Canadian from South Park kind of way which is to say that all way around in the middle and with big sharp teeth like really tall teeth and this is the clever bit and I didn't come up with that at all but it's what made this project click in my head because having these big tall teeth when you it allows you to raise the top and drop it with the appearance of it biting and it falls right back into place because of the nice big teeth. So thank you internet stranger for this awesome idea and I'm trying to find this project again and I came across a bunch of others that trying to solve this problem and did and many were using a hinge that they cut out and I'm going to try that next time but the teeth idea worked perfectly. So using coat hangers now I told you they were very handy. I was able to fashion some feet and that held the motor up and the first mistake we made was that the nine volt battery that we were using to test this motor it worked great but the really bare bones board didn't have enough to run the motor and open the mouth and so this was easy to fix. The whole project was powered by a nine volt battery so I simply used a relay to connect nine volts straight to the motor using a five volt pin on the Arduino to manipulate the relay. Now that the motor is working we had to figure out a way to turn it on and just having a switch is kind of lame so we used light to make it interactive and cool and when you have an analog value like how much light is in this room you need to have a way to adjust this level. So in this case we used a knob or a tissue holder and that worked just fine so we were able to set a threshold of this is what this room is like so we could carry out the school and have it operate and so we wired those up we threw in a couple LEDs for eyes and we started to code. So Arduino programming is as complicated as you want it to be. There's two required functions maybe that I haven't required the loop we probably want but anyway the two main functions that every most Arduino programs use is set up in loop. Set up gets everything ready and it runs once and loop is that's where everything repeats itself forever or it tells a loose power or tell you tell it's stop. So in the setup we tell the Arduino which pins will be input so which pins will be outputs outputs the stuff like turn the motor on and off or turn the LEDs on and off and input reads the potentialometer and reads the light sensor. So this program which is included on the HPR site where you should have already gone to look up videos and pictures it kind of flows like this. When the pumpkin device starts it sets up the pins and is input now put and it goes directly into the loop and the loop it checks the potentialometer to see the sensitivity that we've set for the device. Next it reads the light sensor or photo diode if you're already like that and it compares that value with the sensitivity value of the potentialometer or the knob. Now both of these inputs are analog and the Arduino sees them as a value between 0 and 1023. If the light sensor is below the sensitivity value which means the lights are off the pumpkin animates and it comes alive. Now to animate we're simply sending 5 volts to the LEDs to turn on the eyes and the relay can act into the motor it also gets 5 volts and it waits about 10th of a second for cutting off the power and then the loop repeats itself and it checks the potentialometer, the light sensor and it decides whether to animate or not and this continues until the power is cut or we send new sketch that Arduino. Now could this be done better? Totally. Maybe have the eyes faded in now that'd be kind of cool. Maybe have it play sounds. Now maybe put some lights inside of the thing so when you turn the lights off like the mouth glows but then you've got all your motors and coat hangers and electrical tape while hanging out in there. Now this is the best part about a project like this is that you can make it your own. We had a lot of fun building this project and I hope that you get an idea from this and say oh snap I could do it so much better than they did it. Anyway I'm Drupes and this was HPR. You've been listening to Hecker Public Radio and Hecker Public Radio.org. We are a community podcast network that releases shows every weekday Monday through Friday. Today's show like all our shows was contributed by a HPR listener like yourself. If you ever thought of recording a podcast then click on our contributing to find out how easy it really is. Hecker Public Radio was found by the digital.com and the informonicon computer club and is part of the binary revolution at binref.com. If you have comments on today's show, please email the host directly leave a comment on the website or record a follow up episode yourself. On this otherwise status, today's show is released on the creative comments, attribution, share our lives.