Introduction: USB Powered LED Christmas Tree With Sound
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
Step 1: Materials
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.
Step 2: Coil the Wire Frame
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.
Step 3: Board Assembly: Capacitors
The Capacitors need to be soldered in the following places:
*note: the capacitors shown are not the ones used in the actual board.
Step 4: Board Assembly: Resistors
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
Step 5: Board Assembly: ATMEGA-168
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
Step 6: Board Assembly: Crystal
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.
Step 7: Board Assembly: ICSP Header Pins
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.
Step 8: USB Cable: Preparation
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.
Step 9: Board Assembly: Piezo Speaker and USB Cable
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
Step 10: Board Assembly: LEDs
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
Step 11: Making the Base
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.
Step 12: Soldering the LEDs to the Wire Frame
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.
Step 13: Programming
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.