Making a led band driver - Page 1
Forum section: electronics / beginners

author: Oxodao
author_rank: Contributor
timestamp: December 27, 2015, 09:05:45 pm
content: Hi,I bought some times ago a 5 meter RGB led band from "Dymond" (It's likely to be this:http://www.dymondgroup.be/?portfolio=rbg-led-strip) but I'm not happy with the way the remote works. So I thought I would replicate it though an Arduino, that's what I made: I read the IR signal with the "IRDump" script, and made some things with an IR led that simulated the remote, that worked not really great, mainly because IR sending is so much slow, to go from 0 to 255 on ONE color it takes maybe half a minute...So I wanted to make my own driver, as far as I know the driver is a 12v 2 Amp, after a bit of research I found out that the led band works as an common anode: One +12v and either - for the red, the green or the blue works. But I have no clue how to make special colors like orange and such, it looks like I can't use two colors at the same time, and I don't know how to make them variable (Potetiometer doesn't look to do anything..)Thanks in advance

author: cponcsak
author_rank: Contributor
timestamp: December 27, 2015, 09:25:14 pm
content: This all depends on the strip that you have. RGB strips come in two variants, one with RGB leds that allow you to make any color or strips with alternating red, green and blue leds. If your type is the later, you wont be able to make any color. If its the former, you need to use a PWM signal to sink current for each of the colors.Given that an arduino can only sink a recommended 20ma of current for each pin, you will need to use a transistor or mosfet to sink the current for the strip.

author: Audioguru
author_rank: Super Contributor
timestamp: December 27, 2015, 09:35:42 pm
content: An LED strip should have a wire for +12V and another wire to feed current (not voltage) for red, another wire for green and another wire for blue. You feed current to both red and green to make yellow and all three wires in the correct amounts to make white. You can make millions of colors by mixing red, green and blue.

author: Oxodao
author_rank: Contributor
timestamp: December 27, 2015, 09:58:49 pm
content: Quote from: cponcsak on December 27, 2015, 09:25:14 pmThanks for the awnser, Why couldn't I do any color if it's the second type ?For the PWM that seems fair, since analogWrite from the arduino goes from 0 to 255 by default that would be my r/g/b quantity doesn't it ?If I order mosfet, which type do I need to ?Quote from: Audioguru on December 27, 2015, 09:35:42 pmThanks too, how can current flow through ground ? And how can I limit it ? With an arduino? I am pretty new to EE world and I haven't followed any official courses so I'm pretty noobish

author: Robartes_m
author_rank: Contributor
timestamp: December 27, 2015, 10:20:57 pm
content: Quote from: Oxodao on December 27, 2015, 09:05:45 pmBasically you hook up the common anode of the LED strip to 12V, and connect the negative terminals for Red, Green and Blue to the drain of an N-channel MOSFET each. The sources of the three MOSFETs go to ground. You then use three analog out pins on the Arduino to drive the gates of the MOSFETs.To get any colour, figure out its value (in 8 bits: 0 - 255) for each of the three primary colours (eg red is 255,0,0 and violet is 255,0,255), and put those three values on the analog out pins of the Arduino. That should light up the LED strip in the chosen colour.Please note that I am assuming that your LED strip has current limiting resistors (you should be able to see them). If not, you will have to add them between the negative terminals and the MOSFETs.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 27, 2015, 10:26:55 pm
content: If the strip has separate R, G and B LEDs then you won't really be able to make arbitrary colors. But from the link you posted, it looks like they are combined RGB LEDs, and from your description you have separate Cathode leads for each color.So you can use three PWM channels from the Arduino, each one driving a mosfet which in turn will drive one color of the LED cathodes. By setting different intensities in the PWM channels you can mix whatever color you like.You can use three Analog input pins and three potentiometers (using analogRead() statements) to feed values to the PWM digital outputs using analogWrite() statements. You can use the map() statement to map the 1024 analog steps from the pots, to the 256 steps for the digital PWM outputs.BlueOut = map(analogRead(BluePotpin),0,1023,0,255);analogWrite(BluePWMpin, BlueOut);etc.

author: Oxodao
author_rank: Contributor
timestamp: December 28, 2015, 11:26:20 pm
content: Okai, ordered some, waiting for receiving it

author: rrinker
author_rank: Super Contributor
timestamp: December 29, 2015, 05:24:32 am
content: This is one of the projects I have on my list to work on. The RGB strip I have is indeed RGB LEDs, but the included remote only gives access to a limited number of levels for each color. Close but no cigar. I intend to use these, as well as plain white strips, to light my model railroad, the RGB ones to do sunset/sunrise and night effects. So I was planning on using an Arduino to drive some MOSFETs and replace the included controller. Have to do a teardown on the controller to see what's inside and if the limit is just on the IR portion or it really is built that was - although if the final drive is already power transistors or MOSFETs, I can probably just supply PWM. Possibly a plus since the brand of LEDs I have has an ecosystem with downstream repeater drivers and power supplies so you can add something like sixteen 5M strands of these - which should cover me nicely. However, if there is a circuit design issue that limits it all to just 16 steps per color, I'll just build my own replacement controllers and be done with it.

author: Wirehead
author_rank: Regular Contributor
timestamp: December 29, 2015, 08:23:50 am
content: Have you checked the RGB driver "P9813"? You can make a nice little board for that using some N-Channel MosFET's and drive it from your arduino using serial data (two wire! - okay, you need VCC and GND too)If I'm not mistaken, there's premade boards for that as well

author: Oxodao
author_rank: Contributor
timestamp: January 03, 2016, 07:01:18 pm
content: Hi,After receiving them I made up a quick little test board here it is (ugly, ikr):I made a test code for my arduino and I ran it:Code:#define REDPIN A4#define BLUEPIN A6#define GREENPIN A0int r = 0;int g = 0;int b = 0;void setup() {pinMode(REDPIN , OUTPUT);pinMode(BLUEPIN, OUTPUT);pinMode(GREENPIN, OUTPUT);}void loop() {int RedOut = map(r,0,1023,0,255);int GreenOut = map(g,0,1023,0,255);int BlueOut = map(b,0,1023,0,255);analogWrite(REDPIN, RedOut);analogWrite(GREENPIN, GreenOut);analogWrite(BLUEPIN, BlueOut);r+=30; g+=30; b+=30;delay(50);}My problem is that at the begginning it looks like there is a tiny bit of red (that's normal, link btw Red/Neg) and then it goes instantly to full power green... Here's what I tried:Increasing the delay => After red shows up, it goes to nothingSetting fixed values => Same as increasing the delayThanks in advance

author: alsetalokin4017
author_rank: Super Contributor
timestamp: January 03, 2016, 08:59:46 pm
content: Try using the digital PWM pins for your outputs, not the analog pins.Change your #defines to use digital pins 9,10, and 11 (or any other three of the Digital pins with PWM capability: 3,5,6,9,10,11). And of course connect your interface board to the Arduino using these pins.Also, in your test sketch there is really no need to use the map() statement, or to reinitialize the variables each time through the loop.Try this for testing your basic interface board and Arduino PWM pins:Code:#define REDPIN 9#define BLUEPIN 10#define GREENPIN 11int r = 0, g = 0, b = 0;void setup() {pinMode(REDPIN , OUTPUT);pinMode(BLUEPIN, OUTPUT);pinMode(GREENPIN, OUTPUT);}void loop() {while(r<=255) {analogWrite(REDPIN, r);analogWrite(GREENPIN,g);analogWrite(BLUEPIN, b);r++; g++; b++;delay(50);}r=0; g=0; b=0;}This should fade your LEDs from zero to full brightness smoothly in about 13 seconds, then start over from zero. (Tested on a ProMini).Of course if you want to control the individual colors using potentiometers and the analogRead(analogPins) then you'll need the map() statements.

author: Oxodao
author_rank: Contributor
timestamp: January 04, 2016, 08:18:00 pm
content: Just broke one of my transistor's leg... That already cost me an arm to get because I bought it from France instead of China as usual (Time matters) so .. I'll maybe put that project on pause...Btw, Is it a correct price: ~16€ for 3x IRF 630 (1.90/p) + 1x 100g solder (5/p) + shipping (5.90) ? Do you know any where to buy parts that comes quickly in France ?

author: alsetalokin4017
author_rank: Super Contributor
timestamp: January 04, 2016, 10:23:09 pm
content: Quote from: Oxodao on January 04, 2016, 08:18:00 pmYou may be able to find a slightly better price here:http://www.ebay.fr/sch/i.html?_from=R40&_trksid=m570.l1313&_nkw=irf630&_sacat=0But also, the IRF630 is often used in PC power supplies. If you have an old PC power supply, take it apart and look inside, you may find just what you need there.(Just about any power mosfet will work for your application, I think.)Also, look in the bases of compact fluorescent light bulbs, they often will use mosfets of equivalent specification.

author: Oxodao
author_rank: Contributor
timestamp: January 10, 2016, 05:24:05 pm
content: Ok so I made a V2 of my proto-board and it seems to work; or not, i have no clue,When I put the mosfet in the correct way it doesn't seems to work at all, when I put them reverse and squeezing them around it kinda gets working... I have no clue about what's going on.I put header on them just so that I would not be in trouble to unsolder them if needed...

author: alsetalokin4017
author_rank: Super Contributor
timestamp: January 10, 2016, 10:17:15 pm
content: Quote from: Oxodao on January 10, 2016, 05:24:05 pmIt sounds like you are having wiring problems with your proto board, and/or you have bad mosfets. Don't put them in the wrong way around!Did you try testing your mosfets according to the procedure I gave in this video:This does not test the mosfet fully but it will tell you if it is shorted or has other problems. The mosfet has to be removed from the circuit for this test.

author: Oxodao
author_rank: Contributor
timestamp: January 18, 2016, 04:45:31 pm
content: Looks like dead...

author: Oxodao
author_rank: Contributor
timestamp: January 24, 2016, 05:01:09 pm
content: Okai, so update:I have done it on a protoboard and nothing is working at all. Leds are not even showing any light...Here's a picture with a quick diagram of what I've done:Also, I found this video thanks to @WireheadBut I find nowhere on ebay this kind of module...EDIT: Bought this one, but I'd still like to make one myself :phttp://www.ebay.com/itm/161791910957

author: rrinker
author_rank: Super Contributor
timestamp: January 24, 2016, 05:46:37 pm
content: The module seems similar to the one that came with my strip, less the IR controller input. I should take a picture of this thing, won hung lo engineering at its best. The rating label claims up to 6 amps drive capability - the drivers are some little SOT package things with absolutely no heatsinking of any type, not even enlarged traces. Yeah, that'll handle 6 amps easily... I suspect the limitations in the range of steps for each color are caused by the way the micro is programmed and nothing else, which is why I want to build my own driver. The micro has had the markings sanded off, and besides it and the SOT drivers, there is some fort of FTDI chip which has pins 5-8 all soldered to the ground trace, and only pins 3 and 4 going to some part of the circuit. I am guessing this is for the IR receiver maybe, I just put it back together without writing down the part number on it

author: rich
author_rank: Frequent Contributor
timestamp: January 24, 2016, 06:05:46 pm
content: There could be a few things going wrong:In the design:1. The transistors you are using now 2N3904 are only rated to switch 200mA, so you should not try to switch long strips with them.2. Bipolar transistors need current limiting resistor between the base and the Nano otherwise you risk damaging the nano and the transistor.On the breadboard:3.The transistor emitters are connected into the - rail, but I don't see any other wire in joining the two - rails together.Why did you give up on the IRF 630 solution? They would be better at driving long LED strips as they will be rated for several amps.

author: Oxodao
author_rank: Contributor
timestamp: January 24, 2016, 06:12:12 pm
content: Quote from: rich on January 24, 2016, 06:05:46 pm1. Oh that's right, I did not see that when I bought them...2. Okai, I am correcting that now3. I saw that as soon as the picture was taken but I added a wire between the top rail and the bottom one, but that didn't changed anythingI did not gave up, but since I fried or broke the one I had, I don't have any left to use, and my budget is not infinite. I'll order some more when I can, but 15€ for 3 mosfet + solder that's painful for a student still at school. I try to salvage as best as I can from old electronic stuff but I do not have much to

author: rich
author_rank: Frequent Contributor
timestamp: January 24, 2016, 06:23:40 pm
content: €15 wow! Where are you buying from?http://fr.farnell.com/webapp/wcs/stores/servlet/Search?catalogId=15001&langId=-2&storeId=10160&categoryName=Toutes%20les%20catégories&selectedCategoryId=&gs=true&st=irf630Do you have a multimeter? If you do, measure the current that the strips draw when connected to 12V, you may find something with a lower current rating that will be cheaper and still do what you need.

author: Oxodao
author_rank: Contributor
timestamp: January 24, 2016, 06:38:49 pm
content: I buy them from selectronic, a french website...That's the same price as Farnell but this is in Europe so lower shipping fees:As I said before: ~16€ for 3x IRF 630 (1.90/p) + 1x 100g solder (5/p) + shipping (5.90)I do have a multimeter but thats a crappy one (10€ at a commercial center). I'm going to try your idea

author: rich
author_rank: Frequent Contributor
timestamp: January 24, 2016, 07:21:42 pm
content: ah, sorry I read your post too fast and didn't spot the solder was included in the 15.I suggest you build only one channel first and don't connect the Nano. Test and experiment with this single transistor stage until it works properly and you understand why (ask questions here if you need to). The keeps the risk and so costs low because there are less components in the circuit to damage simultaneously.When the single channel works connect it to the Nano and get the control part working. When you have control over the one channel, then go back and replicate for the other 2 channels which should be easy as you've done all the hard design and experimentation.Also are you 100% sure the IRF630s you have are definitely destroyed? It could be worth creating a simple test circuit on your breadboard (1 mosfet, 2 resistors and a standard through hole LED). You can then test this by connecting the input to +5V and 0V to turn it on and off, and provides a great starting point for the single channel approach I mentioned at the top of this post.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: January 24, 2016, 08:00:58 pm
content: @Oxodao: Please post the exact code you are using in the Nano.Also, you could try your 2n3904 setup using single LEDs instead of the strips, just for debugging. Once you have the breadboard circuit turning single LEDs on properly then you can work on driving the full strip. Be sure to use current-limiting resistors in series with the single LEDs.12V positive > 1k resistor > LED anode >LED cathode > 2n3904 collector> emitter > ground.And do put a resistor between each Arduino output pin and its transistor base.I'd suggest starting with fresh 3904s too, since you may have already blown these.The 2n3904s will not drive the strips, though, they are just for single or a few LEDs. But once you have that circuit working it will be trivial to change to a heavier bipolar or mosfet to drive the strips with sufficient current.

author: Oxodao
author_rank: Contributor
timestamp: January 24, 2016, 10:04:14 pm
content: Thanks for your replies, actually that was my transistor that did not work correctly I'd guess.I am not sure that all of the mosfets are dead but I'll check yesI removed the chip that was controlling the leds on the original driver and soldered my arduino's 9/10/11 on the 3 transistors inside. That works for now, I'll tell you as soon as I have checked if they still works