RGB LED Strip Controller

102K53152

Intro: RGB LED Strip Controller




This is a remote-controlled multicolour LED-Strip controller box I made for a friend. We planned to install subtle lighting inside his car for which we got a tiny controller box + remote with the multicolour LED Strips. Unluckily, we couldn't open the door panels for wiring and had to take aid from professionals. While installing the strips, they probably shorted something (they did really shabby wiring) and all the magic smoke from controller box escaped. The lack of any protection circuitry in the controller box didn't help much.

So we were left with a functional but useless remote and LED strips directly connected to power, and so limited to being manually-wired to one of the 6 basic colours(red, green, blue, yellow, cyan and magenta). So it was time to make a better pimped-up RGB LED Strip controller box!

This was finished and installed 2 days before the Indian festival of lights: Diwali. Christmas is also round the bend and this could be put to use for christmas tree lighting. Christmas carol synched lighting anyone?

Here is a video of it in action. I forgot to show the clap-on function. Maybe a smaller video later... The amplifier gain sensitivity for audio is turned down so only the strong bass beats are picked up. Amplifier gain can also be turned up to even pick up normal human voice.



This Instructable is divided into four parts: design explanations(steps 1-4), building circuit(steps 5-7), building enclosure(steps 8-10), car installation(steps 11-13)

STEP 1: Extra Features

I've added an amplifier so I could mix the lighting with audio playing in the car. The circuit uses my previous project ArrDrownHo! for powering the IC, easily uploading software upgrades and providing real-time serial data for fine tuning the amplifier gain. Here's the not-so-complete list of features:

• Set colours(as in original). Extra: each colour button has 5 layers of different colours which are programmable. So instead of 15 colours, we have 15x5 = 75 colours. Red, Green and Blue components of a colour can be set using knobs and then saved in one of 75 colour slots.
• Set flashing and smooth fading colour effects(as in original). Extra: 5 different layers for both flash and fade effects. Each effect layer can store 15 colours which are programmable and are selected from the group of 75 pre-saved colours.
• Adjust brightness/effect speed(as in original). Extra: Beside adjusting using remote buttons, knobs can be used to get precise brightness/speed instead of jumping forward or backward in huge chunks.
• Has an extra music effect which alters brightness of current colour/effect according to loudness of music. 5 layers are available in which colour during silence can be changed(usually best left to black).
• Ability to save settings. 5 layers of programmable settings. Each layer will store value for brightness, effect speed and audio sensitivity which can be recalled and applied instantly. The values of first layer will be applied whenever system is freshly started.
• Clap activated switch on function. The clap command is a 3-clap combination so LEDs do not light up accidentally due to loud music.
• Master Reset function. Set all the saved colours, effects and settings to default.
• Slow fade from black to previously selected colour when switched on. Whenever power is re-connected, the colour saved in 3rd row, 2nd column, 3rd layer of remote is selected by default.

STEP 2: Stuff Required

  1. ArrDrownHo!                           x 1
  2. ATmega168/ATmega328     x 1
  3. TL072 (amplifier IC)              x 1
  4. 100K resistor                          x 5
  5. 150K resistor                          x 3
  6. 33K resistor                            x 3
  7. 20K trim potentiometer         x 1
  8. 0.1uF ceramic capacitor       x 4
  9. 10uF electrolytic capacitor    x 1
  10. 100uF electrolytic capacitor x 2
  11. IR sensor                                x 1
  12. Electret microphone             x 1
  13. TIP120                                    x 3
  14. LED 3mm                              x 1
  15. IC holder 24 pins                 x 1
  16. IC holder 8 pins                   x 1
  17. Push button                         x 1
  18. JST connector                     x 1
  19. Male header pins
  20. Female header pins

Additional:
  • LED Strip
  • RGB Remote
  • Acrylic
  • Various tools(soldering iron, pliers, wire cutters etc.)
  • Heat shrink

STEP 3: Decoding the Remote Control

I followed ladyada's IR tutorial and got the signal timings for each button. Signal duration for Brightness Increase(B+ [0][0]) buttons is:

ON, OFF
  1. 882, 438
  2. 56, 52
  3. 56, 52
  4. 56, 52
  5. 56, 52
  6. 56, 52
  7. 56, 52
  8. 56, 52
  9. 56, 52
  10. 56, 162
  11. 56, 162
  12. 56, 162
  13. 56, 162
  14. 56, 52
  15. 56, 162
  16. 56, 162
  17. 56, 162
  18. 56, 52
  19. 56, 52
  20. 56, 52
  21. 56, 52
  22. 56, 52
  23. 56, 52
  24. 56, 52
  25. 56, 52
  26. 56, 162
  27. 56, 162
  28. 56, 162
  29. 56, 162
  30. 56, 162
  31. 56, 162
  32. 56, 162
  33. 56, 162
  34. 56, 4010
  35. 882, 218

