Author Topic: Choosing right resistor for transistor base in LED matrix  (Read 1722 times)

0 Members and 1 Guest are viewing this topic.

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19842
  • Country: gb
  • 0999
Re: Choosing right resistor for transistor base in LED matrix
« Reply #25 on: August 09, 2024, 08:58:00 pm »
Why bother with low on resistance transistors?

OP started this thread from using NPN beta parameter to control LED current. Beta can vary 2 times or more from piece to piece. Good transistor project is made the way to be not dependent on it.
You suggest to use Rds to control LED current. 2N7002AQ Rds is defined as typical 3.5Ω and max 6Ω when Vgs=5V. So what is the minimum? I suppose 2Ω. So parameter changes 3 times.

The next question is what happens when Vgs=3.3V (OP clung to this voltage). It is possible that some of transistors will be really not switched on yet. It wouldn't surprise me if Rds for Vgs=3.3V would be from 4Ω to 40Ω (or even more). Depending on it would be not good design.
If the voltage would be such that serial resistors would be 220Ω and transistors driven by 5V then Rds varying from 2..6Ω can be ignored, but if it can have important influence on LED current then such design shouldn't be accepted.
But the forward current is not critical.

Heck, I have many LED lamps which run directly off two AA cells with no series resistors and they work fine. The resistance of the batteries, wiring and bond wires in the LEDs, is more than sufficient to limit the current to a safe level. In this case, the voltage is a little higher, but the on resistance of the 2N7002 is also in the equation. I suggest the original poster tries connecting an LED up to 3.3V, via a 2N7007 and a 1R resistor and measure the voltage across the resistor to get the current. It's highly likely it will be well within the maximum rating of the LED.

Quote
Heck, you might even be able to omit the series resistors.

Driving npn base with known current can be more precision solution than this.

The art of designing transistor circuits is to make everything depend only on the resistors and not the transistor parameters. I learned it long time ago when to have oscilloscope I had to design and build one.  Imagine if the gain of the Y path could vary as much as transistor beta.
You've contradicted yourself there. Driving an NPN base with a known current is not a precise way to limit the LED current. It's not what you would do to ensure your design only relies on resistors and not transistor parameters.

As I said a few posts ago, a 3.3V supply voltage and an LED with a forward voltage 2.6V to 3.4V is marginal design. In other words it won't give a consistent LED brightness, whatever you do. Choosing a transistor with a low on resistance, won't make much difference.
 

Offline PGPG

  • Regular Contributor
  • *
  • Posts: 140
  • Country: pl
Re: Choosing right resistor for transistor base in LED matrix
« Reply #26 on: August 09, 2024, 11:10:38 pm »
But the forward current is not critical.
In what sense not critical?
LED light intensity is proportional to LED current until saturation takes place.
OP wants to have LED matrix so he hopes to have rather consistent LED brightness. As it directly depends on current than current in LEDs is the main parameter to worry about.

It's highly likely it will be well within the maximum rating of the LED.

It is not what OP wants to reach. He hopes that LEDs will have the same voltage drop at them so having the same resistors he will get the same brightness.
I would not design this circuit that way but it is his right to try.


Quote
Heck, you might even be able to omit the series resistors.

Driving npn base with known current can be more precision solution than this.

The art of designing transistor circuits is to make everything depend only on the resistors and not the transistor parameters. I learned it long time ago when to have oscilloscope I had to design and build one.  Imagine if the gain of the Y path could vary as much as transistor beta.
You've contradicted yourself there. Driving an NPN base with a known current is not a precise way to limit the LED current. It's not what you would do to ensure your design only relies on resistors and not transistor parameters.

No. I definitely not contradicted myself.
Read once more what I have written!
I only said that driving base with known current can be (only can be, not guarantee that it will be) more precision solution than what you suggested: "you might even be able to omit the series resistors".
Do you know Rds range when Vgs for this transistor is 3V3?
In my opinion datasheet does not guarantee any precision in this aspect. It can vary 3..5 times between smallest and biggest value.
Then you have LED voltage drop differences making voltage at Rds also vary. Both of these variables together give a large variability in the obtained LED current.
But if you drive npn base with known current you have something like current source. Until LED voltage drop will allow transistor to work the main variable will be beta. The variability of this one parameter may be less than the total variability of the other two.

