Go Down

Topic: Need help to control a high power LEDs matrix (Read 5592 times) previous topic - next topic


May 05, 2012, 12:58 pm Last Edit: May 05, 2012, 01:02 pm by _Matt_ Reason: 1
Hello everybody, I need to comand a kind of LED matrix (8x8) using high power LEDs (like THESE). The matrix will be common cathode. I'd need help to set the MOSFET configuration in order to provide at least 12V and 350mA per LED. I thought about something like this, but I'm not sure it works

Q1 controls every anode (via PWM) and Q2 sets ON/OFF the whole row.
Is this the correct way to control these LEDs?

I thought about a Darlington driver (like THIS) but it can source 500mA "only" and it needs 25mA to comand the base. What would you do? Thank you so much for your help



and it needs 25mA to comand the base

No it does not!

This will not work:-
1) The top FET can only have 5V on it and as the drain is connected to 12V it can never be turned off.
2) You can not simply use resistors to current limit a 3W LED, you need a constant current source.


No it does not!

Right, I missread the datasheet. 25mA is the maximum base current.

Controlling this kind of LEDs is impossibile just using MOSFETS? Can you suggest a circuit that could help me please?

Thanks for your tips


May 06, 2012, 10:38 am Last Edit: May 06, 2012, 03:55 pm by Grumpy_Mike Reason: 1
Controlling this kind of LEDs is impossibile just using MOSFETS?


You need a constant current circuit. There are lots of different types so google for them.
However multiplexing a constant current drive is tricky because the circuit has to respond within the multiplex time, meaning it has to be fast.
This is like many circuits, more difficult to scale up than you think.


I'm reading this article to find out something that could help me

The easiest way I found is something like this

Probably it's not ok because the JFETs usually have a big gap between the IDSS(min) and IDSS(max).


Yes a constant current diode would do what you want, if you can find one of your required current rating.


May 09, 2012, 09:28 pm Last Edit: May 09, 2012, 10:14 pm by _Matt_ Reason: 1
And how to connect it in order to do the PWM on the anode and put 8 cathodes toghether?

Anyway, I thought this solution is a bit better

There are 2 causes:
1) the JFET is a depletion device, so the gate works in a range from -Vgg(max) - 0V (or just a little bit over hte 0volts, not much from what I read)
2) I can't find JFETs that can support 0.5 - 1A on the drain

This should work the same (or close, this is the article where I got the schematic @1st page)


And how to connect it in order to do the PWM on the anode and put 8 cathodes toghether?

First you should make sure that you can actually find a current regulating diode of ~300ma. I don't think they exist beyond a few tens of milliamps.

Creating an 8x8 array of high power LEDs -- with dimming -- is a problem with no simple or inexpensive solutions.


And how to connect it in order to do the PWM on the anode and put 8 cathodes toghether?

You would have to make the PWM output feed into the input for one of the row or column strobes.
Btw: are you doing this with a Mega? To do it with a regular Arduino, you don't actually have 16 (+1 PWM) digital outs, unless you re-use the analog pins as digital outs (which is totally possible.)

Anyway, why common cathode? If you're using FETs, driving N-channel FETS on the anode (a bottom-side driver) of the devices from an Arduino is a lot simpler than trying to totem pole up to the supply voltage for a high-side driver (be it N-channel or P-channel.)

There are special MOSFET driver chips you can buy, which will generate the right voltage needed. Typically, you will need the chip, and one or more capacitors, for boot-strapping the right voltage to control the gate. However, a logic-level N-channel MOSFET on the cathode, with common anode, would be so much simpler!


May 12, 2012, 06:51 pm Last Edit: May 12, 2012, 06:55 pm by _Matt_ Reason: 1
First of all I want to thank you for your input. I thought about using some LM317 as constant current sources

The problem is something that allows the IC to get the necessary current since I can't connsect the Arduino directly (to be precise, there are some 74HC595s that make the PWM and I use an Arduino Uno -@jwatte).


A voltage/current regulator is a pretty steep low-pass filter. It's not something you can use as a "driver" for a varying signal. You should drive that current regulator directly from the power rail.

What you want is to "and" each row strobe signal with the PWM. You can do this using 8 discrete AND gates -- something like 2x 4081 chips (if you can still get discrete gates -- haven't checked in many years!) and tie the output of each AND gate to the gate input of your N-channel switch.
You can also do this by adding a second N-channel MOSFET in series with the first one for each row, and driving the gate of all those transistors with the PWM output. The problem with THAT is that you only get < 40 mA out of the Arduino, so driving 8 MOSFET input gates may not be fast enough (we're talking microseconds here -- it may also be fast enough.) If that's the case, use another buffer device, such as complementary pair of P-channel and N-channel MOSFET devices (BS170, BS250P) or a dedicated output buffer like the 4050.


I'm a bit lost...

From what you've written I got this:

I think the LEDs should have a series resistor or a current controller to work as it should, isn't it?

Is that what you meant? I didn't catch the second part, could you post some schematics? Thanks


May 13, 2012, 02:01 am Last Edit: May 13, 2012, 02:08 am by jwatte Reason: 1
Your circuit involving the LM317 will work but not the control unless that Fet in the ground leg is capable of handling all the current of the Led's

I disagree. The circuit shows the PWM going straight into the LM317. The LM317 actually needs some stabilizing capacitors, and once those are in there, the response of that circuit won't be anywhere near what you want for PWM modulation.

The circuit I suggest looks something like the attached. If you have many "PWM" outputs, you could use one for each column, else you have to switch the columns separately from the rows and PWM -- so, two MOSFETs per LED, plus one per row. That starts getting unwieldy with the soldering iron :-) The constant current source  should be set to drive 8 LEDs in parallel.

You can move the PWM driver up to the top for column strobe, using P-channel MOSFETs, if you can find a way to turn them off (by putting their gate at the top voltage.) An easy way to do that is to use a pull-up resistor to the gate, and ground the gate out using an N-channel device that's logic level. The output will then be inverted.

Also, because MOSFETs need to build up a charge to turn on, their gates work as capacitors. You have to feed a certain amount of charge (== current times time) into it before it turns on. Then it doesn't need very much current at all, only enough to replenish internal losses (which are generally very small.) However, that current build-up is going to be a bit slow when all you have to feed eight gates in parallel is less than 40 milliAmperes. For 400 Hz PWM (as normal on an Arduino) it probably doesn't matter too much, especially if you have sufficient margin in the current/power rating of your MOSFETs. But they do generate more heat while switching, than they do when turned on or off.

And, as an aside: This is why modern CPUs generate lots of power. It's actually all the current of all the transistors being turned on and off when changing state. If something doesn't change, it draws next to zero power. This, in turn, is why smaller geometries is better, because you need less charge to open the gate.


There are no stabilizing capacitors possible with the LM317 current limiter and If you add them all you will accomplish is to spread out the PWM pulses.

The data sheet seems to disagree. It recommends a 1 uF capacitor across the output to improve ripple/transient response. If you look at the transient response on page 4, you can see that it's almost 10% of output voltage without it.

However, that doesn't matter. You cannot source the input power for a LM317 for this application from a PWM pin on an AVR processor directly, because the available current output from those chips is way too low to drive the LEDs we're talking about here. (There was talk of a 74HC595 -- same problem there.)


You willl not have as much current available as you set with the sense resistor because the Fet Rdson is not in the feedback loop

That statement is wrong, as far as I can tell. I will have exactly the current set by the sense resistor. I can use the same current through as many components as I want in series. It's the same current. All I need is sufficient source voltage.
To follow your suggested logic, the current control also wouldn't include the LEDs themselves, because they are also not in the feedback loop. That's simply not how current (and current regulation) works. The voltage drop over the sense resistor is I times R. I set R so that the voltage drop at the current I want is exactly the reference value. For example, if I want 800 mA current, and reference value is 1.25V, then R == 1.25/0.8, or 1.5625 Ohms. (On another note, that needs to be at least a 1W resistor, preferably 2W.) Trying to put anything more than the sense resistor in the feedback loop (from out to sense) of the regulator will hurt the precision of the regulation.
The same argument goes to your previous suggestion that there is "no feedback as to the current drawn" -- the feedback is with the sense resistor, which is in series with the actual current drawn.

I agree that when all low-end drivers are turned off, the regulator will try to "float to top" in an attempt to increase current.
That's not necessarily a problem, especially when you just switch the load to another column, so the regulated voltage won't actually float up.

[/quote]I have used L317's for current control many times and all of my applications were stable and worked well, including some variable current designs that however aren't applicable here.[/quote]

I didn't say they weren't.
I described my suggestion for how to use double low-end drivers to solve the problem of PWM modulating the row strobes using a separate input for the "modulate" than for the "row strobe," essentially by folding the logical-and function into two switches in series.
I also expressed concern at trying to obtain a PWM power signal, and then regulating the current output of that. At a minimum, that signal will be pretty spiky (as shown on page 4 of the data sheet.) With a capacitor, you'll remove the spikes, at the cost of smearing the PWM. Maybe the spikes don't actually matter in this case, either -- you can try it and see if the LEDs blow early or not :-)


I agree with jwatte's solution, if I set the resistor between the Vout and ADJ pins the output current isn't going to change depending on the load in order to the fixed voltage between these pins (~1,25 V). The output voltage changes.

I have few questions tho; shouldn't the MOSFETs be an N-channel and a P-channel, as you said in your previous post? I also didn't understand how can the Arduino output current affect the switching speed of the FETs (we should talk about the 74HC595 output current, but let's assume it's the same to make it easier) since the MOSFET input resistence is close to infinte, so no current flows into the gate (just a small leakeage one). On the BS170 datasheet I can read that tON = tOFF = 10nSec. Another point is that I don't think using just one current source for the whole circuit is a good idea. I should allow it to draw the current for 8 LEDs (0.35*8 = 2.8A). This means that if I turn on 8 LEDs at a time evey load will get 350mA, but if I turn a single LED on, it will receive the whole current. So I think that every LED need his own current source.

Thanks for your help

Go Up