Ever want to have a fancy, programmable Christmas tree? Look no more! It's so easy I'll just give out a recipe on how to do your own. I started this project yesterday when I went to the dollar store and I found battery-powered Christmas lights.
(https://31.media.tumblr.com/09085150a7dd90b09b49dfbabd5bf1d0/tumblr_mxrfrzUdaH1qexvxeo1_500.gif)
Yeah, I'm not the best at making trees.
You'll need:
- Battery-powered lights (about $1, mine have 10 lights and is powered with 2 batteries)
- A tree (also about $1 for the not-actually-a-tree-but-a-garland-on-a-plastic-frame variety, mine's about a feet high, perfect for your desk)
- An Arduino or any MCU lying around with its USB cable (around $25-30). Any programmable board that have at least a PWM pin and a ground pin will do, I used a TI C2000 launchpad (http://www.ti.com/tool/launchxl-f28027), but using an Arduino might be easier to program.
- Wire and/or an IDE cable (You should have those lying around if you did some electronics before. Else you should find that at the hardware store.)
- No batteries! (around $0)
1. Decorate your tree with your lights. (Optional? Or else it won't be a tree otherwise.)
2. Plug the + side of the battery pack to a pin that supports PWM on your microcontroller and the - side to the ground. (An IDE cable might be handful if you don't want to solder and the pins on the controller are male, unlike the Arduino.)
3. Load up a PWM example on your microcontroller, compile and upload it. Be sure the PWM pin it uses is the same as the one you plugged the tree in. You can send a number between 0 and 255 to that pin, 0 being 0% intensity and 255 is 100% intensity. (In my example, it's a fade in/out example.)
And there we go, a pretty christmas tree.
Now what else should I do with that?
- Use a button to switch between patterns
- Control the intensity via the serial port
- Change the intensity according to the music
The sky is the limit! Any other suggestions? I should try those ideas out in the holiday time. (Yeah there's no pics of the steps, I'll might add some later.)