While this design is a bit more complex than the simple power switch most people might expect, the control circuitry is still really simple. I am using an ATmega328 microcontroller to read in a few switches and control the LED banks by way of logic level power MOSFETS. The mega328 is actually a bit of overkill; everything could have been built using a smaller µC such as the tiny24 with the addition of an external shift register to control the LED banks and bit more code optimization, but I hadn't used one of these larger chips in a while and wanted to use as few external components as possible. Plus, I didn't know how much program space I would actually need.
There is a small mistake in this schematic (in addition to misspelling "Rzr" as "Razr")... the series resistors should be 20Ω instead of 10Ω. I kind of made a rare mathematical error that caused me to need to add an additional 10Ω resistor in series with each bank that already had 10Ω during testing. I also had to replace a few LEDs that quickly burned out from too much current. Oops...
In total there are 336 LEDs: 6 banks of 36 and 4 banks of 30. Each bank is made up of the strings shown in the schematic. Two parallel strings of 3 series resistors share a resistor, and there are either 5 or 6 of these parallel strings in each bank. Confused yet? I know I am.
Aside from the power switch, I used 2 single throw, double pole, momentary rocker switches to allow user control of the LED brightness and flash speed as well as a mode select button. The primary reason I used a control circuit instead of a simple on/off switch was the added potential to control the LED brightness. Since I was already using a µC, I threw in the alternative mode operations and flashing speed control just for fun.
The biggest challenge was designing a container to hold all of the LEDs. Using the same techniques demonstrated in the CycleLux Project, I created 10 banks of LEDs attached to foam boards. The box to hold them was to be made out of plexiglass, and I planned on using aluminum pieces to create an internal frame to connect the plexiglass pieces together. Once I had everything cut and holes drilled, I glued the aluminum channels to the plexiglass and added nuts and bolts to security. The front, top, and bottom pieces were permanently fixed with glue, but I left the back piece off to allow access to the LEDs. To secure the back piece, I tapped a series of holes so the back panel can be easily removed by taking out the set of screws.
To ensure proper air flow, I created a few angled pieces to cover the sides except for a small hole on the bottoms of the sides. Then, a pair of small fans - one at either end of the box - would have a way to push and pull air through the entire enclosure. A small piece of wire screen was used to cover the vent holes to keep out all but the tiniest of creepy crawlies. The entire box and associated pieces (except for the transparent front panel) were painted black.
The box is made out of plexiglass with an aluminum frame.
The completed LED light box.
With the LEDs working, it was time solder the control circuit to a real board and build a box to house it and the control switches. I tried to keep the box as small as possible. The switches ended up taking up more room than anything. If I make future versions of this light bar, I think I will try to incorporate the switches into the bottom side of the LED box to eliminate the need for an external control box. The other problem with this design is the need for 10 separate control lines for the LEDs from the MOSFET drivers on the circuit to the LED banks in addition to the high current carrying main power line. Having the circuit and switches inside of the LED box would be much better. I used 25 pin D-SUB connectors to carry all of these power and control lines. A connector with a high current pin would have been better, but I didn't have any in stock. To carry the high current through the connector, multiple pins were used in parallel for the main power lines.
The front and sides of the control box were made out of wood while the back and sides were pieces of plexiglass. Aside from the switches, control circuit, and 25 pin D-SUB connector to the LED box, the control box holds a blade fuse and main power connector.
To be able to test the entire system, I had to use a 12V desktop power supply. Everything worked well, but I needed a way to test the system again after it had ridden in the cargo bay of a plane for 2000 miles, stuffed tightly into my checked suitcase. I was able to connect the controller to the battery on my father's four wheeler with a pair of alligator clips. This worked very well, and everyone was impressed with the light show I put on in my parent's driveway.
The control box has a small metal L-bracket attached to it so it can be bolted to the dash board of the RZR. To attach the light bar, I added a couple of metal brackets to the back panel that bolt into the internal aluminum frame. These brackets were then attached to top roll bar on the RZR. Since I didn't have the RZR when I was designing the system, I didn't know exactly how it would all hook together, so a lot of the those connection pieces were made last minute.
Since I accidentally left the connector needed to attach the power terminal of the control box to the battery in California, I wasn't able to test the system after it was installed onto my father-in-law's RZR, but I do have a video of the initial testing done in my camper. Enjoy!
*warning* - strobe light in use...
The source code and schematic files are available for
There aren't a lot of components so the test circuit was simple to build.