I am trying to light up a 12V-LED-strip (common anode) with an Arduino and a Texas Instruments TLC5490. With one segment, all works well (see picture at (1)). However, I want to light up 2 meters of those, so I used an N-channel MOSFET (IRF540) (picture at (3)) and connected that to a 1-meter-strip (2).
Unfortunately, this does not work at all. Can anyone see, what I have done wrong?
For power, I use a 12V 1500mA power supply, which should be sufficient for the two 1m-strips (at 6W each).
The wires are connected like in the picture.
Blue comes from a TLC output (and should go to the gate).
White comes from a color of the LED strip (to drain).
Black goes to ground (from source).
Grumpy_Mike:
However, in general this inverts the signal from the TLC5940 and stops the LEDs from being fully off.
So a p-channel MOSFET would be better? (right now, I would be happy if there would be light at all.. :))
one more thing. The resistor at the TLC-pin is a 2200 Ohm resistor, limiting the current to about 17 mA. Could that be the problem?
I tried connecting the transistor directly to the Arduino (without the TLC, the blue cable to a PWM output, white to an LED color, black to ground) and (this is the confusing part) it works without a problem
Assuming the source of the FET is connected to ground you need a pull up resistor of 10K or so on those gates.
Yes a p channel FET would prevent the inversion but you still need the pull up.
You also need current limiting resistors. What current are the LEDs drawing?
No the gate threshold is when the FET starts to conduct not when it is fully on.
The important figure is the gate voltage they quote with the Ron figure.
It sounds like you have not got a logic level FET.
In this data sheet it is called Rds(on) and is 10V so yo can't drive this FET directly from a 5V output.
But in your case ther is no need, put the gate pull ups to 12V.
First, I tried a 10 k? resistor with a fading sketch, but with that the LEDs would never switch off.
With a 330 k? resistor, the fading goes from 80% to 100% (approx., could also be from 50% to 90% or so).
Unfortunately I can't find the right resistance to be able to make use of all 256 brightness values I send to the TLC.
With 1.32 M? for example I can change the brightness from 50 to 170, everything over 170 is off, everything under 50 is fully on.
Right now, I only have this one FET and I need to buy a couple of them so it might be easier to directly buy the right ones!?
Could this one (http://www.irf.com/product-info/datasheets/data/IRLZ34N.pdf) be suitable? (it is an n-channel FET, but I did not find any available p-channel FETs and when I want to switch the LEDs completely off, I have no problem with disconnecting the power supply)
Unfortunately I can't find the right resistance to be able to make use of all 256 brightness values I send to the TLC.
That is odd for two reasons.
First of all the TLC takes in values from 0 to 4095 if you are only sending values from 0 to 255 you are missing a lot of values. Remember they are inverted so that the smaller the number the brighter it is. Is this the way round you are seeing?
Second the FETs should be turning off, make sure the ground of the 12V supply is connected to the ground of the arduino.
You really need an oscilloscope to see what waveform you are getting at your LED strip. It could be that the LED strip does not like a PWM power supply for some reason. It could be that it has some capacitors in that are smoothing out the PWM signal and giving it a DC voltage. This would cause it not to light at some of the low brightness values because the voltage would be less than that needed to turn an LED on. But without a scope this is only speculation.
Grumpy_Mike:
That is odd for two reasons.
First of all the TLC takes in values from 0 to 4095 if you are only sending values from 0 to 255 you are missing a lot of values. Remember they are inverted so that the smaller the number the brighter it is. Is this the way round you are seeing?
Second the FETs should be turning off, make sure the ground of the 12V supply is connected to the ground of the arduino.
Sorry, I wasn't too clear about that. A Processing sketch sends values from 0 to 255, the Arduino then changes these values to gamma-corrected values from 0 to 4095.
Grumpy_Mike:
You really need an oscilloscope to see what waveform you are getting at your LED strip. It could be that the LED strip does not like a PWM power supply for some reason. It could be that it has some capacitors in that are smoothing out the PWM signal and giving it a DC voltage. This would cause it not to light at some of the low brightness values because the voltage would be less than that needed to turn an LED on. But without a scope this is only speculation.
Unfortunately I do not have one. But the LEDs do not seem to mind PWM power supplies as I can control one segment without a problem. The problems only occur with the MOSFET.