Author Topic: How bad it is to power LCD backlight from MCU IO?  (Read 1878 times)

0 Members and 1 Guest are viewing this topic.

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
How bad it is to power LCD backlight from MCU IO?
« on: March 12, 2020, 02:04:34 pm »
Hi,

I want to cut some components from BOM, so I thought could I just power 80x160 px LCDs backlight directly from STM32F411 IO pin, how bad of the ide it is?
I want to have a way to turn LCD off.

Ussualy this LCD is powered like this:


But according to LCD datasheet backlight takes 15mA:


And STM32F411 IO is capable sunking/sourcing up to 25mA:


So here I'm...

There will be no other high power demand from MCU IO, logic only.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8164
  • Country: de
  • A qualified hobbyist ;)
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #1 on: March 12, 2020, 03:14:42 pm »
Should work fine. One disadvantage could be the impact of the PWMed current on sensitive MCU functions like the ADC.
« Last Edit: March 12, 2020, 03:17:25 pm by madires »
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #2 on: March 12, 2020, 03:30:31 pm »
Should work fine. One disadvantage could be the impact of the PWMed current on sensitive MCU functions like the ADC.

By "PWMed current" you mean backlight PWM? Would be nice feature to use PWM on BL to dim the screen...
Anyway, not using any analog stuff, only digital IO (regular digital IO, I2C, SPI).
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8164
  • Country: de
  • A qualified hobbyist ;)
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #3 on: March 12, 2020, 04:01:10 pm »
Yes, I meant backlight PWM. And don't skimp on bypass caps. ;)
 
The following users thanked this post: 3dgeo

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15360
  • Country: fr
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #4 on: March 12, 2020, 04:06:09 pm »
Just a thought - given the typical Vf of 3V (what about dispersion?), this is close to a 3.3V rail. There's bound to be some dispersion in backlight brightness from one unit to the next unless you can sort of adjust it. It may not matter if you're building just one unit or if you don't care about that as long as it's just lit up.
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #5 on: March 12, 2020, 04:46:15 pm »
Just a thought - given the typical Vf of 3V (what about dispersion?), this is close to a 3.3V rail. There's bound to be some dispersion in backlight brightness from one unit to the next unless you can sort of adjust it. It may not matter if you're building just one unit or if you don't care about that as long as it's just lit up.

What amount we are talking about? If it's less than 10% than I dont care, but it's not one off product, at least I hope it isn't :)
How to avoit it?
 

Offline Tomorokoshi

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #6 on: March 12, 2020, 05:30:47 pm »
Actually, I would leave the circuit, and put a transient suppressor on the base of Q2. One route to damage is that someone could get a static charge built up, touch the display, and have a discharge path directly to the processor.
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #7 on: March 12, 2020, 05:40:16 pm »
Actually, I would leave the circuit, and put a transient suppressor on the base of Q2. One route to damage is that someone could get a static charge built up, touch the display, and have a discharge path directly to the processor.

LCD will be covered by 2mm tansparant acrylick glass, so I doubt there will be any static charge issues.
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #8 on: March 12, 2020, 06:17:15 pm »
Yes, I meant backlight PWM. And don't skimp on bypass caps. ;)

Oh I'm not going to, I have 4 bypass caps (near every MCU VCC).
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 15360
  • Country: fr
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #9 on: March 12, 2020, 06:18:09 pm »
Just a thought - given the typical Vf of 3V (what about dispersion?), this is close to a 3.3V rail. There's bound to be some dispersion in backlight brightness from one unit to the next unless you can sort of adjust it. It may not matter if you're building just one unit or if you don't care about that as long as it's just lit up.

What amount we are talking about? If it's less than 10% than I dont care, but it's not one off product, at least I hope it isn't :)
How to avoit it?

Well, I can't tell exactly how much without having any more info on the backlight LED(s)...
Quick example though: let's say Vf = 3.0 +/- 0.1V, so 2.9V <= Vf <= 3.1V (which doesn't seem that unreasonable.) Neglecting the error on the resistor and the 3.3V rail here.
Then ~ : 9.1mA <= If <= 18.1mA (@3.3V supply) Looks pretty bad.

The only simple way of reducing the error would be to increase the voltage at which you power the backlight.
For instance, @5V now (with a 150ohm res.) : 12.7mA <= If <= 14.0mA, which is not nearly as bad.

