Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LED Matrix Help

Status
Not open for further replies.

crashmeplease

New Member
I have been designing and simulating an 8x8 Bi LED Matrix display, and have a few questions..

My original simulated model uses common cathode displays, 595 shift registers driving the columns, and 2803 darlington arrays doing the rows, all connected to an avr. Pretty much like many of the designs already out there tbh. And seemed to work quite well..

My problem is that I didn't realise at the time that my displays that I have are common anode, and I cant figure out the best way to hook these up. At the moment I am thinking I need a decent sized pnp transistor from the micro to drive an entire row instead, or can I somehow connect pull up resistors to the 2803 darlington array to give a positive output rather than to ground. I would really like to continue to drive the columns with the 595s.

I can add diagrams if this helps.

TIA :)
 
Is there a PNP equivalent of the 2803 you can use? Basically you need to source instead of sink current into the row.

How much current are you driving the LEDs with? Multiply that by 8 (# LEDs per row) to get the amount of current you need at the common anode. Then find a chip that can source that amount of current, or use individual transistors.
 
Thanks, I just wanted to make sure I was on the right lines in having to use a pnp transistor to control the rows, and not something silly that I had overlooked. As it happens I have found a few old ones in a box that look like they will do the trick.

I should hopefully have time at the weekend to put something on breadboard and see what happens.
 
Last edited:
I managed to test this out on breadboard, everything seems to work ok, as you can see in the pic, I have red, yellow and green (although some colour is lost in the pic, lol)... now to add in the shift registers and the micro :)

I will add schematics and chart my progress if anyone is interested in following this project.

Atm I have a 1K resistor on the base of the pnp transistor, does this seem about right? I just picked this value out of my head. When I turn the transistor on, about 4mA goes through the base, while the load was around 90mA at the time, so I figure everything is ok, and the micro can easily handle the 4mA.
 

Attachments

  • 2009-06-08 14.33.58.jpg
    2009-06-08 14.33.58.jpg
    236 KB · Views: 236
What transistor are you using? I can't see the second letter/digit in the picture.

You will want to pick the right value of base resistor so you fully saturate the transistor. If you don't, you risk generating heat. Shouldn't be a problem for you at such small currents, but it is easy to work out the correct value for R given the hFE value of the transistor.

If you want to try working it out, check equation 4 under "Choosing a suitable transistor" here: Transistor Circuits

If not, post the model number or hFE or datasheet and I'll try and help (with the disclaimer that I only learnt it from ericgibbs a few days ago!).
 
What transistor are you using? I can't see the second letter/digit in the picture.

You will want to pick the right value of base resistor so you fully saturate the transistor. If you don't, you risk generating heat. Shouldn't be a problem for you at such small currents, but it is easy to work out the correct value for R given the hFE value of the transistor.

If you want to try working it out, check equation 4 under "Choosing a suitable transistor" here: Transistor Circuits

If not, post the model number or hFE or datasheet and I'll try and help (with the disclaimer that I only learnt it from ericgibbs a few days ago!).

That's a nice site for helping to understand transistors :) thanks!

Well I worked it out to be about 18K, although some reassurance that I am using the correct values would be appreciated.

The transistor is a TIP42A ; Values taken from datasheet : hFE min = 15 ; Ic = 6A

Thus using the simple calculation, Rb = 0.2 × Ic × hFE == 0.2 × 15 × 6000 = 18000
 
You need to calculate for the current you will be passing through the device, not the maximum. So your current is currently around 100mA (round up to be safe), or 0.1 amps.

You should be able to lookup the hFE for this particular current (it changes with current I believe) from the datasheet.

Do you have a link for the datasheet?
 
hFE is not used for a switching transistor that is saturated. HFE is used for an amplifying transistor that has plenty of emitter to collector voltage.

The TIP42A power transistor has a minimum HFE of 30 when its collector current is 300mA and its emitter to collector voltage is 4.0V or more.

Like almost all transistors, the max saturation voltage loss of a TIP42A is rated when its base current is 1/10th its collector current. So for a collector current of 100mA feed 10mA to its base for it to saturate well.

Why use a power transistor? Use a little 2N4403 transistor instead.
 
Interesting audioguru (thanks for correcting me), so it becomes a simple R=V/I problem. Assuming V is 5v and you want 10mA, that's 5/0.01 or around 500Ω. Pick something close.
 
Interesting audioguru (thanks for correcting me), so it becomes a simple R=V/I problem. Assuming V is 5V and you want 10mA, that's 5/0.01 or around 500Ω. Pick something close.
The outpout voltage of the micro will be about 0.4V when it is sinking 10mA. The base-emitter voltage of the transistor is 0.7V. Then the base resistor has 3.9V across it and for 10mA its value should be 390 ohms.
 
