USB Powered LED Christmas Tree With Sound

by brucedamoose16 in Circuits > USB

4775 Views, 5 Favorites, 0 Comments

USB Powered LED Christmas Tree With Sound

P1000918.JPG


Here is the finished product.

The Christmas tree is made with an arduino ATMEGA-168 chip.

I used it as a belated christmas gift for someone in a gift exchange.

First instructable so please take it easy on me should i do something blaringly wrong.

Attatched are the scematic and the PCB Layout in PDF and EAGLE format.

Also attatched is the program i used for the ATMEGA-168



Materials

P1000923.gif
P1000922.jpg
Here are the Materials I used for the tree:

Stiff Stainless Steel Baling Wire
14 cut and stripped 5" segments of hookup wire (red)
An Arduino ATMEGA-168 Chip
A specified PCB (file attatched)
An old USB Cord
A Piezo Speaker
14 100 ohm Resistors
2 22pF Capacitors
1 100nF Capacitor
7 Red LEDs (diffused)
6 Green LEDs (diffused)
1 Amber LED (diffused)
A 16MHZ crystal oscillator
2 3 pin ICSP (in-circuit serial programming) headers      *six pins total
A Lid to an old can or tin.
Electrical Tape
Solder
Soldering Iron
Wire Cutters
Wire Strippers

Coil the Wire Frame

P1000908.JPG
P1000925.JPG
 The grounded baling wire needs to be coiled in a cone like fashion.  With patience you can come out with a pretty good cone. I used a paper cone as a guide and then used pliers to twist/bend it into shape.

Board Assembly: Capacitors

P1000928.JPG
P1000929.JPG
P1000930.JPG
P1000916.JPG
The Capacitors need to be soldered in the following places:

*note: the capacitors shown are not the ones used in the actual board.

Board Assembly: Resistors

P1000931.JPG
P1000916.JPG
 Only 1 100 ohm resistor is shown but the other 13 go in a row next to it.

*Note: the resistor showed in the picture is not the one used in the actual board

Board Assembly: ATMEGA-168

P1000932.JPG
P1000923.gif
 The ATMEGA-168 chip goes in the other row in the PCB.

*Note the chip shown in the picture is not the actual chip used in the board.  The ATMEGA-168 goes out much further than the one shown. use your imagination.

The second Picture gives you a better idea as for the size of the actual chip and its placement

Board Assembly: Crystal

P1000933.JPG
P1000923.gif
 This step is pretty straightforward. The 16 MHZ crystal goes in the shown location. you might want to put a piece of electrical tape underneath the crystal so the shielding doesnt short out on any of the PCB etchings.

Board Assembly: ICSP Header Pins

P1000923.gif
P1000934.JPG
 I didnt have any spare ICSP header pins so this picture shows the placement on a blank PCB.

Note: When putting on the ISCP headers, it is very important that they are put on straight and vertical.

USB Cable: Preparation

P1000936.JPG
P1000937.JPG
P1000938.JPG
P1000939.JPG
P1000940.JPG
P1000941.JPG
P1000942.JPG
The USB cable needs to have a standard Male A USB plug.  Cut off the other end of the cable with wire cutters, strip the wire, remove the shielding.  Sometimes there is a fibrous center amongst the wires, cut that off as well.  Then separate the green and white(data+ data-) from the black and red(+5V and Ground).   Cut off the Data Wires (Green/White).

*note when cutting off the data wires, cut them off at different levels so they dont short out on your computer or usb outlet.

Finally, strip the black and red wires and solder them in the shown position.

Board Assembly: Piezo Speaker and USB Cable

P1000944.JPG
P1000935.JPG
Since the USB cable connection tends to be fragile, i found that it helps to clamp it in place using the piezo speaker and the ATMEGA-168 chip

Board Assembly: LEDs

P1000926.JPG
P1000927.JPG
P1000943.JPG
Solder one of the 5 inch long hookup wires to the positive pin on the LED(this is usually the longer one) leave the shorter ground pin as it is.  Either electrical tape the connection or use heat shrink tubing(shown in the picture)

After doing this to each LED, solder each to the PCB in the correct positions.  The thicker etchings on the PCB are ground or +5V(ground in this case) and the thinner ones are connected to the ATMEGA-168

Making the Base

P1000943.JPG
I used a Coffee Tin Lid as a base but it can be anything really. Just make sure that it doesnt short out on the Solder Connections on the PCB or on the Wire frame which is grounded.

Soldering the LEDs to the Wire Frame

P1000925.JPG
P1000908.JPG
P1000919.JPG
Each LEDs ground pin needs to be soldered up to the Wire Frame.  Bend the pin into a little hook around the wire frame and use needle nose pliers/forceps to hold it in place because it will get hot. Solder each one to the frame at staggered distances in an alternating red/green pattern.  Solder the amber LED to the top and solder the bottom to any of the ground holes on the PCB.

Programming

P1000945.JPG
P1000946.JPG
Attached is the file for the program I made:

In order to program the ATMEGA-168 using the ICSP headers, you need an ICSP AVR programmer

By using the commands make (which compiles it) and make upload (which downloads it) in command prompt/terminal you can put your program on your ATMEGA-168 chip.

Downloads