The last few days have been fairly hectic. I wanted to get "Ring of Fire" into a demo-able state (to take into work on Friday), so that it could go up today.
First up was building the project board. As I mentioned before, the LEDs pull 70mA, so I need a separate transistor to drive them, as the AVR can't handle the current requirements. The switch uses a 2n3904 NPN transistor, a 10K base resistor, and a 100K resistor between the emitter and base. And finally, an 42 ohm current-limiting resistor in line with the LED, in between the collector and 5V. That's 16 transitors and 48 resistors, and after about 5 minutes, it was clear that that wasn't going to fit on the board. I decided to put the current-limiting resistor next to the LEDs, and could barely fit the other components on the board. Here's a picture of the board:
Yep, that's a whole bunch of wires.
Next up was finishing the LED wiring. One of my bike wheels is built with 16 spokes, so I used it to mark the location the LEDs. Then I spent about 4 hours mounting the LEDs onto the ring. Here's a picture of a mounted LED:
The black wire is the 5V bus, and continues all the way around the ring. The yellow part is a 42 ohm resistor attached to the ground side of the LED, which is then attached to a red wire that runs all the way back to the controller. The LED is then attached to the ring with hot glue. Here's what the completed ring looks like.
That completed, I turned back to the software.
Problems that I hit along the way:
- I hadn't set the avr to use the internal clock correctly. This meant that it used the clock on the STK500 board, which I changed now and then, so the animation timing made little sense. This also mean that the chip didn't run when plugged into the board.
- Reset needs to be pulled low for the avr to run until reset is disabled. This means that until you are ready to burn the final version, you need to pull it low in the final circuit or you can't test it. This also means that that LED is always on. When you are finally ready, you set a fuse, and reset is disabled, so you can't program it using the in-circuit programming approach, so it's a lot harder to do.
Originally, I was going to put ping-pong balls on the LEDs to diffuse the light, but it turned out that the LEDs have a fairly wide viewing angle, so the diffuser wasn't needed.
So, the project is done, up and the tree looks pretty nice.