Choosing right resistor for transistor base in LED matrix - Page 1
Forum section: electronics / beginners

author: kanaron
author_rank: Contributor
timestamp: August 05, 2024, 03:54:32 pm
content: HiI want to create LED matrix 7x5 and I was wondering choosen resistors are correct in this case for transistor's bases and if this approach is valid at all.If I understand transistors correctly then base resistor determinates current going into base and collector-emiter current is base current times beta. But in case of LED matrix collector current is changing. I'm multiplexing columns so one "row" NPN transistor will always have either one LED off or on so 0mA or 20mA on collector. But "column" PNP transistor can have 0-7 LEDs turned on so 0-140mA on collector. And this leave me puzzled because from my reasoning I have to use different base resistor depending on how much current is on collector. I checked part of this design on breadboard and with 1k resistor on PNP transistor base everything worked. Maybe current consumption showed on my power supply was lower than 140mA with all 7 LEDs on. But I just prefer to ask first if all of it is correct before ordering parts and PCBIf screenshoot is not readable then:- base resistors for "column" PNP transistor is 1000 ohm- current limiting resistors are 1 ohm (because voltage drop of LED in datasheet is from 2.6V to 3.4V and supply voltage is 3.3V then I assumed that 1 ohm resistor is probably ok in this case)- base resistors for "row" NPN transistor is 3600 ohm

author: ledtester
author_rank: Super Contributor
timestamp: August 05, 2024, 04:44:39 pm
content: 1 Ohm is way too little for the resistors R51 - R55. If the LED voltage happens to be 2.6V and allowing 0.2V for CE drops, you'll have ( 3.3-2.8 )/1R = 500mA going through the LED.I'd start with 100 Ohms and adjust from there.Quote from: kanaron on August 05, 2024, 03:54:32 pmWith your schematic I don't think you want to do it that way. I would have only one NPN on at a time - ie scan one row at a time. Then you can size the current limiting resistor for just one LED being on. Otherwise you have to pick a resistor value which will work for one to seven LEDs being on -- quite impossible.

author: Xena E
author_rank: Frequent Contributor
timestamp: August 05, 2024, 06:37:53 pm
content: There's no need to explicitly calculate a base resistor for each current scenario.Pick the maximum current that the driver transistor will have to handle, calculate the current needed to bias the transistor into saturation, collector current divided by worst case gain, (from the data sheet)multiplied by five¹ for a safety margin to ensure the transistor is fully saturatedthen from that figure calculate your resistor value.¹Purely rule of thumb, basically the resistor is a current limiter it's just about keeping the transistor switched fully on.As for the shared current when multiple leds are on, either multiplex or give each led its own individual resistor from the bus lines.

author: PGPG
author_rank: Frequent Contributor
timestamp: August 05, 2024, 06:43:30 pm
content: Quote from: kanaron on August 05, 2024, 03:54:32 pmYour reasoning is wrong.In such schematic you not regulate LED current with transistor base resistors. This resistors should insert into base enough current for transistor to be totally switched on. So if you know that maximum collector current is 140mA and beta is 100 you need to insert in base minimum 1.4mA. This will switch on the transistor but it will be poorly turned on. If in collector there will be 140mA than voltage drop at transistor (collector-emitter) will be about 0.7V, but when only one LED will be on the voltage drop will be 0.2V. And you will get different current in LEDs depending on how many of them are on. You should insert in base more current. The reasonable minimum in your case will be 140mA/20.The same with npn transistors - minimum is 20mA/20.Current in the LEDs should have been set by resistors that are in serie with them. Measure voltage drop at LED when 20mA is going through them and assuming that at pnp and npn transistors you have 0.2V calculate the LED serial resistors. 3.3V can be to small voltage if these are LEDs needing about 3V. Typical red LEDs have voltage drop around 1.8V.To ensure LEDs will light more or less the same you should have a drop at these serial resistors about 1V. In other case you will notice difference in brightness as because of voltage drop differences at diodes you will get different currents and brightness depends mainly on LED current.And one more thing. I understand that you tested how your LEDs shine and you assumed 4mA average current is what you need.