As I said a few posts ago, a 3.3V supply voltage and an LED with a forward voltage 2.6V to 3.4V is marginal design. In other words it won't give a consistent LED brightness, whatever you do. Choosing a transistor with a low on resistance, won't make much difference.
Here I agree 100%.
But next OP step (as he has written) will be to change supply to 5V. Having transistors working as real keys and not being random value resistors will then help to get smaller currents (so also brightness) dispersion.

 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19842
  • Country: gb
  • 0999
Re: Choosing right resistor for transistor base in LED matrix
« Reply #27 on: August 10, 2024, 10:02:56 am »
But the forward current is not critical.
In what sense not critical?
LED light intensity is proportional to LED current until saturation takes place.
OP wants to have LED matrix so he hopes to have rather consistent LED brightness. As it directly depends on current than current in LEDs is the main parameter to worry about.
The exact forward current is unimportant because LEDs even of the same type vary. Not all of the LEDs will be of exactly the same brightness for a given forward current. This is why if you look closely at most LED lamps, you'll find that, more often than not, the LEDs are not exactly the same brightness and the colour also often differs slightly too.
Quote
It's highly likely it will be well within the maximum rating of the LED.

It is not what OP wants to reach. He hopes that LEDs will have the same voltage drop at them so having the same resistors he will get the same brightness.
I would not design this circuit that way but it is his right to try.
But they won't have the same forward voltage. Remember the data sheet says 2.6V to 3.4V.

Quote

Quote
Heck, you might even be able to omit the series resistors.

Driving npn base with known current can be more precision solution than this.

The art of designing transistor circuits is to make everything depend only on the resistors and not the transistor parameters. I learned it long time ago when to have oscilloscope I had to design and build one.  Imagine if the gain of the Y path could vary as much as transistor beta.
You've contradicted yourself there. Driving an NPN base with a known current is not a precise way to limit the LED current. It's not what you would do to ensure your design only relies on resistors and not transistor parameters.

No. I definitely not contradicted myself.
Read once more what I have written!
I only said that driving base with known current can be (only can be, not guarantee that it will be) more precision solution than what you suggested: "you might even be able to omit the series resistors".
Do you know Rds range when Vgs for this transistor is 3V3?
In my opinion datasheet does not guarantee any precision in this aspect. It can vary 3..5 times between smallest and biggest value.
Then you have LED voltage drop differences making voltage at Rds also vary. Both of these variables together give a large variability in the obtained LED current.
But if you drive npn base with known current you have something like current source. Until LED voltage drop will allow transistor to work the main variable will be beta. The variability of this one parameter may be less than the total variability of the other two.
What sort of transistor are your talking about? BJT or MOSFET? You mention base current, then go on to talk about RDS, which doesn't make any sense.

The hFE of a BJT is more variable than the RDS of a MOSFET, so no, driving the base with a known current will not give an accurate current.

And what about the internal resistance of the LED itself? The wiring inside the LED itself is tiny and will have a considerable resistance. IF that wasn't the case, then the two AA cell LED lamps wouldn't work. How do know this internal resistance isn't the dominant factor? I suspect it is, given the supply voltage is within the nominal forward voltage of the LEDs.

Quote
As I said a few posts ago, a 3.3V supply voltage and an LED with a forward voltage 2.6V to 3.4V is marginal design. In other words it won't give a consistent LED brightness, whatever you do. Choosing a transistor with a low on resistance, won't make much difference.
Here I agree 100%.
But next OP step (as he has written) will be to change supply to 5V. Having transistors working as real keys and not being random value resistors will then help to get smaller currents (so also brightness) dispersion.
That would be much better. I probably wouldn't bother with 5V though. In the interests of saving power, I'd opt for something a little lower, say 4V, just enough to give enough headroom, but certainly under 4.5V. I might consider limiting the base voltage and adding an emitter resistor, to make a better current sink, than relying on a series resistor.
« Last Edit: August 10, 2024, 09:34:50 pm by Zero999 »
 

Offline kanaronTopic starter

  • Contributor
  • Posts: 16
  • Country: pl
Re: Choosing right resistor for transistor base in LED matrix
« Reply #28 on: August 10, 2024, 10:37:02 am »
Well right now I'm reconsidering my choises with placing everything on one board
2335693-0

