Author Topic: The USB Christmas Tree Project  (Read 8502 times)

0 Members and 1 Guest are viewing this topic.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
The USB Christmas Tree Project
« 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.


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, 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.)
« Last Edit: December 13, 2013, 05:03:41 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: The USB Christmas Tree Project
« Reply #1 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

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: The USB Christmas Tree Project
« Reply #2 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!
If you like my work: why not give me an internet?








Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: The USB Christmas Tree Project
« Reply #3 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.
« Last Edit: December 13, 2013, 05:24:01 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: The USB Christmas Tree Project
« Reply #4 on: December 13, 2013, 07:40:29 pm »
Funny how benryves did exactly the same thing.
If you like my work: why not give me an internet?








Offline zero44

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 128
  • Rating: +21/-0
  • <!--//www.ustr.net/infrared/infrared1.shtml-->
    • View Profile
    • zero44
Re: The USB Christmas Tree Project
« Reply #5 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
____________

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: The USB Christmas Tree Project
« Reply #6 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!
If you like my work: why not give me an internet?








Offline zero44

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 128
  • Rating: +21/-0
  • <!--//www.ustr.net/infrared/infrared1.shtml-->
    • View Profile
    • zero44
Re: The USB Christmas Tree Project
« Reply #7 on: December 14, 2013, 07:49:29 am »
Err, I meant HDD power wires :


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 :))
« Last Edit: December 14, 2013, 08:04:33 am by zero44 »
____________

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: The USB Christmas Tree Project
« Reply #8 on: December 14, 2013, 11:17:53 am »
How... what... why...
If you like my work: why not give me an internet?








Offline zero44

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 128
  • Rating: +21/-0
  • <!--//www.ustr.net/infrared/infrared1.shtml-->
    • View Profile
    • zero44
Re: The USB Christmas Tree Project
« Reply #9 on: December 14, 2013, 01:09:37 pm »
Any question ?
____________

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: The USB Christmas Tree Project
« Reply #10 on: December 15, 2013, 05:57:10 am »
nice christmas tree, eeerm, nice blinking LEDs :P
* Sorunome hides

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: The USB Christmas Tree Project
« Reply #11 on: December 17, 2013, 10:14:21 pm »
I came into the topic fully expecting something like http://xkcd.com/835/
* Deep Thought runs
Programmable Christmas tree... Any games to play? :D




Offline Lunar Fire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 66
  • Rating: +7/-1
  • I'll be watching you from the shadows
    • View Profile
    • My Tumblr
Re: The USB Christmas Tree Project
« Reply #12 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*
Your drill is the drill that will pierce the heavens!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: The USB Christmas Tree Project
« Reply #13 on: December 18, 2013, 08:41:09 am »
I came into the topic fully expecting something like http://xkcd.com/835/
* Deep Thought runs
Programmable Christmas tree... Any games to play? :D
Christmas tree tetris O.O

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: The USB Christmas Tree Project
« Reply #14 on: December 18, 2013, 11:45:14 am »
I don't think you'll be able to play anything.

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.