Continue to Site

Led matrix problem

Status
Not open for further replies.

bouvett

New Member
hi,

i am in the need o design an led matrix for displaying some simple designs. the led matrix should be possibly of about 8*8 leds....

the problem is with the power distribution, the current should certainly not be provided from the micro controller it self... so a transistor should certainly be used.. but what transistor?... keep in mind that the power demand may vary by time, say at some time a row can be all lit whilst at some other time the row should be only 10%lit eg... so i don't think that a current source is suitable.... what i need is a voltage controlled voltage source... voltage controlled from the microcontroler output, and the voltage source is since the transistor should act like a short circuit.... this brings in mind the mosfet...but a mosfet needs 10V for a good biasing for short circuit... of course i don't really need a short circuit since i should always need a limiting resistor...

otherwise i could use 2 mosfets, one can be used with some very high resistance between the source and ground, so tht when it is swicthed off, the
voltage on the Rs resistor is 0v, and is full voltage when the gate is on. then this voltage on the Rs resistor can be used as the Gate volatge for the next mosfet... this will be a very good thing i suppose but the problem is that 9V is needed when 5V is more than enough to switch on an led secondly i would need to mosfets... is there any other way to do this??

thanks

Try checking my PIC tutorials, one of which happily drives 8x8 LED's directly from a PIC.

Use regular bipolar transistors. Give each row, or column its own current limiting resistor and you won't have to worry about distributing current across the LEDs.

You could use NPNs for rows and PNPs for columns, or vice versa, or use all NPNs and wire them as emitter followers on one side. For an 8x8 array you'd need 16 transistors. Since such an array would never have more than 8 LEDs lit at any given time due to multiplexing, if the total current drawn by 8 LEDs is less than the max source or sink current of the MCU, you could forego the transistors on the column side, but that would limit you to probably 1-2 mA per LED resulting in a dim display after multiplexing.

You could use logic-level MOSFETs as well. Logic MOSFETs have Vgs thresholds around 2-3V instead of the more typical 10+V.

Use regular bipolar transistors. Give each row, or column its own current limiting resistor and you won't have to worry about distributing current across the LEDs.

You could use NPNs for rows and PNPs for columns, or vice versa, or use all NPNs and wire them as emitter followers on one side. For an 8x8 array you'd need 16 transistors. Since such an array would never have more than 8 LEDs lit at any given time due to multiplexing, if the total current drawn by 8 LEDs is less than the max source or sink current of the MCU, you could forego the transistors on the column side, but that would limit you to probably 1-2 mA per LED resulting in a dim display after multiplexing.

You could use logic-level MOSFETs as well. Logic MOSFETs have Vgs thresholds around 2-3V instead of the more typical 10+V.

any part number for logic level mosfets pls? i have the 2n7000... are they?
the limiting resistor sets the current level of some current source right? this would give a constant current all the time... right? (cause that would be a problem)

Use 8 transistors, what are you using to matrix the display, the uC or a different chip?

any part number for logic level mosfets pls? i have the 2n7000... are they?
the limiting resistor sets the current level of some current source right? this would give a constant current all the time... right? (cause that would be a problem)
2n7000 are logic level and can sink up to 100mA.

As for limiting resistors, for this discussion let's assume you're multiplexing the rows (displaying 1 row of 8 columns of LEDs at a time). You'd put 1 resistor on each column, so any LED that is lit on the same row will receive its own current from its own resistor independent of the other columns. The rows share the resistors, but this doesn't matter since only one row will be active at a time.

Since each column would only be driving 1 LED at a time, if the current drawn by one LED is within the current limits of 1 PIC I/O pin, you won't need transistors on the columns. The rows, however, could be driving up to 8 LEDs at a time, so the row pins would need to supply or sink 8 times the current. This is why the rows often have transistors but the columns don't (or vice versa). See the . His don't have any transistors at all, since he's driving the LEDs with low enough current to stay within a PIC's current limits. But if you want brighter LEDs, you'll want transistors driving the 8 rows. Either NPN or N-channel logic MOSFETs will do the job. NPNs are cheaper but you'll need base resistors which you won't need with the MOSFETs.

Last edited:
Use 8 transistors, what are you using to matrix the display, the uC or a different chip?

lol can you get a bit more descriptive... thanks just the same birdman

2n7000 are logic level and can sink up to 100mA.

As for limiting resistors, for this discussion let's assume you're multiplexing the rows (displaying 1 row of 8 columns of LEDs at a time). You'd put 1 resistor on each column, so any LED that is lit on the same row will receive its own current from its own resistor independent of the other columns. The rows share the resistors, but this doesn't matter since only one row will be active at a time.

Since each column would only be driving 1 LED at a time, if the current drawn by one LED is within the current limits of 1 PIC I/O pin, you won't need transistors on the columns. The rows, however, could be driving up to 8 LEDs at a time, so the row pins would need to supply or sink 8 times the current. This is why the rows often have transistors but the columns don't (or vice versa). See the . His don't have any transistors at all, since he's driving the LEDs with low enough current to stay within a PIC's current limits. But if you want brighter LEDs, you'll want transistors driving the 8 rows. Either NPN or N-channel logic MOSFETs will do the job. NPNs are cheaper but you'll need base resistors which you won't need with the MOSFETs.

with Vgs a t logic level, the 2N7000 can sink up a continous 200ma... at least that is what is shown in the datasheet..

problem solved: i used a 2n7000, i connected the led and the limiting resistor in series conneced to the drain, (VSS=5V from output port of the micro) then ground the source and feed a 5V to the gate ( preferably a large resistor is connected between the gate and ground so to discharge the gate when the gate is off)

approach is very simple. when 5V where given to the gate the Vds is 40mv therefore almost shorted... one other thing i am goind to consider is the use of a 4017 decade counter to switch on the rows, this is since the programming would only have to clock the 4017 in order to change from one row to another.. this approach i think simplifies the code. also a shift regsiter will be used so to reduce the pin count needed( this would then increase teh difficulty of the code but)

thanks guys

regards
bouvett

Using 16 pins from the PIC is simple, and already available in my tutorial, using shift registers makes it much more complicated.

Presumably you are aware that there's no point in using transistors to SINK current unless you also use some to SOURCE it - an 8x8 matrix fairly obviously requires the same source as sink.

How bright do you want the LED's anyway?.

Check the two video's on my tutorial page, the first shows four way scrolling, the second a large text string.

Status
Not open for further replies.

Replies
15
Views
987
Replies
6
Views
803
Replies
23
Views
2K
Replies
14
Views
3K
Replies
10
Views
1K