Of course, generating an additional rail just for this may be inconvenient. But if you have a +5V already available somewhere...

Another way would be to add a constant current source instead of just a series resistor, but that will just add more parts (which you were trying to avoid.)

And maybe I'm just being overly cautious and dispersion on Vf (or at least the impact of If on actual brightness) is not that bad.
« Last Edit: March 12, 2020, 06:19:54 pm by SiliconWizard »
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #10 on: March 12, 2020, 07:27:15 pm »


Quote from: SiliconWizard on Today at 06:18:09 pm
And maybe I'm just being overly cautious and dispersion on Vf (or at least the impact of If on actual brightness) is not that bad.



No, I'm really glad You bring this up! This was my goal – to find out things I don't know, I'm extreemly thankful for bringing things like this up, You people are awesome! Thank You!

I have 5V rail, I just wanted to see if I can reduce BOM. Well, I have free 10K resistor in a resistor array, and I already have 1.5K and 22R resistor in the BOM, so extra cost would be for extra transistor and 3 PnP parts.

Anyway, despite LCD brightness power from IO circuit should work and shouldn't give me any other issues?

I guess I'll do what I planned to do – I'll make modular PCB prototype where I can jump jumpers and test all powering options...
 

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12671
  • Country: ch
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #11 on: March 12, 2020, 08:43:16 pm »
Yes, I meant backlight PWM. And don't skimp on bypass caps. ;)
Just FYI, PWMing the backlight can cause some weird flickering effects on some LCDs, if the backlight and the LCD refresh rate happen to interact in unfortunate ways. I saw it when experimenting with a 1602 character LCD.
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #12 on: March 12, 2020, 09:00:06 pm »
Just FYI, PWMing the backlight can cause some weird flickering effects on some LCDs, if the backlight and the LCD refresh rate happen to interact in unfortunate ways. I saw it when experimenting with a 1602 character LCD.

Yes, I see how this can happen, but it's easily fixable by changing PMW frequency. I'll test it, but the sceen is small and not that bright anyway, so dimming BL is not that nescesary feature, I'm OK with it being ON or OFF only. I might drop this feature entirely and just connect it straight to 5V and be done with it. But I want to explore all options first...
 
The following users thanked this post: tooki

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8789
  • Country: fi
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #13 on: March 12, 2020, 09:51:47 pm »
Also note the IO pin equivalent DC resistance is uncontrolled and varies somewhere between maybe 10 and 30 ohms depending on unit, temperature, etc. This will be in series with any external resistance.

OTOH, it can work out to be somewhat self-regulating: if the particular LED Vf is lower than you expect (a low Vf unit, or hot LED temperature), it draws more current, causing more heating in the MCU IO MOSFET, heating it up, causing the IO pin resistance to go up, lowering the current. Such a negative Rds(on) feedback loop can compensate for the positive feedback loop of the LED Vf per temperature.

Of course, do the IO pin current draw analysis for the worst case Vf of the LED.

Note that for better current regulation at Vled=5V and larger resistor value (as shown by SiliconWizard), you won't necessarily need external transistor: STM32 MCUs have IO pins which are 5V tolerant and have the open-drain output mode. I tend to use that when directly powering low-current LEDs with Vf too close to 3.3V.

If you decide to not use the IO pin to power the display directly, the transistor route isn't that much better; it's extra parts, and it's still kinda sucking at current regulation. Consider using a constant-current linear LED driver with enable pin instead: these are cheap and come in tiny packages, and the part count will be lower because no resistors are needed at all. They tend to come with some fixed current settings like 10mA and 20mA.
« Last Edit: March 12, 2020, 09:54:08 pm by Siwastaja »
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #14 on: March 12, 2020, 11:51:30 pm »
You mean something like NSI45015WT1G ?

If so they cost 6cent in quantity and -+20%, that means 12 to 18mA – doesn't look very accurate as well...
« Last Edit: March 13, 2020, 09:39:52 am by 3dgeo »
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8789
  • Country: fi
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #15 on: March 13, 2020, 12:17:57 pm »
Yes but it's guaranteed range of actual current regulation, regardless of LED Vf and supply voltage variation.

Do the actual analysis for the resistor solution and you may be surprised how hard it is to guarantee an accurate LED current unless you have a lot of voltage to drop over the resistor. For example (made up numbers to show the point):

