Current/voltage limiting of a large array of LEDs ... without LED driver ICs? - Page 1
Forum section: electronics / beginners

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 05, 2020, 07:27:44 am
content: Let's say you want to run an 8 x 8 array of LEDs from a microcontroller (either directly attached rows and columns, or using shift registers), and you want the brightness to remain more or less constant at any voltage between 3 V and 5 V. How would you do it without using expensive LED drivers which provide constant current outputs?PWM would work and is easy, but LEDs are more efficient when run at 100% duty cycle at a lower voltage.

author: fcb
author_rank: Super Contributor
timestamp: February 05, 2020, 07:56:21 am
content: Have your microcontroller monitor it’s supply voltage and then adjust the duty cycle to suit brightness requirement.If you are directly driving the matrix from the microcontroller pins then you’ll probably want some resistors in-line (unless you can rely on the impedance of the microcontroller output driver).Depending on your scheme (8x, 64x) your adjustment could be a simple LUT, 8 LUTs or some polynomial expression.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 05, 2020, 08:35:37 am
content: Those are all solid suggestions which I've used on other projects, but was hoping for a means to control brightness via current or voltage instead of PWM.Leading idea so far is having the shift register powered by a buck converter with a fairly precise voltage. That should be more efficient than current-limiting resistors and/or PWM, but seems to risk uneven lighting due to variations even within binned LEDs ...

author: fcb
author_rank: Super Contributor
timestamp: February 05, 2020, 09:16:27 am
content: As we don't know much about your application (other than it needs to be cheap and power efficient), it's difficult to suggest to much more.Is size an issue (!) and what are you displaying - video? What colour(s) of LED? My experience of LED's is that temperature will have more of an effect on Vfd than manufacturing variations.Either way - you will probably want some sort of current control scheme if you need even brightness.

author: mariush
author_rank: Super Contributor
timestamp: February 05, 2020, 09:36:38 am
content: Quote from: I wanted a rude username on February 05, 2020, 07:27:44 amYou'll have to define what expensive means to you.A led driver can be as cheap as 3 cents.Here's for example a3 cents 8 channel led driverwhich works like a shift register (you'll find these from multiple companies, but this one's available in 220k units, so you could buy a few thousands if you want):https://lcsc.com/product-detail/LED-Drivers_Shenzhen-Sunmoon-Micro-SM74HC595D_C93838.htmlYou can either use one for each row (so around 25 cents for everything) or you could use microcontroller pins to send power to one row at a time (or use micro to turn on a transistor which sends power to a particular row)For10 cents, you can get TM150, a chip designed to drive 4 seven segment + dot LED digits, but which can be rearranged into 4 x 8 matrix (see page 8 of datasheet) :https://lcsc.com/product-detail/LED-Drivers_TM-Shenzhen-Titan-Micro-Elec-TM1650_C44444.htmlSo 2 of these would be enough.27 cents (@100pcs) gets you a 16 x (seven segment + dot) led driver :https://lcsc.com/product-detail/LED-Drivers_TM-Shenzhen-Titan-Micro-Elec-TA6932_C113719.html

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 05, 2020, 10:10:10 am
content: It's a Conway's Game of Life display, with a matrix of white LEDs. Doesn't reallyneedto be super efficient, but it's an interesting exercise ... because the processing demands are so low, the microcontroller will be able to run at a very low speed, and the LEDs will useby farthe largest fraction of the power.Quote from: mariush on February 05, 2020, 09:36:38 amThose don't seem to have current limiting, do they?When reviewing the drivers available through JLCPCB/LCSC, it seemed like there are several varieties: the budget ones like the74HC595are just generic shift registers ... then some about the 20¢ level have 8-level PWM brightness ... and there's a big jump in price to the >$1 drivers which have per-channel current control.If there's no obvious easy option, I'll just use one of the proper drivers like theIS31FL3236A(too many channels but it has current control and costs < 60¢ in volume).

author: tszaboo
author_rank: Super Contributor
timestamp: February 05, 2020, 10:13:28 am
content: Onsemi has these current limiting "diodes" that have a fixed 20mA (or other) current limit. Like NSI45020.

