2022-08-10 04:49 AM - last edited on 2023-09-01 09:26 AM by Amel NASRI
I have 36 leds on my board. I will connect dimmer my board. How can i adjust leds brightness with dimmer? Because i need to manage 36 output pins. How can i do it?
Solved! Go to Solution.
2022-08-11 10:37 AM
It depends on how your LEDs are controlled and how you feed the dim signal.
If, for example, one transistor is connected in series with each LED, this will lead to flickering at low duty cycles. To avoid this, take one constant current source per LED and short-circuit the LED with the transistor, which allows you to control the brightness between 0% to 100% without flicker. Disadvantage: the set current always flows per LED, only the LED voltage and thus the brightness is reduced to zero.
For brightness control, you can use one PWM channel per LED and transistor if you want to control all 36 LEDs independently.
Now you just have to find an STM32 with as many timers with PWM channels as you need for your 36 channels. And that is exactly what only the STM32H7 family can do at the moment, e.g. with the STM32H723ZG, with which 40 PWM channels can be realised (TIM1...5, TIM8, TIM12...17, TIM23...24).
I recommend using n-channel MOSFETs with a very low gate threshold as transistor switches, because they are directly 3.3V-compatible and their gate can be directly controlled by the PWM output.
Does it answer your question?
Regards
/Peter
2022-08-11 10:37 AM
It depends on how your LEDs are controlled and how you feed the dim signal.
If, for example, one transistor is connected in series with each LED, this will lead to flickering at low duty cycles. To avoid this, take one constant current source per LED and short-circuit the LED with the transistor, which allows you to control the brightness between 0% to 100% without flicker. Disadvantage: the set current always flows per LED, only the LED voltage and thus the brightness is reduced to zero.
For brightness control, you can use one PWM channel per LED and transistor if you want to control all 36 LEDs independently.
Now you just have to find an STM32 with as many timers with PWM channels as you need for your 36 channels. And that is exactly what only the STM32H7 family can do at the moment, e.g. with the STM32H723ZG, with which 40 PWM channels can be realised (TIM1...5, TIM8, TIM12...17, TIM23...24).
I recommend using n-channel MOSFETs with a very low gate threshold as transistor switches, because they are directly 3.3V-compatible and their gate can be directly controlled by the PWM output.
Does it answer your question?
Regards
/Peter
2022-08-13 03:01 AM
You can DMA to the io pins (using a circular buffer, sending to GPIO output register). I controlled 48 Leds (16 RGB Leds) this way using a STM32L4 (100 LQFP package). But this was to provide independent brightness levels to each individual Led.
But if all Leds are dimmed together (synchronised), then you probably only need a single FET to sink all the Leds current, and use that FET to control the brightness (PWM)