and yet never quite seen a complete answer.
I have LED strips that run off 5v USBThey are common anode....So I get led to the TLC5940Then discover it's a current drain, so won't work as expected
Then read about some ways to use PNP transistors (I have lots of them)The PNP I have available are: 2N3906, 2N5401, A1015, S8550, S9012 and S9015.
Why not? Current drain/sink is exactly what you want with common anode.For common anode you need NPN. You have all those PNP and no NPN?
Then you are going to have difficulty with electronics because the answers were quite complete. It would help if you explained what you consider missing for a complete answer.That last link is probably the best. You should have a base resistor of 1K and set the output current for 10mA.
So, you have a common anode strip.You cannot use PNP transistors or N-FETs to drive it.
Your IRF520 drivers will be just fine with a couple of quirks. You will need pull-up resistors to the gates, preferably to a 10 V supply if your LED strip (each channel) requires more than half an Amp as the IRF520 is not a logic-level device and actually requires more than 5 V to properly turn on.
As the module also contains a 1k pull-down resistor (the one on the right), you would need either to remove it or use a 470 Ohm pull-up to 10 V.So the TLC5940 outputs now pull down the FET gates and you need to program the PWM in reverse. Set the current limit resistor to a sufficient current to drive the 470 Ohm resistors - 22 mA for the 10 V supply or 12 mA if you have removed the 1k resistor from the module and are using 5 V for pull-up but it would be better in this case to use IRL520s.
does it seem likely that the lack of decoupling capacitors would cause the circuit to fail completely?
I guess now that's the IREF for the TLC5940, however wasn't sure
however I think the outputs should be a min of 5mA for reliability,
Did electrical and electronic engineering at Imperial
I was thinking to use the PNP as per thread 4 above, to drive the MOSFET, not the LEDs directly, am I misunderstanding something?
The spec for the IRF520 says it is perfect for logic:"Input Switching Voltage: Suitable for 5V microcontrollers."
So I am not sure if you meant to add two pull up resistors, one to set gate to high when no input, and other to somehow compensate for the pull down, if I don't remove it.
Also wasn't sure which 470res you were referring to, however I am guessing you're thinking that with 12mA based on the IREF resister of say 3.3k, that a 470 would drop about 5v, triggering the gate to low.
However from the other threads, I had understood that this solution is not great, as it leaves an always on "flicker".
Using PWM from Arduino to drive LED strips, and adding TLC5940s to extend the number of PWM outputs seems to be quite a common theme, and yet each thread appears to have differing an inconclusive answers (IMHO).
I'll try Paul__B solution first, and see if there's any flicker, I am planning to use the following values. (click for full size)
However I am wondering if the other LED/Resistor combo on the board also needs to be removed (R6 on the right side)
Also, just to test things on the TLC, I have got it all set up exactly like this:https://howtomechatronics.com/tutorials/arduino/how-to-extend-arduino-pwm-outputs-tlc5940-tutorial/bar the decoupling capacitors.Nothing happens, does it seem likely that the lack of decoupling capacitors would cause the circuit to fail completely?
Quote from: wcndave on 06-12-2019, 11:14:04 However from the other threads, I had understood that this solution is not great, as it leaves an always on "flicker".
Don't know what you mean by that.
Dim light I can follow, but why flicker?
But as you can put the pull up voltage to 12V there is no need to worry about that because then the gate will go to 12V and turn on a normal FET.
...so you actually have to prevent them saturating.
And just from where did you pull out this "spec"? Because it clearly is not.
What you you mean "Nothing happens"? That circuit shows no outputs connected.
As per your diagram, (you didn't really mean to substitute an IRF521! )
if you also remove the LED resistor (or change it to 10k) then the 470 at 5 V will ensure positive switching of the gate as per Mike's comments but will not be switching the non-logic-level FETs fully on at more than somewhere between half and one Amp. We still don't know how much current your LED strips actually require.
If on the other hand, you had a 10V pull-up voltage, then the 470 ohm should be able to switch the FET fully on even with the 1k pull-down - but maybe not the LED as well.
Also, the data sheet puts Vgs(threshold) at between 2-4v.
I think i say flickering, as it's coming on once per 4096 cycles, so a very fast flicker right
Is there some easier way to just extend PWM?
Quote from: Paul__B on 06-12-2019, 21:57:38 ...so you actually have to prevent them saturating.
That parameter is where the FET turns off if you go below it. It is not the voltage you have to apply to turn it on fully.
Well no because these things are very fast and you only have to have 30 flashes per second to see it as continuous, so there must be some other phenomena in play.
Search for a soft PWM library, or use a Mega.
Saturation is only applicable to bipolar transistors not FETs, it is caused by putting more current into the base than it needs to turn it fully on.
However, it does work with a logic level signal.
Well it might function but the FET is not at its lowest resistance therefore it is burning more power than it needs to be. This could cause excessive heating. You are getting away with it because your current is small and maybe you don't notice the excess heat.