author: kanaron
author_rank: Contributor
timestamp: August 05, 2024, 07:44:15 pm
content: Thanks, I will make R51-R55 larger.Quote from: ledtester on August 05, 2024, 04:44:39 pmSo... multiplexing by each LED one by one? Then each row will take 7 times longer and entire matrix will takie 35 times longer to multiplex. It is simpler and I would only need 74HC164 shift registers for columns and rows and I could get rid of HEF4094 shift and store registers. I will test this approach tommorow to check if that 35 times longer for a matrix is visible or not. But based on my previous tests I think 1/35 duty cycle will result in much dimmer or almost invisible dotsQuoteThanks, I will calculate it as you said. And I think I will go with individual resistor per led. I'm already scared of soldering session (or weeks of soldering) as I have to place 24 of these matrixes on 10x5 cm space... 840 leds and now 840 resistors next to each ledQuoteWell, these leds are green and in datasheet it says that voltage drop is 2.6V - 3.4V... I'm not sure why there is 0.8V disperssion. Is it voltage range on which leds will be on or are there manufacturing errors and one led will have 2.6V drop and another could have 3.4V... I hope not the latter...QuoteIf I should have 1V drop on resistor then for sure 3.3V supply can be too small. However brightness difference is not a big problem as for most of the time majority of leds will be off. Some of them will show few digits and other will not show anything most of the time. Of course I hope that we are not talking about massive brightness differencesQuoteWell I didn't test these particular leds as I still have to make a decision about package. I hoped for 0603 to make it easier to solder but if I have to place resistor next to each led then I think I will have to go with 0402. I tested this with factory made green led matrix 7x5. I hope there wont be much of a difference

author: mariush
author_rank: Super Contributor
timestamp: August 05, 2024, 08:20:36 pm
content: Well, if you want to make it yourself, I would say make it as bright as you want.You will light up either one row out of 7 at a time, or you'll light up one column at a time out of 5...So any led will light up 1/7 or 1/5 of time, which means you can run the leds at currents higher than default current, because they'll have time to cool down.For example, lots of leds rated for 20mA will also be rated for 100mA at 1/10 duty cycle (ex run for 10ms, off for 90 ms or something like that) so you could configure the default current at 40-50mA and as long as you don't screw up your code and keep looping through the leds, you'd be fine.A slightly better solution would be to use led driver chips.The easiest would be to use chips designed to run seven segment digits... lots of chips are designed to control between 4 and 16 "digits" , with anything between 7 and 16 "segments". You just tell the chip which segments to light up, and the chip will take care of looping through the digits updating the segments.So in your 7 x 5 matrix , you could treat each group of 7 leds as the segments of a digit, and therefore you have 5 digits with 7 "segments" each.TM (Shenzen Titan Micro) makes a bunch of seven segment led drivers that are very easy to use.For exampleTM1640B can do 16 digits, each with 8 segments :https://www.lcsc.com/product-detail/TM-Shenzhen-Titan-Micro-Elec-TM1640B_C2962200.htmlYou could literally have 3 8x5 matrixes controlled by a single chip, or you could link together 3 "grid" pins at a time so that each of the 5 rows/columns will light up 3/16 of the time.TM1638 can do 8 digits, each with 10 segments :https://www.lcsc.com/datasheet/lcsc_datasheet_2401261512_TM-Shenzhen-Titan-Micro-Elec-TM1638-TA2009B_C20611979.pdfSo you'd have 16 5 led columns, basically 2 7x5 matrixes.TM1629B can do 8 digits, each with 14 segments :https://www.lcsc.com/datasheet/lcsc_datasheet_1809191914_TM-Shenzhen-Titan-Micro-Elec-TM1629B_C46800.pdfSo you could use 14 segments to control 2 rows of 7 leds .... basically you have 16 7 led lines, so you could control 3 7x5 matrixes with a single chipAll these are super cheap, like 10-20 cents ... cheaper than buying the pnp transistors and resistors and use much less space on a circuit board. They're also not that hard to solder on a prototyping board, you could just bend the leads or use a small soic / tssop to DIP adapter board..There's also DIP versions but more limited ex TM1637 (6 digits, 8 segments per digit) :https://www.lcsc.com/datasheet/lcsc_datasheet_2401261512_TM-Shenzhen-Titan-Micro-Elec-TM1638-TA2009B_C20611979.pdfor TM1630 (5 digits x 7 segments or 4 digits x 8 segments ) :https://www.lcsc.com/datasheet/lcsc_datasheet_2209231730_TM-Shenzhen-Titan-Micro-Elec-TM1630_C5174529.pdfThere's also dot matrix" led driver chips. For example, have a look atIS31FL3738 :https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3738-ZLS4-TR/14308389It's a 8 x 6 matrix driver, so you could easily do a 7x5 or 8x5 or 8 x 6 matrix - you may want 8 pixels because it makes it easier to make custom "fonts" / "characters"Compared to the previous drivers, this driver lets you compare the maximum current through a single resistor, then you can set the brightness of each individual led to whatever level you want. So you can for example set the maximum current to something like 40mA because the actual average current on a led will be 1/6 or 1/8 of that)

