Reducing LED flickering

ledmicrocontroller

I am using a PIC18F452 micro-controller to generate PWM with ADC. The PWM output is connected to an LED through a MOSFET. There is some flicker occurring. How can the flickering be reduced?

can you provide a circuit for this led brightness control?

Best Answer

No schematic or code so this answer is a little generic, though the same question can be encountered with completely different code and schematic.

As John U. suggested, see if you can increase the PWM frequency or possibly use a different algorithm. This stackoverflow post suggests an approach. Trade-offs can be made between levels of brightness and period.

If this doesn't reduce the flicker enough, try adding an RC filter between the PWM output and the MOSFET gate to smooth the waveform.