There was no space for saving timings for 24 buttons on the AVR, so had to find a pattern in the signals. After a lot of experimentation, I managed to decode the signal encoding pattern for the remote. Since this is pretty generic, chances are your RGB remote might have the same signals. If not, you will need to modify readIR() and decodeIR() functions in code.

To decode the signals, I noticed that only values at position 18-22 and 26-30 are changing for different buttons. Also, the values in range 18-22 are always the same as 26-30. So reading any one range is enough. I chose to read both and compare to be 100% sure. The individual values in the range are either near 52 or 164. So I assumed time signal in vicinity of 52 as 0 and 164 as 1. Then decoded their values in binary. I've treated the buttons as 6x4 matrix and named the buttons accordingly from [0][0] (top left) to [5][3](bottom right).
Button position [0][0] B+ [0][1] B- [0][2] OFF [0][3]ON [1][0] – R [1][1] – G [1][2] – B [1][3] – W [2][0] [2][1] [2][2] [2][3] [3][0] [3][1] [3][2] [3][3] [4][0] [4][1] [4][2] [4][3] [5][0] [5][1] [5][2] [5][3] Timing position 18 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 Timing position 19 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Timing position 20 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 Timing position 21 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 Timing position 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 Decoded Decimal Value 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
Note: To improve speed, I hard coded the time duration values in code. Also, I used interrupt-based IR signal reading so other functions, like fade effect, can function in parallel and I get maximum speed.

STEP 4: Circuit Explained

For picking up and processing audio signals from an electret microphone, it has to be amplified first. A very neat explanation of amplifier working can be found in this Instructable by amandaghassaei. I'm using a slightly modified version of her circuit by using a single power source instead of double. The values for capacitors and resistors were selected after a bit of trial-and-error. The output is centered about 2.5V by R2-R3 voltage divider and fed into AVR's analog input pin.

For controlling intensity of each colour channel, PWM is used. The LED strip needs a lot more current than AVR can provide, so TIP120 transistor is used to control power to each of the 3 colour channels. Follow the excellent tutorial by ladyada for more information. C8 and C7 are added as close to the connector as possible to lessen load on power source due to power draw by LEDs during PWM switching.

The PCB board design file has two unrouted air-wires. One is for VCC and other is GND. Do not worry, these two are connected through the ArrDrwonHo! board which will be connected to this PCB later.

STEP 5: Fabricate That PCB

Time to make the PCB. Download the Eagle files, print, iron-on transfer, etch and drill. If you don't know how to fabricate a PCB, there are plenty of good instructables out there to get you started.

In my excitement, I forgot to take a picture of the silkscreen I did with toner-transfer. Only after all the component for amplifier were soldered and I had tested the amplifier section to satisfaction, did I realize my mistake. Enjoy the half covered view of silkscreen.

I will put up the files later as I messed up the collector and emitter gates in the transistors and had to cut traces in the PCB to fix it. Will fix it up and upload it as soon as possible. 

Edit: Uploaded the corrected schematics and board files.

STEP 6: ArrDrownHo! Headers

To let the ArrDrownHo! to be removable(in case AVR needs to be removed), I have added female headers beside the IC holder. The pins of the headers are connected to the adjacent IC pins in the PCB design. ArrDrownHo! easily snaps in and sits confortably atop the AVR IC.

Finish soldering the rest of the components. Last image shows the ArrDrownHo! inserted along with amplifier IC and AVR.

STEP 7: Finished: PCB Fabrication and Soldering

Connecting potentiometers(pots):
I do not have close-ups of this connection so I'll try to explain in detail. Connect first pin of all 3 potentiometers together (I used black wire). Then connect the third pin of all pots together (I used white wire).
Now solder 5 wire ribbon cable to the holes in PCB for pots The 5 wire connections are: 5V, GND, wiper for pot1, wiper for pot2 and wiper for pot3. Connect the wire for pot vipers to the middle pin of respective pots. Also select any 1 pot and solder the GND wire to the first pin and 5V to the third pin.

Solder ribbon cable for connection to LED Strip. The pin-out is 12V, Green, Red, Blue(unluckily, the ribbon cable colours do not match). Attach a standard LED strip connector at the end. Cover joint with heat shrink. You're done!

Upload the arduino code to an ATMega168 or ATmega328P IC and insert it into the IC holder. You can make a simple Tic-Tac USBtinyISP programmer to program it.

Now time to test the circuit. Set ArrDrownHo! to use 5V regulator and supply 12 volts to it and the PCB (through JST connector). Plug in LED Strip to the connector and switch on using remote. It's alive!!!

STEP 8: Making the Enclosure Top