author: kanaron
author_rank: Contributor
timestamp: August 05, 2024, 08:35:35 pm
content: Well, I have never heard of LED drivers, you always learn something newI will for sure take a look at this tomorrow, thanks a lot

author: mariush
author_rank: Super Contributor
timestamp: August 05, 2024, 09:43:43 pm
content: Yeah, I should add ... there's dot matrix drivers that can go up to 350+ single color leds, I just gave you one that can do more than 7x5 leds and is easier to solder.There's for example IS31FL3733B that can do 192 leds in a 16 x 12 matrix (but you can rearrange it as 8 x 24 or other patterns) :https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3733B-TQLS4-TR/12675547If you want to keep it more basic, instead of individual transistors, with your 7x5 arrangement, you have the option of using chips like ULN2003A which has 7 darlington transistors inside along with the base resistors.So basically, you put a voltage on one of the 7 input pins, and that channel is connected to ground.Because you're dealing with darlington transistors there's around 1v drop in the chip, so you have to account for that when you calculate the current for the leds.For example, let's say you power with 5v , your red leds have a 1.8v forward voltage, and you want 20mA (0.02A) per led... then you'd set the current to 5v - 1.8v (drop on led) - 1v (drop in transistor) = 0.02A x Resistor ... so Resistor = 2.2v / 0.02A = 110 ohmYou can get these ULN2003A for pennies in DIP packages :https://www.lcsc.com/search?q=uln2003aIf you don't mind surface mount, you can go with the mosfet version ULN2003V12 which replaces the darlington transistors with mosfets, so it doesn't have that 1v drop, otherwise works the same :https://www.lcsc.com/search?q=uln2003v12It also contains all the gate resistors, esd protections, everything inside.so you can use uln2003A / uln2003v12 to connect to ground 7 leds, which means you'd rotate through 5 columns giving power to one column at a time.This means each column may need up to 7 x 20mA = 140mA if you want to limit the single leds to 20mA, so you'd want pnp transistors or p-channel mosfets capable of at least 200mA.There's loads that can do more than 200mA :https://www.digikey.com/short/mrvj1jb5For example BC807 can do up to 500mA, and has a hFe of at least 100, so with just 3-5mA you're more or less fully open the transistor. Basically, I'd just use a 100 ohm resistor on the base, but probably could go up to 330 or so without any issues.There's dual pnp transistors or dual p-channel mosfets if you want to reduce component count.

author: PGPG
author_rank: Frequent Contributor
timestamp: August 05, 2024, 10:57:20 pm
content: Quote from: kanaron on August 05, 2024, 07:44:15 pmIn past all red LEDs worked with about 1.8V drop and green with about 2.0V. Green LED needed higher current to light comparably with red once.Some years ago new green LEDs appeared. Working with much higher voltage and needing much less current. For signalling I use such green LEDs powering them with around 1mA while those old needed about 10mA.I prefer to drive LEDs with current source so I don't care if voltage drop is 2.6V or 3.4V. Where from is such big voltage drop difference I don't know. Is it temperature change or manufacturing serie versus serie.

author: ledtester
author_rank: Super Contributor
timestamp: August 05, 2024, 11:12:02 pm
content: QuoteWith the way you have set up the resistors you should scan the display row by row, not column by column.Also, if if your LEDs are bright enough with just 1mA of current you can get rid of both NPN and PNP transistors.The 74HC164 can easily source 1mA per output pin and the HEF4094B can also easily sink 5mA from its output pins.Datasheets:https://www.diodes.com/assets/Datasheets/74HC164.pdfhttps://assets.nexperia.com/documents/data-sheet/HEF4094B.pdf

author: PGPG
author_rank: Frequent Contributor
timestamp: August 06, 2024, 09:23:41 am
content: Quote from: kanaron on August 05, 2024, 07:44:15 pmFrom that sentence I think you miss something.When current in LEDs is switched on each of them should have its individual resistor to make their currents be the same. But this doesn't mean that you need as many resistors as you have LEDs. As they are switched in groups you need only so many resistors as there are LEDs in such group (row or column). The same resistors then are used when the next group is switched on.

author: kanaron
author_rank: Contributor
timestamp: August 06, 2024, 03:40:53 pm
content: Quote from: PGPG on August 06, 2024, 09:23:41 amWell I missed thatI need resistors only on rows and not on columns. Because of multiplexing by columns on row there will be always just one led on or offQuoteI will rearrange resistors to multiplex by columns. Also I'm not sure if 1mA will be enough. I measured that in current scenario I have about 10% duty cycle so I think it is safe to calculate everything for 20mAAlso I'm thinking if I need NPN row transistors... One row will always have maximum one led turned on so one output pin of HEF4094 would have to drive just one led. But then in datasheet input/output current is +-10mA so... I think it is better if I will leave these transistors hereAnd also thanks a lot for information about that dot matrix led driver. I will have to calculate everything which approach will be better. Dot matrix led driver sounds like perfect solution for... dot led matrixAnd I think I could use much less pins with this approach and maybe smaller uC, because well... Right now I'm using everything what I canI paid for whole uC and I will use whole uCHowever I have to calculate costs as I think I will have to ship them from US... It seams like they can't be found in Poland... There are eg. already made matrix boards with IS31FL3741 on them but there are none just IS31FL3741 to buy...But then it is something new for me and will be fun to exploreOn the other hand I have used shift registers before, I'm familiar with them, I have already tested this approach on smaller scale and I have code already preparedTough decision

author: PGPG
author_rank: Frequent Contributor
timestamp: August 06, 2024, 10:55:06 pm
content: Quote from: kanaron on August 06, 2024, 03:40:53 pmYou have to learn to read datasheets.In:https://www.mouser.pl/datasheet/2/916/HEF4094B-2937862.pdfat page 6/15 you read that at temperature of 25°C when IC is powered (VDD) with 5V IOL of 0.5mA will rise output Vo to 0.4V (when VDD=10V, IOL=1.3mA will make Vo=0.5V). As you want Vo being lover than 0.4V you can get less current from this IC. As it is CMOS you can assume that it has some resistance at output so if 0.5mA rises output to 0.4V then 0.25mA will rise it to 0.2V.When VDD will be lower than 5V (I understand your supply is 3V3) the output resistance will be higher so current you will be able to get will be lower.10mA you found is the maximum value forced by external circuitry. Exceeding it can damage IC.HEF4094 is not the best selection for this application. It belongs to digital ICs designed when analog circuits were powered by +-15V and digital by 15V. Its switching times are about 75ns (for VDD=10V) and 150ns (for VDD=5V). So 2x lower voltage 2x slower. For 3.3V you should expect 150*5/3.3 = 230ns.HC4094 will work better here. About 10ns switching times for VCC=4.5V. And you can find that taking 6mA from its output (VCC=4.5V) will rise VOL to 0.26V. So for HEF 0.5mA makes output being 0.4V while here 6mA makes it 0.26V (when ideal value is 0V).There are faster/stronger digital ICs families (AHC, LVC are both faster and stronger than HC family, and there are more) but I don't know in which of them 4094 are there (may be you need to search other shift register).

author: Zero999
author_rank: Super Contributor
timestamp: August 07, 2024, 08:57:34 am
content: Pure green LEDs with a higher forward voltage 2.6V to 3.4V are marginal at 3.3V.Is a 5V supply available?If not, I would just use a low value resistor, or none at all, since the internal wiring will be enough to limit the current.

author: kanaron
author_rank: Contributor
timestamp: August 07, 2024, 11:16:16 am
content: Thanks, I had HEF4094 lying around for years so I just used them, but thats right, they are not for this application. From faster families there are available 74HC4094, however I browsed a bit and it looks like I could use 74AHC594. I will check both options and decide and I will have to read about newer IC familiesQuoteWell this project will have a few different boards (about 20 but others have much less complexity and current consumption) that I wanted to power from one 12V power supply. And each board will have their own 3.3V switching regulator. So I could just easly change one feedback resistor so that this one board would have 5V switching regulator and I would just place LDO from 5V to 3.3V for logic and leave 5V for leds

author: PGPG
author_rank: Frequent Contributor
timestamp: August 07, 2024, 01:28:26 pm
content: Quote from: kanaron on August 07, 2024, 11:16:16 amHCT logic can work at 5V and accept signals from 3V3 logic.

author: kanaron
author_rank: Contributor
timestamp: August 07, 2024, 02:00:56 pm
content: True, I meant that I will need LDO for STM32

author: kanaron
author_rank: Contributor
timestamp: August 07, 2024, 08:33:09 pm
content: So I have changed HEF4094 to 74LVC595AI got rid of NPN transistors as LVC family can drive 26mA so 1 20mA LED shouldn't be a problem... If I'm not mistakenI changed PNP transistors to P channel mosfets DMP2004KI replaced current limiting resistors from columns to rows and I made them 10 ohm just to be sure (for now I left 3.3V supply)And I left 1k ohm resistors on mosfets gatesDoes it look correct now? And do I need pull up resistors for mosfets gates?

author: ledtester
author_rank: Super Contributor
timestamp: August 08, 2024, 12:45:56 am
content: Make sure there isn't a limit for the entire chip.What datasheet are you looking at?According to this datasheet:https://assets.nexperia.com/documents/data-sheet/74LVC595A.pdfthe supply and ground currents are limited to 100mA.

author: kanaron
author_rank: Contributor
timestamp: August 08, 2024, 07:00:48 am
content: True, I missed thatBut now I hope that it is all correct?I added N channel mosfets 2N7002AQ on rows with 1k ohm gate resistors

author: PGPG
author_rank: Frequent Contributor
timestamp: August 08, 2024, 12:31:17 pm
content: Quote from: kanaron on August 08, 2024, 07:00:48 amI wanted to suggest it but had no time to write.2N7002AQ. Rds=3.5Ω at Vgs=5V. For smaller Vgs no data in table so no guarantee. Chart with typical output characteristic tells little more, but you should think that these are only typical. Looking at Gate Threshold Voltage range you can try to imagine this chart for worse case (when buying you have no guarantee to get typical, but only not worse than described worst).See DMG1012. Rds=0.4Ω at Vgs=2.5V.

author: kanaron
author_rank: Contributor
timestamp: August 08, 2024, 12:42:47 pm
content: Thanks, changed to DMG1012Now I just have to design pcb and later solder everything

author: xvr
author_rank: Frequent Contributor
timestamp: August 09, 2024, 02:50:29 pm
content: QuoteJust use TPIC6(A/B/C)595 instead of 74LVC595. MOPSFETs not needed

author: Zero999
author_rank: Super Contributor
timestamp: August 09, 2024, 05:08:41 pm
content: Why bother with low on resistance transistors? There are 10R resistors in series with the LEDs. Simply reduce the value of the series resistors to compensate for the on resistance of the transistors. Heck, you might even be able to omit the series resistors.

author: PGPG
author_rank: Frequent Contributor
timestamp: August 09, 2024, 07:01:14 pm
content: Quote from: Zero999 on August 09, 2024, 05:08:41 pmOP 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.Quote from: Zero999 on August 09, 2024, 05:08:41 pmDriving 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.

author: Zero999
author_rank: Super Contributor
timestamp: August 09, 2024, 08:58:00 pm
content: Quote from: PGPG on August 09, 2024, 07:01:14 pmBut 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.QuoteYou'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.

author: PGPG
author_rank: Frequent Contributor
timestamp: August 09, 2024, 11:10:38 pm
content: Quote from: Zero999 on August 09, 2024, 08:58:00 pmIn 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.Quote from: Zero999 on August 09, 2024, 08:58:00 pmIt 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 from: Zero999 on August 09, 2024, 08:58:00 pmNo. 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.Quote from: Zero999 on August 09, 2024, 08:58:00 pmHere 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.

author: Zero999
author_rank: Super Contributor
timestamp: August 10, 2024, 10:02:56 am
content: Quote from: PGPG on August 09, 2024, 11:10:38 pmThe 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.QuoteBut they won't have the same forward voltage. Remember the data sheet says 2.6V to 3.4V.QuoteWhat 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 hFEof a BJT is more variable than the RDSof 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.QuoteThat 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.

author: kanaron
author_rank: Contributor
timestamp: August 10, 2024, 10:37:02 am
content: Well right now I'm reconsidering my choises with placing everything on one boardFor 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 5VI 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

author: ledtester
author_rank: Super Contributor
timestamp: August 10, 2024, 01:38:35 pm
content: 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.

author: squadchannel
author_rank: Frequent Contributor
timestamp: August 10, 2024, 01:50:51 pm
content: o-ho! It looks like hp's alphanumeric display!

author: kanaron
author_rank: Contributor
timestamp: August 10, 2024, 03:01:23 pm
content: QuoteThis is battery panel from Boeing 737-800Im (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)QuoteThanks, 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 displayBut 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" uCSo many optionsIm thinking that multiple PCB would be the best idea in terms of potential fixes, costs and potential reusability

author: squadchannel
author_rank: Frequent Contributor
timestamp: August 10, 2024, 03:46:30 pm
content: MAX6952, it seems to be able to control 4 digits.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

author: xvr
author_rank: Frequent Contributor
timestamp: August 10, 2024, 04:25:49 pm
content: If you consider multiple PCB design the best one will be the same PCBs with small matrix , connect in daisy chain configuration.

author: kanaron
author_rank: Contributor
timestamp: August 10, 2024, 04:37:37 pm
content: Quote from: squadchannel on August 10, 2024, 03:46:30 pm...it existsThere 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 packageBut on the other hand they are in fact quite expensive... I have to recalculate itQuoteTrue, I guess that in KiCad I have to create two different projects to create two PCBs?

author: xvr
author_rank: Frequent Contributor
timestamp: August 10, 2024, 04:50:37 pm
content: > 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.

author: kanaron
author_rank: Contributor
timestamp: August 10, 2024, 05:11:16 pm
content: Thanks, I will have to think about it thenAlso I just found out transistors in SOT883 packageBut ok, I promise, now I will be looking at that matrix drivers

author: mariush
author_rank: Super Contributor
timestamp: August 10, 2024, 06:11:39 pm
content: SOT883 is 0.6mm x 0.5mmYou 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/5054226Saves 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/12675545They'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 digitsOr 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/12675547It's also available in regular QFN (no pins, a bit smaller) :https://www.digikey.com/en/products/detail/lumissil-microsystems/IS31FL3733B-QFLS4-TR/12675544You 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.

author: kanaron
author_rank: Contributor
timestamp: August 10, 2024, 06:45:34 pm
content: Yep, Im looking at that IS31FL3733BI calculated it and it looks like that it will be much cheaper than buying all that transistors and shift registersQuoteI knowEverything would be alright... until first sneezeHowever 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

author: mariush
author_rank: Super Contributor
timestamp: August 10, 2024, 07:24:33 pm
content: 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 yellowhttps://www.tme.eu/nl/en/details/fyls-0402ckuyc/smd-colour-leds/foryard/

author: kanaron
author_rank: Contributor
timestamp: August 10, 2024, 08:02:32 pm
content: QuoteI 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 solderingQuoteI 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 flyQuoteIm 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 digikeyBut about that leds and jlcpcb. I meant that I checked stock on jlcpcb site.https://jlcpcb.com/partsIf I understand correctly then if I take assembly from jlcpcb then I have to take prats from their siteBut 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 wellOr if orders from lcsc could somehow be send in one package with PCBs from jlcpcb then I could order IS31FL3733 from them

author: xvr
author_rank: Frequent Contributor
timestamp: August 10, 2024, 08:12:04 pm
content: 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.

author: kanaron
author_rank: Contributor
timestamp: August 10, 2024, 08:19:38 pm
content: Quote from: xvr on August 10, 2024, 08:12:04 pmThanks, 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