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
There are not tags associated with this post.
About the author

Dr. Ace Jeangle -

  • deep

    Hey just managed to get ics on my beagleboard and was wondering if theres a way to control the brightness from android?

    • Dr. Ace Jeangle

      This is possible by special PIC firmware. But frankly speaking, I have no idea when can find time for this.

  • http://jasperpotts.com Jasper Potts

    Is there a easy way to force max brightness? Eg just connecting the two light sensor wires together?

    • Dr. Ace Jeangle

      Yes, just short pins CFG1 and CFG2 on CON3.

  • Jed Smith

    Is there a way to have PIC completely turn off back-light LEDs from OS’s ‘put display to sleep when inactive’?

    I’m using this with a BeagleBoard xM running ubuntu 10.10 and would like the screen to go completely dark (not just blank) when not used for awhile. I understand the ambient light sensor part, but even disconnecting that leaves the back-light LEDs on at a low PWM setting. I see the PIC is connected to a SCL line that I’m assuming becomes inactive when the OS puts the display to sleep (haven’t probed or traced where that line connects beyond CON1 pin 14), but doesn’t seem to use that input for either PWM or LED_ON output.

    • http://www.chalk-elec.com/ Dr. Ace Jeangle

      PIC controller has reset pin (pin 4, MCLR#) connected to signal PUP from BeagleBoard. You can control this pin from user space under Linux. When PIC in reset state, LCD will be completely off.

  • Andrew Nobles

    Hi, can you please post a photo of the CFG1 and CFG2 short pins for forcing max brightness? I have the 10″ kit for Raspberry pi and the display is always very dark.
    Anyway, great quality of the product.

    • http://www.chalk-elec.com/ Dr. Ace Jeangle

      Andrew, you should check wires that goes from light sensor to black color connector. Probably one of wire is damaged?

  • http://www.chalk-elec.com/ Dr. Ace Jeangle

    Yes, you should drive low signal PUP (CON2 pin 18) – this pin is usual GPIO on mainboard side, so it can be controlled from user space.

  • http://www.chalk-elec.com/ Dr. Ace Jeangle

    Should be public, check again.

  • http://www.chalk-elec.com/ Dr. Ace Jeangle

    short pin 1 and pin 4 on CON4

  • Pingback: Raspi success! | new wayward elf()