Author Topic: Switchable LED's with one PWM brightness control  (Read 640 times)

0 Members and 1 Guest are viewing this topic.

Offline SQWaveTopic starter

  • Newbie
  • Posts: 6
  • Country: nl
Switchable LED's with one PWM brightness control
« on: January 19, 2021, 09:58:22 am »
Hello everyone!
I'm building flight simulator hardware and I'm running into a question. There are multiple ways to skin this cat, and I am curious to see what other people would prefer as a solution.

Situation: 10 indicator/warning 'lights', each is illuminated by 2 LED's (Würth 151034YS03000) in parallel. This all runs at 5 volt with each LED drawing 25mA (2x 10 LED's = 500mA in total).
It should be possible to individually turn on and off each indicator, but brightness control (PWM) should be the same for all. I do not have enough PWM pins on my uC to have individual PWM control for each indicator. So I prefer to have one PWM pin that does the brightness control for all 10 indicators simultaneously.

Possible solutions:
- Have one PNP PWM'ing the 5V to all indicators for brightness control, and a NPN for each indicator to turn them on and off individually.
- Have a NPN for each indicator to turn them on and off, and one NPN below this to do the PWM'ing for the brightness.

I hope this is clear, if not then I apologize, and shall draw the proposed schematics.
There may be more solutions to this which could work better. Thank you all in advance!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3077
  • Country: us
Re: Switchable LED's with one PWM brightness control
« Reply #1 on: January 19, 2021, 10:32:34 am »
There are LED controller chips you can use. They are sometimes called "display drivers" or "segment drivers". You communicate with them via SPI or I2C and they handle all of the PWM for you.

One such commonly used by hobbyists: https://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf

However, there are tons of other possibilities. Maybe have a look at this Mouser catalog page:

https://www.mouser.com/Semiconductors/Driver-ICs/LED-Display-Drivers/_/N-9l13t

and filter by "Features".

Or scan through TI's Product Portfolio: https://www.ti.com/power-management/led-drivers/overview.html
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3077
  • Country: us
Re: Switchable LED's with one PWM brightness control
« Reply #2 on: January 19, 2021, 10:42:15 am »
Ok, another possibility...

You have 1 GPIO generating the PWM waveform and 10 other GPIOs assigned to control whether the lights are ON or OFF. Each warning light is controlled by a MOSFET. The signal sent to the gate of the MOSFET is the logical AND of the PWM waveform and the corresponding control signal. You could use a couple of 74HC132 chips, for instance (see attached schematic). This only works because your PWM waveform is common to all of the warning lights.
« Last Edit: January 19, 2021, 11:01:21 am by ledtester »
 

Offline SQWaveTopic starter

  • Newbie
  • Posts: 6
  • Country: nl
Re: Switchable LED's with one PWM brightness control
« Reply #3 on: January 19, 2021, 10:54:27 am »
To be sure I've attached an example of my two solutions.

The AND idea sounds like an interesting idea, I will investigate this. Thank you!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3077
  • Country: us
Re: Switchable LED's with one PWM brightness control
« Reply #4 on: January 19, 2021, 11:07:15 am »
An issue with using bipolar transistors is that it takes current to activate a transistor and your PWM GPIO pin may not be able to supply enough current to drive 10 BJTs.
 

Offline SQWaveTopic starter

  • Newbie
  • Posts: 6
  • Country: nl
Re: Switchable LED's with one PWM brightness control
« Reply #5 on: January 19, 2021, 12:12:02 pm »
That's certainly true about the current. We're using an ATSAMD20, not that 'powerful'. Using a high Hfe might help, but a FET is probably smarter. I think that the NAND gate solution as you suggested will be suitable. I guess an AND will work better in this case, but potato potato.
 

Offline EEauroro

  • Contributor
  • Posts: 11
  • Country: au
Re: Switchable LED's with one PWM brightness control
« Reply #6 on: January 20, 2021, 01:55:50 am »
I think you meant for the on-off switch to be on individual branches (10x branches in total) sch attached. As previously mentioned, swap BJTs for FETs for lower operating current
 

Offline SQWaveTopic starter

  • Newbie
  • Posts: 6
  • Country: nl
Re: Switchable LED's with one PWM brightness control
« Reply #7 on: January 20, 2021, 10:02:03 am »
It's 10x 2 LED's in parallel, but yes I guess we mean the same thing :) I've gone for the logic gate option with a Nexperia 74AHC2G08DP and Infineon BSS806NH6327XTSA1 Mosfets.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf