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
  1. deep
    Apr 28, 2012

    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
      May 01, 2012

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

  2. Jasper Potts
    Jun 27, 2012

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

    • Dr. Ace Jeangle
      Jun 27, 2012

      Yes, just short pins CFG1 and CFG2 on CON3.

  3. Jed Smith
    Oct 19, 2012

    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.

    • Dr. Ace Jeangle
      Oct 20, 2012

      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.

  4. Andrew Nobles
    Dec 11, 2012

    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.

    • Dr. Ace Jeangle
      Dec 12, 2012

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

  5. Dr. Ace Jeangle
    Feb 17, 2013

    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.

  6. Dr. Ace Jeangle
    Mar 20, 2013

    Should be public, check again.

  7. Dr. Ace Jeangle
    Mar 20, 2013

    short pin 1 and pin 4 on CON4

  8. […] of connectors). The light sensor is a bit strange, and keeps the screen too dim, so I will probably replace it with a 10k pot. It’s also kind of laggy, so not really the interface I want to use while setting everything […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow us