LED Ribbon Light Project

Hi,

First off, some background about me. I'm a programmer, so I know that the coding part of this will be easy. I've done a lot of household electric work, but not much circuit work.

I just purchased this LED Ribbon Light reel off of Amazon. I also bought a dimmer switch and corresponding power supply. I'm building an entertainment center right now, and would like to use these ribbon lights inside of the unit for some practical as well as ambient lighting. I would like to add a bluetooth or wifi module, so that I can control the lighting by a smartphone app that I would write.

I'm not exactly sure how to wire it up to the arduino. I found this tutorial. However, the light strip is just white LED's, and only have a + and - connection. I'm assuming that the - connection would be connected to Ground. From what I've read, dimming would be accomplished by varying the voltage to the + connection. From what I've ready, the arduino can't be directly connected to something that requires 12V connection. So somehow I need to take the voltage from the 12V power supply, and vary the voltage to the LED strip, without frying the arduino.

Any tips/suggestions would be much appreciated.

From what I've read, dimming would be accomplished by varying the voltage to the + connection.

No it is normal to apply a PWM signal to the LEDs http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Normally you would connect the + of the strip to +12V and the - of the strip to a transistor or FET. Then apply the PWM signal from one of the PWM signals to the transistor's base or FETs gate through a resistor. Connecting the emitter / source to the arduino's ground and the +12V supply's - to ground.

Mike,

OK…I think I understand it. PWM is basically applying a cycling a voltage on/off to diminish the overall amount of power to make the lights appear dimmer.

I found this video which helped explain this a bit further. It seems like the LED lights are no different (from a circuit perspective) than a DC motor whose speed you want to control with a transistor and PWM, right?

Let me make sure I understand this. The powersupply’s +12V wire is connected to the + connector on the LED. The LED’s - connector is wired to the collector of the transistor. The Arduino’s output PWM signal is fed to the base of the transistor through a resistor. The resistor’s emitter leg is fed to ground (and all grounds are wired together).

So it looks like this circuit works because the current path to ground is either blocked when the base signal is 0, or when the base signal is > 0, an amount of current is allowed to flow through the LED’s and back to ground. What I’m confused about, is why would you block the path to ground? This means that there is always a voltage going into the LED’s. From my AC experience, this seems backwards, like if you wired a light switch to block the neutral leg instead of blocking the “hot” leg. Not questioning what you said, I’m just trying to understand things.

When you say “through a resistor”, how would I calculate the size of resistor to use? Also, could you recommend a specific transistor, or would any NPN transistor work here?

Many thanks!!

ktambascio: Let me make sure I understand this. The powersupply's +12V wire is connected to the + connector on the LED. The LED's - connector is wired to the collector of the transistor. The Arduino's output PWM signal is fed to the base of the transistor through a resistor. The resistor's emitter leg is fed to ground (and all grounds are wired together).

Yes, that's what Mike is suggesting. It's the simplest way to dim that LED strip under the control of an Arduino.

ktambascio: So it looks like this circuit works because the current path to ground is either blocked when the base signal is 0, or when the base signal is > 0, an amount of current is allowed to flow through the LED's and back to ground. What I'm confused about, is why would you block the path to ground? This means that there is always a voltage going into the LED's. From my AC experience, this seems backwards, like if you wired a light switch to block the neutral leg instead of blocking the "hot" leg.

Yes, that's how this arrangement works. You could switch the +12V end of the supply to the LED strip instead, but that would require more components. While switching the neutral side of a mains-powered device would be less safe than switching the live side, in this case we're only switching 12V, so it doesn't really matter which end we switch.

ktambascio: When you say "through a resistor", how would I calculate the size of resistor to use? Also, could you recommend a specific transistor, or would any NPN transistor work here?

Your LED strip takes 2A so I would use a logic-level power mosfet to switch it, with a resistor between the Arduino and the gate pin somewhere between 100 and 220 ohms. There are lots of suitable mosfets available, for example STP40NF10L or IRLU8726PBF. Avoid IRF540 and similar non-logic-level mosfets.

OK. I found the transistors online. It looks like the transistor is rated for up to 40A, so if I wanted to do two strands of LED's, this transistor could handle that? Also, what size wire would you use to connect the Arduino to the LED's? Would you daisychain the LED's to the various areas, or wire them in parallel with a terminal block?

ktambascio: OK. I found the transistors online. It looks like the transistor is rated for up to 40A, so if I wanted to do two strands of LED's, this transistor could handle that?

With power mosfets, you should ignore the current rating, it's generally only valid for short pulses. Instead, look in the datasheet for the maximum Rds(on) at Vgs=4.5V or 5V. Multiply that by the square of the current you are switching, and that will give you the static power dissipation when the device is turned on. You want that to be low, below 1W if possible, so that you don't need to heatsink the mosfet. Also make sure that the Rds(on) figure is qoted at a current no higher than you want to switch.

From the datasheet, the STP40NF10L has Rds(on) = 0.036 ohms max @ Vgs=5V, Ids=20A. So if you want to switch 2 strands in parallel (4A total), the static power dissipation will be 4 * 4 * 0.036 = 0.576W. So the mosfet will get quite warm but wil not need a heatsink. I leave you to do the calculation for the IRLU8726PBF.

ktambascio: Also, what size wire would you use to connect the Arduino to the LED's?

For 2A, I would use speaker wire or 2-core 3A mains flex.

ktambascio: Would you daisychain the LED's to the various areas, or wire them in parallel with a terminal block?

Either daisychain them in series and use a 24V supply, or wire them in parallel with a terminal block and use a 12V supply.

I found this wire: http://www.newark.com/pro-power/3182vr-0-75-flex/cable-mains-2core-0-75mm-100m/dp/59M5345

Using an AWG to mm2 chart, it looks like .75mm2 corresponds to 18AWG. So I should be fine with 18AWG or 16AWG, right?

Thanks again, Kevin