February 19, 2012   Posted by: Dr. Ace Jeangle

How to control LCD backlight brightness

Brightness level in LCD panels is controlled by pulse-width modulation (PWM). PWM is a simple turning the switch between supply and load on and off at a fast rate. The longer the switch is on compared to the off periods, the higher the power supplied to the load is. The PWM switching frequency has to be much faster than what would affect the load, which is to say the device that uses the power. Typically, switching frequency is set to about 200 Hz in most LCD backlight control units.

The term duty cycle describes the proportion of time when switch is on to the regular period of time. A low duty cycle corresponds to low power (low brightness in our case), because the power is off for most of the time. Duty cycle is expressed in percent, 100% being fully on (max. backlight brightness).

Below are several examples of different duty cycles. That’s exactly the waveforms that you can see with oscilloscope connected to pin 4 of connector CON4 on our v2 PCB.
PWM waveforms

PWM waveform is generated by PIC12 microcontroller (U3) on our PCB. The duty cycles of PWM depends on voltage measured on its pin 7 (AN0) that is used as an input to internal analog to digital converter (ADC). We supply our LCD bundle with ambient light sensor connected to this pin. PIC12 measures voltage 10 times every second, and smoothly changes PWM duty cycle. Full cycle of brightness change takes 2 seconds to avoid screen flickers. Here is short video that shows how this works.


For manual brightness change you can substitute ambient light sensor with 10K variable resistor.

Now you can turn knob to control brightness of screen. Please, be aware that it has the same delay of 2 seconds to change brightness to new level. And finally, short video of manual brightness control in action.

Also, you can increase default brightness level by adding resistor in parallel with light sensor. The lower value of resistor will provide higher default brightness level.

12 comments posted in: How-To