Sunday, December 15, 2013

Arduino powered Cylon pumpkin

This has all happened before...


Reason: Halloween. Arduino. It's cool.

Equipment:
Pumpkin
Red LEDs x 12 
spare breadboard
Arduino Uno - to control the leds
Arduino Due - to play the sound file via the DAC
Cylon waveform - acquired here (  )
Parchment paper - to diffuse the light from the leds
Speaker - salvaged from old laptop

LM386 based audio amplifier (built on breadboard)

Method:

Print up an appropriate cylon template to carve up the pumpkin with (I went with the new school version). Then wire up your spare circuit board with the LEDs. I suggest connecting them as shown in the picture with a common cathode (negative side). You'll need some small resistors, one for each LED, to keep the current flowing across them to an acceptable level.


Also, you'll need to build an audio amp, as the DAC from the due can NOT drive a speaker, and indeed, trying to do so will most likely burn out the DAC (this is bad). The circuit is sketched out here (credit http://arduino.cc/en/uploads/Tutorial/LM386_AudioDue.jpg) :



Now get to coding. Check out the code on my github account ( https://github.com/chchchchia/Arduino-Cylon-Pumpkin ). I set the Uno to signal the Due at the end of the led sweep via raising a digital pin high. This signal tells the Due to play the audio signal.
Of course, you should test the lights.

 Now, CARVE.




 Next, get some parchment paper (or wax paper, or a light diffuser) and cover up the parts inside of the pumpkin that have holes.
 Now, you have one of two options : a.)get a plastic bucket and place your boards in this, and run the power line through a small hole in the back OR
b.) cut a big stinking slice out of the back and have the boards external, with only the LED array inside the pumpkin


Regardless of what you choose, test the setup!


Now, find a suitable location, plug it in, and enjoy!


No comments:

Post a Comment