My original plan consisted of using an old tiny plastic lunch box I used for storing parts as enclosure. But my friend wanted something classier and we decided to go with clear acrylic enclosure. I found cutting acrylic the most difficult task. I used a hacksaw initially but soon gave that up and moved to scoring and snapping. I scored the acrylic about 50 times each side with the notch at the back side of a cutter blade. Much easier but with 50% chances of messing up. Either the break wasn't clean, the acrylic cracked or I would put a deep scratch while scoring. In the end I managed somehow after wasting and re-using the wasted acrylic.

I created a basic design in MS-paint for what I had in mind. The dimensions got altered by a few mm but was mostly true to the design. The acrylic used was about 2mm thick. The thickness of acrylic plays significant role in selecting dimensions.
First, cut a rectangle of acrylic of dimensions 20.4cm x 5.5cm. This was bent 5.7cm from both ends to form a U-shaped piece. Then drill 3 holes for the potentiometers.
Then cut 2 pieces of dimension 9cm x 5.3cm for the sides. Round off 2 lengthwise adjacent corners so it fits with the curve of our bent acrylic. One thing I overlooked was to drill holes for push button, DC jack and microphone beforehand. Do that before attaching sides. Use any super-glue, acrylic glue, araldite to attach them and hold them in place for curing with vise(or rubber bands like me :).

Attach the peripherals with connectors to the enclosure top:
An electret microphone with wires soldered to a 2-pin male header is glued to a hole drilled on the enclosure side.
Another wire pair is soldered to 2-pin male header and passed through 2 of the 4 holes drilled for push button. A push button is soldered to these wires, it's leads pushed through the 4 holes, and glued to the box's outside.
Take a DC jack. Solder a JST connector and 2-pin male header connector in parallel to it. Glue DC jack from the inside to hole drilled in one of the sides.
All the 2 pin male connector connections were covered with heat-shrink.

STEP 9: Making the Enclosure Base

The base is a rectangle of acrylic of dimensions 9cm x 5.5cm. To attach the PCB, nuts were glued to the top of 4 small squares of acrylic with holes drilled in them. These were glued to the base, matching the location of holes in the PCB.

To attach the base to the top part of the enclosure, two small squares of acrylic were cut and holes drilled in them. One had a hole just big enough to let the bolt through while the other's was big enough to fit the nut inside it. The two pieces were glued together and the nut glued in the bigger hole. 4 such squares with nut inside were made and glued vertically standing near the corners with a slight offset.

Also, 4 holes were drilled in the base so the enclosure could be screwed to the car's side panel.

STEP 10: Finished: Assembling Controller Box

To assemble, the top part of enclosure is put on top of the base and holes drilled in the sides aligned with the vertical nut holds. File a notch in the enclosure’s top part’s side so the LED Strip ribbon connector can come out.

Attach the PCB to base with screws. Attach potentiometers to enclosure top, tighten with nuts and add knobs.
Connect the power connectors to ArrDrownHo! and JST socket, the microphone and button connectors to their respective female headers.
Note: While connecting power to ArrDrownHo!, make sure of the orientation as shown in image notes. I later added a white stripe to both male and female header's 12V side to mark the orientaion.

Screw the base to the top and you're done!

Read on to see how it can be installed in a car...

STEP 11: Prepare LED Strips

Plan out where you want the strips to go. We wanted it to be placed discreetly so the LED strip is not visible, but the diffused light is. We placed it in the area under front panel where our feet rest, below the front seats, below the rear seats, inside the space in side door for putting stuff, around back side of the perimeter of the bass tube and small pockets in the sides of the back.

Measure out the strips needed for all these locations. Measure twice, cut once!
Solder wires to one end of these LED strips. Cover the joint with heat-shrink.

STEP 12: Installing LED Strip

The most challenging part was installing LED strip in the side door panels. The images show how we went about installing them. This was repeated for all 4 front and back side door panels. The wiring was hidden and connections brought to the panel near the foot pedals.

STEP 13: Finished: Car Installation

This looks great in car but can be used other places as well. Christamas tree can be adorned with it or for mood lighting your room.

There was some noise in amplifier circuit whenever the car engine was started. Maybe the microphone's picking up engine noise(being so close to the engine) or RF interference. Need to investigate more. It's working perfectly with engine switched off but power on.

53 Comments

Here is my build of this fine Instructible. I've not had good luck with making my own PCBs so I sent the Eagle file off for fabrication. I'm quite happy with my satellite pcb for the three potentiometers. Unfortunately the controller is DOA. Neither of the power LEDs are lit. I'm getting 12v as far as the LED strip takeoff,as well as the op amp, but not to the backpack.

The arduino backpack and microprocessor are working fine if externally powered using an FTDI. Similarly I can see the button being pushed via the serial monitor.

Use of the IR remote appears to have no effect. Not sure what to try next.

I'm having the same problem with the remote... Only Brightness, Power is working, and holding some button get me to pot-control mode.
Serial output showing the same remote key code as yours...
Don't know what's the issue...

For the remote control, you will need to check if the signals are same as mine. Go through Step-3 to understand how I did the decoding. Follow LadyAda's tutorial I linked in that step and get the signals for the remote buttons using this script. The script has since changed a bit. The values I had were probably divided by 10, i.e. my 56 will be 560 in your output. If they match for all buttons, the Arduino script will accept your remote else we can work on changing a few hard-coded values to accept your remote codes.
I have to decode another remote within a week, so I'm considering making a detailed Instructable on the process...

Oh, you were making the ArrDrownHo! for this project... This looks gorgeous, partly due to the professional fabrication and partly due to your mad soldering skills. ;P

The reason for your ArrDrownHo! and AVR not being powered is because ArrDrownHo! will need the 12V input as well, as its voltage regulator's power supply is not connected to the board. You will need to add another pair of wire(besides the black and white ones) to the power source in parallel, and connect it to the ArrDrownHo! external supply input, which is just above the place where black-white wires are soldered.

I'd suggest cutting a small length of balck-white wire and solder a 2-pin male header to one end. Then desolder the black-white wires, twist the ends of the shorter wire with the longer one, push the wire joint back in the holes and solder. Then connect the male header to the ArrDrownHo's external voltage input female header(take care of the polarity).

Or you could split the 12V input from where the black-white wire originate(DC jack maybe) as I did:

Hey!! Congrats for souch a goob instructable and explanation of everithing init! I noticed that some of you have problems with schematics and all the circuit so I drawn my own version on one board and added some improwments. Code for chip stays original and board is preety simple. Eagle schematics and board comming soon!!
Wow! That looks awesome. Great work with the circuit.

Feel free to ask me any doubt (I spot a 'Not sure if...' note in top center).

I Used ArrDrownHo! since I find them extremely handy to use but you can easily replace it by implementing crystal, voltage regulator and communication pins in your board if you want.

What new additions are you planning on adding?
Ho thanks bro...Not sure but I'm planning to dig deeper about aux for music that I can get rid of mic and problems with enviroment (car engine noises and distrubing signals that can rune audio signal and lighting efects) so that you have audio line in you're isolated form than. And later on, plan is to add bluetooth module and controll everiything with android app...that's just a peak in future but for now I have two more important projects for school and they're first now.

Hello again!! Now project waken from sleep and I assembled together and doesn't work....so I'm wondering about code I double checked it and pins for autputs and inputs are messed up and not propriate with hardware.... Cant get it to work.. help please

Hi
Please send me the codes of this project. Thank you
I live in iran

I want to use 5050 RGB led strip but instead of TIP120 can i use a2shb mosfet which i got inside 24key IR Comtroller? plz rely asap.

I quickly checked the datasheet for that MOSFET. Looks like it might work. I'm just unsure of how much heat it will expend and will be able to expend as it is surface mounted.

can i connect the audio jack directly instead of using the mic? i mean even if i connect the audio directly do i need to amplify or cn i feed it directly into the microcontroller?

I want to use this to just control the colour of the LEDs and have them react to music do I need the removable board. also I don't want to use the IR will that be a problem

That should not be a problem. You don't need to make any changes on the hardware level, except leaving out the IR components. On the software end, you'll have to take the code for music controlled lighting and make that run constantly in Update() function.

PLEASEEEEE, somebody HELP ME ,

what program is used for open this archives

thanks a lot :)

saludos de Peru <3

One zip contains the Arduino code and will require the Arduino IDE.

The other contains schematics and can be opened using Eagle CAD.

Would you be able to do it without the controller so it is just 4 pots 1 for brightness and the 3 others for the RGB so you can change colours as I don't like the idea of the remote and also to descrease the size of the circuit

Yes, you can control the LED brightness with pots in series for each red, green and blue channel. The catch? This is only feasible for very few LEDs. You have to select pot value carefully for your LED strip size. Change the size, change the value. Also, most energy is wasted as heat in the pot. If you have a slightly long LED strip(20 or more LEDs), the current drawn will be more than 1 Amp at full white. In that case, if the pot is providing any resistance, even 10 ohm, then at 1A, its power dissipation(P) is I*I*R = 1*1*10 = 10 Watt! You'll be letting all the magic smoke out. :D


The brightness of any specific colour isn't any external factor. It is set by controlling the brightness of R,G,B channels but maintaining the ratio. If you have a yellowish colour of 100% red, 100% green and 20% blue, then to reduce its brightness by half, you divide all the values by 2: 50% red, 50% green and 10% blue.

More Comments