Arduino + MOSFET + TLC5940

Hello!

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).

Thanks!

I assume you mean a TLC5940, not what you put in the title.

Can you post a schematic of how you wired up the FET.

However, in general this inverts the signal from the TLC5940 and stops the LEDs from being fully off.

Yes, I meant the TLC5940

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

Unless you are going to post a schematic I can't offer any design advice.

Hi Mike,

right now, there is only one transistor connected in the way I described in an earlier post
This is the schematic for all colors

Bye

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?

Just tried that.
Still works with the strip directly connected to the Arduino, but when connected to the TLC, there is no light.

The current limiting resistors are already soldered on each element of the strip.

What is the FET, is it a logic level one. If not you have to put the gate pull ups to 12V not 5V

Hm, I'm not sure what type it is.

the datasheet says:
VGS(th) Gate Threshold Voltage
min 2.0 V
max 4.0 V
conditions: VDS = VGS, ID = 250?A

So it should be a logic level FET?

And I can control it with a digital pin of the Arduino, so 5V should work

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.

Could you explain what the Ron figure is? I can't find it in the datasheet (http://www.irf.com/product-info/datasheets/data/irf540n.pdf)

How is it possible that it works with the Arduino?

And is there a FET you could recommend? The total power per FET should be 4 W max

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.

Okay,

but how do I do that? I can't change the voltage of the TLC

(And thanks a lot for your effort so far!)
good night!

Wire a resistor from the FET gate to +12V, leave all the other wiring the same.

Hey, that did something

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.

I think I just try out a different FET and see if that works. Could you have a look at this one -> http://www.irf.com/product-info/datasheets/data/IRLZ34N.pdf? This could be controlled with 5V right?

Yes that is a logic level FET. That will only need pulling up to 5V with gate resistors. However I suspect it will work the same.

Grumpy_Mike:
However I suspect it will work the same.

Well, I do hope that it is working differently :slight_smile:

What would you use to light up these LED strips (And these are made for the use with PWM power supplies)?