The outpout voltage of the micro will be about 0.4V when it is sinking 10mA. The base-emitter voltage of the transistor is 0.7V. Then the base resistor has 3.9V across it and for 10mA its value should be 390 ohms.

hi agu,
Hope you are well on 'the mend' and will soon be back to full health.

Looking at this post, unless I am misreading it, I believe you have made an error.

If the MCU is sinking the 10mA then its output will be low.?

When high, assuming say +5V on the output and a Vbe on of 0.7V, the base resistor for 10mA would be,

4.3V/0.01 = 430R [nominal], so a 500R should get the job done.
 
hi agu,
Hope you are well on 'the mend' and will soon be back to full health.
Thanks. I am mending well.

Looking at this post, unless I am misreading it, I believe you have made an error.

If the MCU is sinking the 10mA then its output will be low.?
Yes, about +0.4V when its current is 10mA.

When high, assuming say +5V on the output and a Vbe on of 0.7V, the base resistor for 10mA would be,

4.3V/0.01 = 430R [nominal], so a 500R should get the job done.
But the TIP42 transistor is a PNP because the OP needs to have a transistor that pulls-up the common anodes of his LED display.
The base resistor has 3.9V across it so its value should be 390 ohms.
 
Thanks for all the input so far..

hFE is not used for a switching transistor that is saturated. HFE is used for an amplifying transistor that has plenty of emitter to collector voltage.

The TIP42A power transistor has a minimum HFE of 30 when its collector current is 300mA and its emitter to collector voltage is 4.0V or more.

Like almost all transistors, the max saturation voltage loss of a TIP42A is rated when its base current is 1/10th its collector current. So for a collector current of 100mA feed 10mA to its base for it to saturate well.

Why use a power transistor? Use a little 2N4403 transistor instead.

Two reasons for this choice, mainly I have some lying around, but the final design will have 10x displays daisy chained together. I probably should have mentioned this :)

This is where calculating the load current becomes interesting. Worse case scenario, if I assume all the LEDs in a complete row are lit at 30mA, then 8 × 20 × .03 = 4.8A
Due to multiplexing and the speed the display is refreshed, and the fact that probably only half the LEDs within a row might only ever be on at once, one could assume an average current of 2.4A? Would you calculate based on this average value or always for the maximum possible load?

Hmm hang on, actually now I have read through all the posts rather than trying to answer them in sequence, the end result will be that I will need a 390R base resistor or is this just based on the fact that the assumption is the load is 100mA at the moment. This would mean for 1/10th of 2.4A is 240mA base current(~18R), and up to 480mA base current(~8R) if I account for worse case scenario? And this needing another buffer stage to protect the micro?

Thanks for the help so far :)
 
Last edited:
Yes you need a base current of 480mA.
That is why LED driver ICs use darlington dual transistors that have a high output current and a low input current.

The TIP42A transistors each will need a little 2N4403 transistor driving it and together they have a pretty high voltage loss.
Use a logic-level P-channel Mosfet instead.
 
Use a logic-level P-channel Mosfet instead.

Ok that's opened a whole new can of worms! Knowing even less about MOSFETs, but I seem to have stumbled upon the NDP6020P, which seems to be able do the job? At least I have seen them for sale in the UK, always a good starting point, as many appear to be hard to find :)

One thing I have learned tonight is I will need to put a 1M gate resistor to ground for when the micro output goes into a high impedance state, to leak away any potential charge voltage away, does this sound about right?
 
Last edited:
A resistor to ground will turn off an NPN transistor or N-channel mosfet which you do not have. The PNP transistoir or P-channel Mosfet will turn on.

A resistor from base to emitter or from gate to source turns off a transistor or Mosfet.
 
Ok that's opened a whole new can of worms! Knowing even less about MOSFETs, but I seem to have stumbled upon the NDP6020P, which seems to be able do the job? At least I have seen them for sale in the UK, always a good starting point, as many appear to be hard to find :)

Farnell sell a very wide selection of transistors and FETs, but they might have a different number to the one you find in international datasheets (never been a problem for me).

I'm no expert but the one you have found looks acceptable. It is logic level which is important for easy interfacing to a microcontroller.
 
A resistor from base to emitter or from gate to source turns off a transistor or Mosfet.

Ofc y, doh, it was late :)

Farnell sell a very wide selection of transistors and FETs, but they might have a different number to the one you find in international datasheets (never been a problem for me).

Unfortunately Farnell don't like my choice in CC, so I have to go elsewhere anyway..

I think I saw them cheaper at Mouser anyway, I have only just stumbled upon them and may give them a go. Previously I have used Rapid, or just scrounged some bits from work when I can :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top