author: mariush
author_rank: Super Contributor
timestamp: February 05, 2020, 10:57:46 am
content: Yeah, I didn't notice those have explicit current limit per led. Some are limited to 20mA per pin, or 150 mA across all pins (so 150mA /... my bad. Yeah, there's those ISL chips which are good value considering they're 36 channel and have pwm and all that and they're easy to use with i2c control.You could also do something else... add a 3v / 3.3v switching regulator to your board. Then you could have one current limiting resistor for each led, or you could use resistor networks.MIC2350 is 30 cents in 100pcs order and it's up to 93% efficient, 2.7v..5.5v in, up to 3.3v out 600mA:https://www.digikey.com/product-detail/en/microchip-technology/MIC23050-SYML-TR/576-3351-1-ND/1980906As its synchronous regulator, only a surface mount cheap inductor and some ceramic capacitors/resistors required ... also has enable pin so you could run the micro directly from batteries and enable regulator only when you want to turn on the leds or whatever, to save power.

author: Zero999
author_rank: Super Contributor
timestamp: February 05, 2020, 12:23:07 pm
content: BJTs and resistors are quite cheap.

author: paulca
author_rank: Super Contributor
timestamp: February 05, 2020, 03:40:27 pm
content: Quote from: I wanted a rude username on February 05, 2020, 10:10:10 amThe 595D does have have current limiting. You set it by providing a resistor. The datasheet has look up tables for the value of R to a given current.It's 8 channel (There are 16 channel variants available), and I believe it's low side (- side of the LEDs) however, you could use another normal shift register (or a multiplexer) to switch the other end of the LEDs giving you a grid. Then "charly plex" the grid, takes more effort programming, but gives you 64 LEDs to play with to display anything you want and not much power required.

author: mariush
author_rank: Super Contributor
timestamp: February 05, 2020, 04:28:15 pm
content: Quote from: paulca on February 05, 2020, 03:40:27 pmIf you're referring to the 3 cents one I linked to above, I don't see any way to set a register in the datasheet.I am aware of such 8 channel led drivers that do allow you to set the current by using a resistor, only they're a bit more expensiveHere's led drivers with resistor for as low as 20 cents :mile long tme.eu led drivers linkex cheapest is 16 channel 5..45mA per channel serial (like a shift register):https://www.tme.eu/ro/en/details/sct2024cssg/led-drivers/starchips-technology/It's pin compatible with other chips likehttps://www.digikey.com/product-detail/en/stmicroelectronics/STP16CPC26PTR/497-11923-1-ND/2757659https://www.digikey.com/product-detail/en/texas-instruments/TLC59284DBQR/296-39245-1-ND/5143238etc8 channel models are about the same price, but gets you cheaper alternatives on digikey and other bigger stores, if you can't wait a week or whatever it takes for parts to comeex.https://www.tme.eu/ro/en/details/sct2168cssg/led-drivers/starchips-technology/

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 05, 2020, 09:47:58 pm
content: Thanks for the advice, everyone!The best option seems to be a buck converter plus PWM. This won't be as efficient as magically powering each row/column at the exact voltage it needs for the desired brightness, but is practical.LED drivers with current control don't seem particularly efficient, especially at higher input voltages, because they regulate linearly. 60% efficiency at 5 V is normal. Some also have significant quiescent current (9 mA for the IS31FL3236A) and talking I2C would be less efficient than just bumping a shift register.So, I thank you all for adjusting my expectations.

author: paulca
author_rank: Super Contributor
timestamp: February 06, 2020, 11:51:05 am
content: Quote from: mariush on February 05, 2020, 04:28:15 pmI was thinking of the TI TLC chips sorry.

author: paulca
author_rank: Super Contributor
timestamp: February 06, 2020, 11:56:44 am
content: Quote from: I wanted a rude username on February 05, 2020, 09:47:58 pmCorrect me if I'm wrong, but if you pulse PWM through a buck convertor into an LED it will still fry the LED as for that instant the LED will be seen as a short on the buck converter so it will get the full current of the output cap discharging through it PWM or not the cap will discharge nearly instantly.. So you still need current limiting though each LED in parallel.Both Boost converters are not that highly efficient either mind. Maybe 90-95% in their optimal point and as low as 60% outside of it.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 06, 2020, 09:36:26 pm
content: Sorry, I wasn't clear: use a buck converter to power a 74HC595 shift register, then PWM the register via its output enable pin. The register will source to the LEDs and the microcontroller will sink.As fcb noted, the impedence of the microcontroller's (and in this case also the 74HC595's) drivers limits current. In practice you can drive LEDs without resistors even at 5 V ... as long as you PWM them at a high enough frequency and low enough duty cycle. I might still end up doing that if, as you point out, the buck converter can't be made to run efficiently.

author: Zero999
author_rank: Super Contributor
timestamp: February 06, 2020, 11:36:09 pm
content: I don't see how this is going to be that efficient.What colour are the LEDs? If they're blue, white, violet or any phosphor converted chemistry, then a supply voltage of 3V, is close to the normal forward voltage and won't guarantee constant brightness, over the temperature range and life time of the LEDs.The 74HC595 has a fairly high output impedance with a supply voltage of 3V and it will probably have a positive temperature coefficient, like all CMOS devices do, so the output voltage will drop more, at higher temperatures.You say the supply voltage can vary between 3V and 5V, so what voltage are you going to set the output of the buck converter to? If you use a controller which can run at 100% output duty cycle then you could set it to 3V and accept there will be a small voltage drop, when the supply voltage falls to just over 3V.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 07, 2020, 12:07:43 am
content: Quote from: Zero999 on February 06, 2020, 11:36:09 pmThat's the idea. Set the voltage just above the point at which the white LEDs show significant variance in brightness. Test power consumption against a more aggressively PWMed unregulated solution at the same perceptual brightness level and see which is more efficient at various input voltages.Basically the buck converter method seems like the best option, and is easily tested and easily bodged out if it doesn't deliver benefits, so pursuing it is low risk.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 07, 2020, 09:43:54 pm
content: Quote from: I wanted a rude username on February 05, 2020, 07:27:44 amQuote from: blueskull on February 07, 2020, 01:58:26 pmThe entire point of this quixotic quest is to minimise power consumption. A good buck converter like theTPS62120isn't super cheap (50¢), but is about 90% efficient in the target voltage and current range so it's definitely worth investigating. If it doesn't work, the plan is indeed to run everything straight off the battery and aggressively PWM the LEDs.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 08, 2020, 07:10:58 am
content: You're concerned that it won't run properly once the battery discharges to near 3 V, right? I'm OK with that ... not sure what the power supply will be yet, but if it's a Li-ion it won't get that low. Thanks for the reminder!By the way, empirically I've found that the true green LEDs run pretty well down to about 2.5 V.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: February 08, 2020, 10:01:21 am
content: Even better: here's a graph of such an analysis I did on a 1 W LED a few months ago, but in 50 mV increments. Power increase is clearly exponential with voltage. Note the discontinuity above 3.2 V ... the LED's heatsink was small and it was overheating.

author: Ian.M
author_rank: Super Contributor
timestamp: February 08, 2020, 11:56:32 am
content: Add as many chokes as your LED matrix has anode lines, and PWM the currently active cathode line in your multiplexing sequence, and you can maintain a constant If (averaged over the multiplex time slot) by reducing the duty cycle proportionally by excess Vcc above Vf, without the usual series resistor for current limiting, so with *MUCH* lower I2R losses at higher Vcc. Here's a LTspice proof of concept.N.B. you *NEED* the 10K resistors across the chokes for damping + you also need some blanking time with all anode lines off before selecting a new cathode line.

author: Zero999
author_rank: Super Contributor
timestamp: February 09, 2020, 11:59:45 am
content: Quote from: blueskull on February 07, 2020, 01:58:26 pmNot all amber LEDs are GaN based. Only the phosphor converted type and confusingly some yellow and grass green LEDs are really deep blue/violet dies, with a phosphor.Here's one with a forward voltage of under 2.4Vhttp://www.farnell.com/datasheets/2343228.pdfHere's a lime green one with a forward voltage of 3V and will be a deep blue/violet die with a phosphor.https://www.tme.eu/Document/59786a08ee3140c896513dd43bcadf0b/osc64l5111a.pdfAnd a nice bright yellow LED, with a forward voltage of 3V.https://static.rapidonline.com/pdf/55-9182.pdfIf the LED has a clear lens you might be able to see the phosphor, so if the die appears to be the same colour as the emitted light, it's probably a deep blue/violet LED plus phosphor, but it's better to check by connecting it to a power supply, via a suitable current limiting resistor.