Omnimaga

General Discussion => Technology and Development => Other => Topic started by: Juju on December 13, 2013, 02:50:54 pm

Title: The USB Christmas Tree Project
Post by: Juju on December 13, 2013, 02:50:54 pm
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:


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?


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.)
Title: Re: The USB Christmas Tree Project
Post by: DJ Omnimaga on December 13, 2013, 05:02:19 pm
That's cool, now if only the dollar store had lights that can change colors. Just make sure to avoid flashing the stuff too fast lol :P
Title: Re: The USB Christmas Tree Project
Post by: Keoni29 on December 13, 2013, 05:06:01 pm
I completely forgot about the yearly christmas hack! I should build this to make up for it!
Title: Re: The USB Christmas Tree Project
Post by: Juju on December 13, 2013, 05:23:52 pm
Yeah, right now it only fades in and out.

Another thing I could do is to add another set of lights and plug it in another PWM pin. I can do that for each of the available PWM pins, as in, I could add up to 8 sets of lights.
Title: Re: The USB Christmas Tree Project
Post by: Keoni29 on December 13, 2013, 07:40:29 pm
Funny how benryves did exactly the same thing.
Title: Re: The USB Christmas Tree Project
Post by: zero44 on December 14, 2013, 07:06:29 am
.. Last year I took some LEDs, hard disk wires for connexions, 2 PNP (or NPN ?) transistors, 2 little batteries and a 2.5mm male jack.

Create your Axe program, control your intensity through Port command and programmed PWM, then add blinking.. The z80 is the limit :D
Title: Re: The USB Christmas Tree Project
Post by: Keoni29 on December 14, 2013, 07:32:02 am
You mean IDE cables? Those are great. They have a lot of smaller wires in them which are single core. This is super easy to solder and you can put a lot of them in a tiny space. I use them for all of my projects now!
Title: Re: The USB Christmas Tree Project
Post by: zero44 on December 14, 2013, 07:49:29 am
Err, I meant HDD power wires :
(http://www.binbin.net/photos/generic/4-l/4-link-power-supply-cable-for-hdd-4-link-atx-power-.jpg)

You can put LEDs in the holes very easily, and the wire are thin enough to go in the holes of a RS232 port I have. (Yes, a RS232 with direct connection to a 2.5mm jack provides easy-to-use calc electronics :))
Title: Re: The USB Christmas Tree Project
Post by: Keoni29 on December 14, 2013, 11:17:53 am
How... what... why...
Title: Re: The USB Christmas Tree Project
Post by: zero44 on December 14, 2013, 01:09:37 pm
Any question ?
Title: Re: The USB Christmas Tree Project
Post by: Sorunome on December 15, 2013, 05:57:10 am
nice christmas tree, eeerm, nice blinking LEDs :P/me hides
Title: Re: The USB Christmas Tree Project
Post by: Deep Toaster on December 17, 2013, 10:14:21 pm
I came into the topic fully expecting something like http://xkcd.com/835//me runs
Programmable Christmas tree... Any games to play? :D
Title: Re: The USB Christmas Tree Project
Post by: Lunar Fire on December 17, 2013, 10:57:08 pm
I thought about it a bit. I have a kit with a PIC microcontroller and 4 PWM output. If I wire my christmas lights accordingly, I could make patterns with the different colors. *Leaves to get a christmas lights kit, a solder iron and some duct tape*
Title: Re: The USB Christmas Tree Project
Post by: Sorunome on December 18, 2013, 08:41:09 am
I came into the topic fully expecting something like http://xkcd.com/835//me runs
Programmable Christmas tree... Any games to play? :D
Christmas tree tetris O.O
Title: Re: The USB Christmas Tree Project
Post by: Juju on December 18, 2013, 11:45:14 am
I don't think you'll be able to play anything.
Title: Re: The USB Christmas Tree Project
Post by: DJ Omnimaga on December 19, 2013, 02:40:50 am
It will be less locked down than the TI-Nspire, though.
Title: Re: The USB Christmas Tree Project
Post by: Juju on December 19, 2013, 03:27:07 am
Interestingly enough, mine is based on a TI-C2000.