Nominal design:
Vsupply = 5.0V
Vf=3.0V
R = 133 ohms
Iled = 15mA

Worst case max current:
Vsupply = 5.0V + 4% (typical 7805-style linear reg) = 5.2V
Vfled = say 2.6V
R = 133 ohms - 5% = 126 ohms
Iled = 20.1mA

Worst case min current:
Vsupply = 5.0V - 4% (typical 7805-style linear reg) = 4.8V
Vfled = say 3.4V
R = 133 ohms + 5% = 140 ohms
Iled = 10.0mA

So suddenly 12.0mA to 18.0mA starts looking appealing.

Note that far too often, LED Vf range is not properly rated at all (only typical condition given). Also note even if the min,max range is tabulated, it's only the unit variation at a specific temperature, and you need to add the temperature coeff on the top.

Though, all of this likely won't matter. The backlight brigthness is not that different at 10 or 20mA. Just make sure you won't exceed the maximum.

But clearly, if you do this analysis with the 3V3 supply, it's a definite no-go. It may still practically work, especially for one-off, but that's design by luck. That's why I tend to drive blue, white, or high-brightness green LEDs that require Vf=3V-ish, using the 5V tolerant open-drain IO pins; red, yellow etc. at below 2V work fine with a series resistor from the 3V3 output.
« Last Edit: March 13, 2020, 12:19:33 pm by Siwastaja »
 
The following users thanked this post: 3dgeo

Offline Chalcogenide

  • Regular Contributor
  • *
  • Posts: 167
  • Country: it
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #16 on: March 13, 2020, 12:41:41 pm »
I think you could just run the LED with the anode connected to the +5V supply, and its cathode via a resistor to your MCU IO pin. If you set your output high, at 3.3 V, the LED will stay OFF (it's only seeing a 1.7 V forward voltage, nowhere near enough for it to emit any sort of measureable light output) and your IO pin will be kept at 3.3V which is safe; to turn on the backlight, just set the pin low. You don't necessarily need open-drain, 5 V tolerant pins to get this to work, as long as the rest of your circuit on the 3.3V rail draws more current than what leaks through through the LED when OFF (otherwise the voltage on the 3.3V rail may rise, potentially causing issues. But that's quite unlikely with a single LED driven this way).
 
The following users thanked this post: 3dgeo

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #17 on: March 13, 2020, 10:25:31 pm »
@Siwastaja:

Very good point indeed!

If I remember correctly absolute max is 25mA.
My project will be powered by USB.
Actually I have IS31FL3741 LED matrix driver on the PCB, but I can't use it cos it's a matrix driver...

I can drive it from 5V, and yes, I understand how to make it work with MCU IO (open/drain config).

This will not be a cheap product, I totally can use that constant current driver, it's just my OCD I guess to optymyze as much as I can :D

And I rather spend few cents per PCB more than dealing with issues in the future...

As I said I will make universal PCB prototype so I can test all posible options, tho I'm leaning to 5V, open/drain and NSI45015WT1G...
« Last Edit: March 13, 2020, 10:28:36 pm by 3dgeo »
 

Offline wizard69

  • Super Contributor
  • ***
  • Posts: 1184
  • Country: us
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #18 on: March 14, 2020, 04:21:06 am »
You need to look at the spec directly below the one that you highlighted!    The first thing you check obviously is the current handling capability of one pin!  But that is only part of the chips power capability, since only you know what is connected to the other pins and the current draw there, we can't say if it is OK.    For a backlight you should consider current draw to be continuous but we have no idea what the other pins are doing.   15ma is about 1/10 of your budget that can quickly escalate if you have other continuous loads.

So yeah consider doing so but verify your overall load on the processor.

Should work fine. One disadvantage could be the impact of the PWMed current on sensitive MCU functions like the ADC.

By "PWMed current" you mean backlight PWM? Would be nice feature to use PWM on BL to dim the screen...
Anyway, not using any analog stuff, only digital IO (regular digital IO, I2C, SPI).
 

Offline TomS_

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: How bad it is to power LCD backlight from MCU IO?
« Reply #19 on: March 21, 2020, 01:02:06 am »
And STM32F411 IO is capable sunking/sourcing up to 25mA:

But dont disregard the total sink/source capability (the figures at the top of that table), and how the current requirements of the backlight might eat into the budget required for the rest of the chip and what ever else it is doing.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf