Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] LED fade in/out without flickering resolution issue

Status
Not open for further replies.

Louis1345

Newbie
Newbie level 1
Joined
Nov 14, 2022
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
27
Hi All

I'm new to the forum and this would be the second time I have ever posted something on any forum.

I’ll try to articulate what I worked on before and the results I’m trying to achieve.

I have multiple levels to my project, but I’ll post only the first issue here for now.

Project:
Fade high power LED in/out (up, down) without flickering.
The usually arduino led fade is not going to cut it here. I’m past the stage of uploading my program on other commercial mcu's but I want to fix some issues I have.

When using arduino for example with pwm you don’t notice the flickering on a small LED but on high power LED you do. I am aware it’s due to the low frequency output (490hz default) and using different timers and libraries you can increase the frequency, but I don’t want extra libraries and increasing frequency isn’t the correct way from what I was told.
I say flickering because as the high power led fades down, I notice a small flickering just before it gets down to the very last bit. It seems to be a common issue seeing that lots of mcu's can't go right down to 0% resolution. As the pulses become less the times slows down and you notice the slight flicker.
I also know that the low-end micro controllers are all 8bit which provides low resolution.

I was told to use at least a 32bit controller and gamma correction to fade in/out smooth without visual flickering.
I also did a lot of research and it’s also advised to use a mosfet driver even if I’m using a logic level mosfet.

Any suggestions and advice would be much appreciated.
I would very much like to hear from embedded software/core developers/engineers on this topic.
I have attached a video of the fade in/out I require. I only need to do it with one white high-power LED.
The display in the video was created using smd5050 LEDS and they used color acrylic over the leds to simulate the color. It is not pixel leds.
They have obtained a very smooth fade which I want to achieve as well.





 

Solution
I've just done something similar but using three PWM channels. If you are familiar with Arduino, switch to using an ESP32 MCU, it is almost code compatible with smaller MCUs but has 16 PWM channels and can run them at much higher frequencies than 490Hz. I run them at 1024Hz and 10-bit resolution and it appears completely flicker and step free. Mine also has WiFi control (built into the ESP32) but you can disable it if you don't need it.

Brian.
I've just done something similar but using three PWM channels. If you are familiar with Arduino, switch to using an ESP32 MCU, it is almost code compatible with smaller MCUs but has 16 PWM channels and can run them at much higher frequencies than 490Hz. I run them at 1024Hz and 10-bit resolution and it appears completely flicker and step free. Mine also has WiFi control (built into the ESP32) but you can disable it if you don't need it.

Brian.
 
Solution
Hi,

first of all: you post a 15MBytes video that does not show the problem, not your code, not your LED, not your control.
--> show your code, your hardware, your test setup, your information.

(I mean, if your car is broke, would you show an advertisement video of a different car and different brand to your mechanic at the garage? I guess you´d rather bring your own car to the garage, for it to be repaired.)

****

When doing such stuff I recommend get familiar what you need. So if you don´t want to see "flicker" you need to learn how the eye works. Human eyes (including brain) treats PWM´d light (not moving) above 50Hz as non flickerung. Wohever tere are some more sensitive people that can "recognize" PWM´d light up to 200Hz. And maybe even higher frequency when the light opject is small and moving. I never heard that there are people that can detect 500Hz as "flickering".
BUT: The eye is rather good in compensating huge dynamics in brightness.
So what you call "flickering" is not (PWM) flickering, but the steps/resolution in brightness. Sadly you don´t give any informatin about your step size (PWM resolution) and brightness update rate.

****
Any sketch, drawing, information about your circuit is good information.
Text only - from my experience - is not that infromative.

****
ARDUINO is an IDE, the ARDUNO hardware uses different microcontrollerf of different brands of different processing power with differnt periferals. Sadly we miss any information.

As the pulses become less the times slows down and you notice the slight flicker.
The frequency is important. And the frequency does not go down when you reduce duty cycle.
You may use libraries, but you are always free to control the perifierals directly.
So - for me personally speaking - I like the direct way without libraries, because I have full control over the periferal.

It seems to be a common issue seeing that lots of mcu's can't go right down to 0% resolution.
I don´t say it´s a common issue, because the microcontroller usually does what you tell it to do. I say it´s common that people make mistakes - maybe caused by a lack of understanding.
Others did make the same mistakes before. Thus I always recommend to read through documentation provided by lighting companies, universities... Don´t rely on random hobbyists.

Can you explain what you mean with "0% resolution"?

"I was told" .. by whom? Hobbyist, or university? Decide whom you believe.

to use at least a 32bit controller
This is nonsense. Almost every 8 bit microcontroller can do smooth brightess control.
It rather depends on the software, the periferal setup, the update rate .... and of course the PWM resolution.

I also did a lot of research and it’s also advised to use a mosfet driver even if I’m using a logic level mosfet.
Has nothing to do with "flicker". And I can not agree to this.

I also did a lot of research
Then please give links to the documents/internet sites.

***
My recommendaton:
* read how the eye/brain works regarding brightness
* do caclculations on your own, or use give links to according informations
* decide your requirements in values with units
* show your code
* show your hardware
* show your test setup / test conditions

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top