For now it is 6 layers board 150x150mm (max 150x210mm) and I think that there is no way to fit row transistors... I wanted to place them behind matrixes but there are vias and jlcpcb doesn't support blind vias... I'm really thinking about that TPIC6C595 and getting rid of row transistors. And changing power supply for leds and TPIC6C595 to 5V

I think my best solution here would be to make matrixes as separate boards with column transistors and 74HC164 (all with 5V supply) on one board and on "main" board place transistors and logic (or TPIC6C595) for rows also with 5V
 

Online ledtester

  • Super Contributor
  • ***
  • Posts: 3224
  • Country: us
Re: Choosing right resistor for transistor base in LED matrix
« Reply #29 on: August 10, 2024, 01:38:35 pm »
I didn't realize you wanted to drive so many 5x7 matrices.

You'll save a lot of space using a LED matrix driver like the MAX7219 or HT16K33 both which are available from Aliexpress as well as major distributors (The Aliexpress chips may not be genuine but rather functionally similar.)

One HT16K33 could drive 3 of your 5x7 characters and you wouldn't need any additional resistors or transistors for the rows and columns.
« Last Edit: August 10, 2024, 01:40:35 pm by ledtester »
 

Online squadchannel

  • Regular Contributor
  • *
  • Posts: 157
  • Country: jp
  • deepl translate user
Re: Choosing right resistor for transistor base in LED matrix
« Reply #30 on: August 10, 2024, 01:50:51 pm »
o-ho! It looks like hp's alphanumeric display!
 

Offline kanaronTopic starter

  • Contributor
  • Posts: 16
  • Country: pl
Re: Choosing right resistor for transistor base in LED matrix
« Reply #31 on: August 10, 2024, 03:01:23 pm »
Quote
o-ho! It looks like hp's alphanumeric display!
This is battery panel from Boeing 737-800

2335857-0
Im (once again) creating home sim cockpit, but this time while having money and much more knowledge (basically when I was 14-16 my "PCBs" were like this: Atmega8/16 + 1 capacitor + bunch of connectors ;D )

Quote
You'll save a lot of space using a LED matrix driver like the MAX7219 or HT16K33
Thanks, I will look at any led matrix drivers or anything to save space because right now my only option is multiple PCBs. If only there were mosfets much smaller than SOT-23 package or some IC with many transistors (I know about 2 mosfets in one IC but that didn't saved much space)
Im kinda scared that I will end up diving into FPGA world just for this display ;D But that would probably save a lot of space if I would just move all logic ICs for rows and columns into one FPGA but then I would probably still need mosfets...

But then on the other hand if I would actually make one PCB with 4 digits with complete columns logic and with pinouts for rows and make logic for rows on "main" PCB then if something would be wrong then fixing issue would be easier and much cheaper. Heck I could even go with sandwich design with one PCB for leds and maybe columns logic, and below that I would put another PCB with rows logic all connected with 2.54mm goldpins (not sure if that would be optimall in terms of signal integrity).
Or maybe one PCB with just leds (4 digits), below that second PCB with led matrix drivers and with smaller STM32 to drive matrix drivers and with pinout just for I2C communication with "main" uC

So many options ;D Im thinking that multiple PCB would be the best idea in terms of potential fixes, costs and potential reusability
 

Online squadchannel

  • Regular Contributor
  • *
  • Posts: 157
  • Country: jp
  • deepl translate user
« Last Edit: August 10, 2024, 03:48:05 pm by squadchannel »
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 407
  • Country: ie
    • LinkedIn
Re: Choosing right resistor for transistor base in LED matrix
« Reply #33 on: August 10, 2024, 04:25:49 pm »
If you consider multiple PCB design the best one will be the same PCBs with small matrix , connect in daisy chain configuration.
 

Offline kanaronTopic starter

  • Contributor
  • Posts: 16
  • Country: pl
Re: Choosing right resistor for transistor base in LED matrix
« Reply #34 on: August 10, 2024, 04:37:37 pm »
or, it can be purchased, although it is more expensive.
https://www.digikey.com/en/products/filter/led-dot-matrix-and-cluster/96?s=N4IgjCBcoEwAwHYqgMZQGYEMA2BnApgDQgD2UA2iDDAJwCsNALCALrEAOALlCAMqcAnAJYA7AOYgAvsQC0MZCDSRBAVyKkKIOq2kgZNBUtXqykShBa6ZEaIow4CxU5TpgAbDt0fbQgCY9rOAgObkgQEGJOAE92fB5MXDRJSSA

...it exists :wtf:

There also is one with suspiciously exact dimentions that I need. And also the dots are perfectly spaced... Right now my matrix is spaced 1.5mm on X and 2mm on Y. I can't space it evenly by 2mm because it wont fit. Also I can't make it 1.5mm because of 0402 package

But on the other hand they are in fact quite expensive... I have to recalculate it

Quote
If you consider multiple PCB design the best one will be the same PCBs with small matrix , connect in daisy chain configuration.
True, I guess that in KiCad I have to create two different projects to create two PCBs?
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 407
  • Country: ie
    • LinkedIn
Re: Choosing right resistor for transistor base in LED matrix
« Reply #35 on: August 10, 2024, 04:50:37 pm »
>  I guess that in KiCad I have to create two different projects to create two PCBs?

True. Technically you careate 2 pcb in one KiCAD design but it very inconvenient and complicated.
 

Offline kanaronTopic starter

  • Contributor
  • Posts: 16
  • Country: pl
Re: Choosing right resistor for transistor base in LED matrix
« Reply #36 on: August 10, 2024, 05:11:16 pm »
Thanks, I will have to think about it then

Also I just found out transistors in SOT883 package ;D
2335957-0

But ok, I promise, now I will be looking at that matrix drivers ;D
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5134
  • Country: ro
  • .
Re: Choosing right resistor for transistor base in LED matrix
« Reply #37 on: August 10, 2024, 06:11:39 pm »
SOT883 is  0.6mm x 0.5mm

You can get ULN2003F12 (4 mosfets with resistors and esd protection) in 3mm x 3mm : https://www.digikey.com/en/products/detail/diodes-incorporated/ULN2003F12FN-7/5054226

Saves you space as you also no longer have to use resistors to limit current going into transistors.

... but led drivers is the way to go ...  Go back at my previous posts and check those drivers I suggested.

For example TM1640B I suggested can do 16 8 segment digits so you could have 16 vertical columns of 7 leds controlled by a single driver (3 digits)

But even simpler would be to just go for 4  IS31FL3741A :  https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3741A-QFLS4-TR/12675545

They're 9 x 39 led matrix drivers, and you could just use it as 7 x 39 ... with two drivers you have 9 x 78 ... enough for 15 x 5 led wide  digits , or 13 x 6 led wide digits

Or you could use the 16 x 12 IS31FL3733B that's available in easier to solder TQFP footprint : https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3733B-TQLS4-TR/12675547

It's also available in regular QFN (no pins, a bit smaller) : https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3733B-QFLS4-TR/12675544


You can do the layout as 8 x 24 instead of 16 x 12, and then you'd need only 3 chips to handle the 12 digits in a row, so 6 chips in total... with 24x3 = 72 , you could have 12 6 led wide digits.

You could literally have the leds soldered on one side, and footprints for the drivers on the back side and with a bit of solder paste and hot air gun or even plain flux and thin tip, you could solder the driver chip on the board.

Or you could just surface mount a couple headers on the back of the board and put the driver chips on small boards that plug into the headers on the back of the driver boards.

« Last Edit: August 10, 2024, 06:17:28 pm by mariush »
 

Offline kanaronTopic starter

  • Contributor
  • Posts: 16
  • Country: pl
Re: Choosing right resistor for transistor base in LED matrix
« Reply #38 on: August 10, 2024, 06:45:34 pm »
Yep, Im looking at that IS31FL3733B
I calculated it and it looks like that it will be much cheaper than buying all that transistors and shift registers

Quote
SOT883 is  0.6mm x 0.5mm
I know ;D Everything would be alright... until first sneeze ;D
However 840 leds in 0402 package... tightly one next to another... This will be much more difficult than about 300 SOT883 transistors. And I couldn't find this kind of leds on jlcpcb stock so it looks like I will have to order stencil and solder paste and just place all of leds by hand... Without messing up polarity and without sneezing. I just hope that I could ask jlcpcb to restock leds that I need and to ask them to assembly it. I will see how it would be, I have never ordered assembly from jlcpcb
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5134
  • Country: ro
  • .
Re: Choosing right resistor for transistor base in LED matrix
« Reply #39 on: August 10, 2024, 07:24:33 pm »
Yeah, just do keep in mind the address bits for i2c chips, I think you can a maximum of 4 3733b on one i2c bus, each with a unique address... so either have two i2c buses or use a i2c multiplexer ic (splits one i2c into 8 i2c outputs, each with unique address)

You could order a steel stencil to apply solder paste on the contacts, and you could order a separate stencil to align/center the leds on the pads. Then you could just heat up the pcb from the bottom with a hot plate or something like that, maybe even a hot air gun, to gradually heat up and solder the leds.

tme.eu has reasonable prices for leds in volume, if lcsc doesn't have what you want.

these has a nice big dot inside them showing polarity, so it's quite easy to orient them if you have a magnifying glass on your desk when placing them on the board.

0402 red : https://www.tme.eu/nl/en/details/fyls-0402ckurc/smd-colour-leds/foryard/

0402 green : https://www.tme.eu/nl/en/details/fyls-0402cpgc/smd-colour-leds/foryard/

0402 blue : https://www.tme.eu/nl/en/details/fyls-0402cubc/smd-colour-leds/foryard/

0402 yellow green : https://www.tme.eu/nl/en/details/fyls-0402ckugc/smd-colour-leds/foryard/

0402 yellow https://www.tme.eu/nl/en/details/fyls-0402ckuyc/smd-colour-leds/foryard/

« Last Edit: August 10, 2024, 07:26:34 pm by mariush »
 

Offline kanaronTopic starter

  • Contributor
  • Posts: 16
  • Country: pl
Re: Choosing right resistor for transistor base in LED matrix
« Reply #40 on: August 10, 2024, 08:02:32 pm »
Quote
Yeah, just do keep in mind the address bits for i2c chips, I think you can a maximum of 4 3733b on one i2c bus, each with a unique address

I will probably just go with 4 digits on one PCB so one, maybe two IS31FL3733B on that PCB and I will place small STM32 to handle this one display and I will be sending data maybe via SPI or I2C to that STM32 from different "main" STM32. This will be probably the easiest and cheapest way to do this. Also few smaller 4 digits boards will be easier to handle while soldering

Quote
Then you could just heat up the pcb from the bottom with a hot plate or something like that, maybe even a hot air gun, to gradually heat up and solder the leds.
I have soldering station with hot air. Could I just heat it from above with the smallest airflow? I think very small airflow wouldnt make all leds fly ;D

Quote
tme.eu has reasonable prices for leds in volume, if lcsc doesn't have what you want.
Im sourcing all parts from tme.pl At least if I can, sometimes I have to go with digikey but then I have to deal with customs... And I will have to order IS31FL3733B from digikey

But about that leds and jlcpcb. I meant that I checked stock on jlcpcb site. https://jlcpcb.com/parts If I understand correctly then if I take assembly from jlcpcb then I have to take prats from their site

But I heard that lcsc is somehow connected with jlcpcb, but I dont know the details.
If jlcpcb can source parts for assembly from lcsc then I would be very happy as lcsc have 0402 leds that I could use.
EDIT: I take that back... lcsc doesnt have just green 0402 LEDs. They have 0402 yellow-green leds. But I need just pure green. So I just have to order them from tme and solder them by myself. So I have to order that solder paste as well

Or if orders from lcsc could somehow be send in one package with PCBs from jlcpcb then I could order IS31FL3733 from them
« Last Edit: August 10, 2024, 08:14:22 pm by kanaron »
 

Offline xvr

  • Frequent Contributor
  • **
  • Posts: 407
  • Country: ie
    • LinkedIn
Re: Choosing right resistor for transistor base in LED matrix
« Reply #41 on: August 10, 2024, 08:12:04 pm »
PCBA from jlpcb could be an easiest silution. They can use chips from external supplers (not sure for tme). One side assembly will be relatively cheap. But you have to order at least 2 pcb.
 

Offline kanaronTopic starter

  • Contributor
  • Posts: 16
  • Country: pl
Re: Choosing right resistor for transistor base in LED matrix
« Reply #42 on: August 10, 2024, 08:19:38 pm »
PCBA from jlpcb could be an easiest silution. They can use chips from external supplers (not sure for tme). One side assembly will be relatively cheap. But you have to order at least 2 pcb.

Thanks, so I will have to ask them. jlcpcb and lcsc dont have pure green 0402 (just yellow-green) so I hope they will be able to source them somehow. And I will make separate pcb for display and I will make 4 digits per pcb so 6 pcbs to assembly
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf