LED Strip Controller W/ LED Amp + Arduino

168,097

502

61

IT-professional by day, DIY hobbyist (among other things) on my free time. I always have one or m...

Forget about DIY LED drivers with mosfet transistors! It is extremly simple to drive high powered LED-strips with Arduino at low cost without getting into too much circuitry. The secret is cheap mini LED Amplifiers.

This instructable is just about driving LED strips. If you want to see an application, see this Instructable: Arduino Helipad for mini Quad Copter

*** A word of warning - some people have had problems with overloaded/fried Arduinos using this instructable. Please read the comments before deciding to try it for yourself. If you come up with a more robust twist to the project, please comment below! ***

Step 1: Background and Circuits

See pictures for three circuit examples. The first picture reflects the implementation in this Instructable. The second circuit is for two RGB strips (uses all 6 PWM out on the Nano). The third circuit is for six single color strips (all Nano PWMs). Each mini LED amp can put out up to 12 amps. You can put more in parallell or at the end of a strip light as many meters of strip you want, provided you have a good 12v power source.

Each LED "pixel" on a strip consists of three light emitting diodes (LED). Most LED Strips are common anode. This means that the positive end of the diodes are connected at +12v at both ends of the strip. Connect +12v to the anode and 0v to B, R, G to light each circuit up. Single color strips and RGB look the same to the naked eye. Even single color strips have copper connectors which are labeled +12v, B, R and G even though all LED's are the same color.

LED Amplifiers/Repeaters are sometimes called RGB amps. Don't let that fool you. They work just as well for single color strips. A LED Amp is fed by 12v and has inputs/outputs labeled +12v, B, R and G just like the strips. The inteded use of the device is to take the input voltage potential, which can be considerably lower than 12v at the end of a long strip, and boost it back to 12v by feeding more power. I have discovered that a 5v voltage difference on the input is enough to get the LED amp to boost the signal to 12v on the output which means that we can toggle the Amp 12v outputs by means of Arduino digital pins. Arduino digital outputs operate at 0 or +5v.

The circuits connect 5v out on the Arduino to 12v on the LED Amp input (common anode). This may seem wierd. I'll try to make some sense of it. The R, B, G inputs of the amp are attached to Arduino digital out. Setting a pin to 0 creates a 5v potential to the common anode which will result on a 12v potential on the corresponding output which will light up the LED. In other words, a digital 0 turns the light on. A digital 1 turns it off. Or, when using PWM duty cycles, 255 is off and 0 is on.

Step 2: What You Need

Go shopping (probably ebay) for:
  1. 5050 SMD LED Strip
  2. Mini LED amplifier/repeater(s)
  3. Arduino Nano (or other preference)

Step 3: Wire It Up

Wire the Arduino to the input and theLED strip to the output of the LED Amp seen in the picture. You can power the Arduino from +5v or +12v (not some versions of Arduino. Check the spec). Your choice.

Step 4: The Software

Download Arduino IDE from http://arduino.cc/en/main/software and flash the following sketch to try it out. The sketch was used on the RGB strip as seen in clip in step 5. It fades each color up/down then white up/down.

int ledPinR = 3;
int ledPinG = 5;
int ledPinB = 6;

void setup()  { 
} 

/* Note:
When driving LED's using common anode LED AMP's you have to inverse the duty cycle,
i. e. 255 is off and 0 is full power.
*/

void loop()  { 
  // Red
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
    analogWrite(ledPinR, fadeValue);         
    delay(30);                            
  }
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
    analogWrite(ledPinR, fadeValue);         
    delay(30);
  } 
  // Green
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
    analogWrite(ledPinG, fadeValue);         
    delay(30);                            
  } 
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
    analogWrite(ledPinG, fadeValue);         
    delay(30);
  } 
  // Blue
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
    analogWrite(ledPinB, fadeValue);         
    delay(30);                            
  } 
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
    analogWrite(ledPinB, fadeValue);         
    delay(30);
  } 
  // White
  for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=5) { 
    analogWrite(ledPinR, fadeValue);         
    analogWrite(ledPinG, fadeValue);
    analogWrite(ledPinB, fadeValue);
    delay(30);                            
  } 
  for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) { 
    analogWrite(ledPinR, fadeValue);         
    analogWrite(ledPinG, fadeValue);
    analogWrite(ledPinB, fadeValue);
    delay(30);
  } 
}

Step 5: The Result


2 People Made This Project!

Recommendations

  • First Time Author

    First Time Author
  • Big and Small Contest

    Big and Small Contest
  • Toys Contest

    Toys Contest

61 Discussions

0
None
Ontaelio

3 years ago on Introduction

Thanks for pointing out these amplifiers - very handy for the strips. BUT the way of using them described here is fundamentally wrong. It seems to work, if with some glitches - at least, my lights did shine on Christmas, but really, I was inexperienced and in a hurry. Now I had time to dig a bit deeper.

Here, the insides of the amplifier. It doesn't measure any voltage potential difference or such, it just tries to sink 12v (11v in fact, after resistors) in the input channels, namely in 5v inputs of Arduino. It successful - the LM124 chip on the right opens the corresponding mosfet, sinking current from output (LED strip). If not - mosfet stays closed, no light. Simple and good: the amplifier actually handles all the ampers in the strip! So:

1) do not connect 5v to 12v input. Even if it doesn't fry your Arduino, there's no sence: all 12v ins and outs of the amplifier are directly connected.

2) Arduino seems to be rather abuse-friendly, but still, it's a very bad idea (and practice) to abuse it. Don't sink 11v in 5v pin. In my case, this worked until I tried to send 0,0,0 (or even 5,5,5) to the strip - Arduino gets overloaded with overvoltage and shuts down.

What to do? Well, I think one can find the right combination of zeners/resistors to sink excess voltage from the amp. I didn't. I used a cheap Darlington array (ULN2003a to be exact) between Arduino pins and amplifier inputs (plus a ground connection). Basically, such an array can be used even without the amplifier, but you'll have to worry about power ratings - each led of the array can sink up tp 500mAs, so for the full strip you'll need 12 legs in 3 groups of 4 connected in parallel. With the amplifier I used 6 legs for two strips. Good!

Another possible good use of the amplifier is with LED drivers like TLC5940, that will happily sink 12v, but you'll have to get the PWM frequency right. I tried with DM631, that has in-built PWM generator, it seems to be too fast for the mosfets.

And, by the way, I tried removing the 100k resistors connecting 12v to inputs from the amplifier - no luck, 5v from Arduino is just not enough to switch mosfets. I guess one can remove everything except mosfets and then patch inputs right to their gates, but it's a bit too drastic for me.

Thanks again for the idea!

IMG_20150314_123121.jpg
9 replies
0
None
SergiCunill24Ontaelio

Reply 3 months ago

The use of ULN2003a it's a really good idea. But one question, what about the 12V input of the Amplifier? It's connected same 12V as the output?

Thanks!

0
None
ehsmaesOntaelio

Reply 3 years ago on Introduction

Wow, that was a thorough analysis. Thanks for that! Admittedly the project was derived from trial and error in combination with basic assumptions. Having said that, I have been using it successfully for a year for some of my lighting. Perhaps I have been lucky and got my hands on a couple of pristine Ardu's. I will post a note/warning at the top of the instructable.

I think I have an idea of how you hooked the darlington array up but if you have a circuit drawing, I (and subscribers) would certainly like to see it.

As for the TLC5940s, you are right. That is the best option, especially for ambitious projects. I have first hand experience. I use two daisy chained chips giving me 32 PWM pins of which I am using 21 pins to power 7 LED amps which power 7 2,5m RGB strips (17,5m tot). Works great! I haven't had the time to make it into an instructable yet though.

0
None
Ontaelioehsmaes

Reply 3 years ago on Introduction

I'm not that good at drawing circuits, but thankfully with Darlington arrays it's rather easy - lower leg just controls upper leg, + 2 contacts for Vcc and Gnd.

Can you tell, please, did you use the TLC5940 library by Alex Leone? Did you change anything in it - especially the PWM freq generator?

ULN2003a.jpg
0
None
J3J3Ontaelio

Reply 3 years ago

Is there a +12VCC on the ULN2003 or is you circuit drawing correct ?

Thanks

0
None
OntaelioJ3J3

Reply 3 years ago

The drawing is correct, no +12v goes to the ULN2003

0
None

Tried this out today, worked great. I ended up going with a Photon (by particle,) along with their Shield Shield, which has a voltage regulator, and a 3.3v->5v voltage translator built in, which seemed to work just as well as the ULN2003a to trigger the RGB amp. The Shield Shield and Amp use the same power supply, and fit very neatly into a small project case. I'll post pics soon. I do NOT have anything going to the 12v pin on the input side of the RGB amp.

For code, I started with what I found here to get started, then re-wrote it to suit my goals:

https://www.hackster.io/plaetzchen/a-30-00-led-str...

0
None

I actually ended up making my own board that is essentially an Arduino designed specifically to drive 5 RGB strips (or more with an extension board). Did some mistakes (the voltage regulator overheats and forgot to include a master MOSFET, will correct in next version), but it works. Dissecting an amplifier actually helped to crystallize the idea.

IMG_20150912_134813.jpg
0
None

wow, nice work! How did you make the board? More importantly, how did you learn to do that? I'm a weekend tinkerer, but I'd definitely like to learn more.

0
None

Simply put, I googled and experimented. The main question however is not how, but what for. If you don’t know what you want, Google will give you 42.

I'm a weekend tinkerer too, got an arduino as a present a year ago. Did my first projects on a breadboard. Bought lots of "modules" – they are still gathering dust somewhere. Basically, you quickly grow out of the breadboard because of its limitations – not to mention inconvenience – and you have to learn soldering in any case (at least to use non-DIP chips on a breadboard with a connector). Tried prototyping boards – found out they have the same limitations and are awfully clumsy. Decided to make my own boards, as it's pretty easy to etch them with citric acid. In fact, I actually used etching technique (aquafortis – asphalt paint, needle, drawing lines by hand) as I don't have a laser printer. Even made a specific-purpose arduino with this (below – it really works despite the appearance), but again: limitations (one side only, no replicating). So, switched to Chinese manufacturers who can print you 10 boards at a very reasonable price (in fact, they print 10x10 cm board that can contain a lot of stuff – I had 6 different PCBs on it).

I think of it as levels, defined for myself:

Level 0 - Blink on Arduino.

Level 1 - something useful on a breadboard.

Level 2 - your own kitchen-made PCB for something useful.

Level 3 - your own factory-manufactured dense PCB for somehing useful. <- I'm here

Level 4 - explore the wondrous world of 32-bit ARM or any other non-Arduino controller and do something useful with it (and, more importantly, something that will actually gain from ditching Atmega328).

The biggest problem is thinking up something meaningful to do. That's why a lot of people never go above Blink ('Look, I made this cute 2-LED RGB rainbow and this motor-driven spindle with bunny on top!' – 'Wow! What for?' – 'Hm... Beer, anyone?'). That's where you start, and then, once you have a firm idea of what you want, Google help.

But no one can give an advice on this meaningful idea, it's yours fully. Being a journalist and an artist, I decided to mix microcontrollers with art. You may find inspiration in your own field. Just remember – if the project you have in mind is already present on IKEA shelves (or in eBay/AliExpress stores), it won't keep you for long.

myard.jpg
0
None
CarlosL4

Tip 9 months ago on Step 1

Don´t connect the arduino 5v with the 12 vdc input of the mini lead repeater/amplifier, this cause you will burn the arduino.

0
None
NateA16

2 years ago

SOLVED - TL;DR place a 10-20k resistor between your output and the input; this works with logic level signals at 5v ** and 3.3v signal too!! **. I too struggled with these pesky amplifiers and finally opened one up to see what's happening on the inside. Here's the synopsis: An op amp (operating as comparator) drives the FETs. It compares to 4.7v for the switching. Each of the inputs has a 110k pull-up to high side (12v). Setting reference voltage equal (tying ground together) allows 5v Arduino to drive the amp. For the case of driving from a 3.3v micro you would run into the issue that neither 0v nor 3.3v are sufficient to switch the output.. however when you place a resistor in the middle it allows the input to be pulled up slightly - then you are toggling between.. let's say 3v and 6.6v which allows you to switch!! Note that nothing is tied to the "reference" in the input ( the one with the arrow ). In fact BE SURE NOT TO CONNECT TO REFERENCE because you are really just connecting to 12v from the power source - don't fry your board. Cheers mates! Happy hacking.

3 replies
0
None
skitterrustyNateA16

Reply 1 year ago

Where exactly are you saying the resistor should go?

0
None
cisasteelersfanskitterrusty

Reply 1 year ago

The resistor simply goes from the output of your Arduino (or ESP8266 or similar device) to the input of the LED amplifier. Be sure to tie the grounds together.

Be aware this is 'active low' as in feeding in 3.3V will yield the lights off, and ground will yield lights on.

I personally used a 3.3V device (Raspberry Pi) and I played around with the resistor values. 1 single 10k resistor didn't work (couldn't turn the lights off), but 20k worked. I found a 33k resistor worked best for my application of using PWM to change the intensity of the LEDs. (I found values over 50k didn't work either. Try 20-30k)

IMG_0829.JPG
0
None
doublejoshNateA16

Reply 1 year ago

Ditto!?! I tried putting a resister between 12v power input and the amplifier reference input to provide a 3.3v amount without frying the board (killed one Wemos). Light turns on, but control signal isn't working.

The original setup does work fine with a 5v Arduino.

Were you intending to loop a resister between the reference input and output of the amplifier to "fool it" with it's own output? That didn't seem to work.

0
None
gtoal

1 year ago

perhaps a naive question, but... these LED strips have +12V and RGB signal pins. They don't have a GND. How can there be a circuit? There's nowhere for the electrons to go! Also I would like to try this myself but have a different style of amp (looks like this: https://www.flexfireleds.com/rgb-signal-amplifier/ ) - putting a meter on it shows that it does *not* feed back 12V to the input side. Will that affect how to hook it up?

1 reply
0
None
gtoalgtoal

Reply 1 year ago

to answer my own question - this amplifier does *not* connect the input +V to 12v so it is safe to drive the amp directly from the +5V and GPIO pins (4,5,6) of the Raspberry Pi! I'll be posting an instructable shortly after I've found the answer to a driver issue. ( https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=176740&p=1126989 )

0
None
licheong

2 years ago

The LED amplifier I've got is a RF (radio frequency) controlled board. It even comes with a remote control. It only has anode and cathode from the DC adapter. Anyone has any ideas on hacking it?

0
None
qwer1304

2 years ago

I reverse engineered the amp's circuit to understand why it was frying the Arduino. Here's the circuit:

As you can see, the 12V input from PS is connected to BOTH 12V strip sides, probably so that a single PS supplied the power to BOTH strips. Obviously, if Arduino's 5V is connected to the 12V amp's pin it would fry the Arduino.

Other than that, and assuming the Zener is indeed 4.7V, it should be possible to control the amp from Arduino. Note that Arduino doesn't sink the LEDs' current, but only a small current through 100K resistor.

As others have stated, a '1' from Arduino turns LEDs OFF and a '0' turns them ON.

Hope this helps

RGBamp.jpg
0
None
ScrapMasterJason

3 years ago

Your diagram shows you hooking the 12v and Ground pins to the side of the mini amplifiers and the photo shows the 12v and Ground lines going mysteriously under the RGB LED strip connector to the mini amplifiers.

I can't find amplifiers that have connection on the side and I can't figure out from your photos how you made the connection.

Can you please clarify?

Thanks