Modulating LED power based on ambient light level increases battery life, a particularly helpful feature in devices where battery life is measured in days. Using a very simple circuit, Altera’s MAX II and MAX IIZ CPLDs can measure the analog light level of their environments and then drive an LED at a proportional analog intensity level. Controlling the LED intensity based on ambient light as demonstrated reduces LED energy usage by more than 47% without affecting appearance.
Introduction
In portable electronic products, a common use for LEDs is a “heartbeat” indicator that shows power status, battery condition, or Bluetooth connection activity. The LED can be a major factor in determining battery life, as its intensity is directly proportional to power drain. LEDs are designed to be easily seen in bright ambient light, yet it can be assumed that much of the time a portable device is in a dark purse or pocket. A low-intensity LED indicator extends battery life but is useless in a bright environment. Modulating LED power based on ambient light level would increase battery life, a particularly helpful feature in a device where battery life is measured in days.
Regulating the LED’s Intensity
A PWM is very effective at regulating the LED’s intensity with very little wasted energy. The only feature necessary to complete a light-sensitive flash intensity system is an ambient light-level sensor, which can be added to a CPLD or FPGA circuit with no additional components. The light sensor uses the same blinking LED to measure ambient light level. The LED is forward biased to emit light and reverse biased to act as a light detector. Figure 1 shows how the LED is biased for emitting light and for sensing light with a relaxation oscillator. The frequency of oscillation is proportional to light intensity, allowing the use of a PWM to regulate LED light intensity output.
A very simple feedback system can be created for a flashing light. The LED flash intensity is determined by a value presented to the PWM, which is calculated when the LED is off. It is biased as a sensor connected to a relaxation oscillator. The oscillator output feeds into a frequency counter, where the frequency is proportional to the ambient light level. The frequency counter output is the value that controls the intensity of the LED PWM. It is possible to have only one sensor controlling the intensity of multiple LEDs.
Figure 2 shows the block diagram for a flashing LED with a feedback loop that controls the intensity based on the ambient light level.
Figure 3 shows an Altera® MAX® II CPLD design implemented on a MAX II Starter Kit that generates a 1-Hz flash rate with 125ms on period LED flash with a PWM duty cycle from 6.25% to 100%. Various tests with discrete LEDs plugged into the #4 and #8 terminals of the right-side 2×5 header have determined that the four MSBs of an 8-bit counter that samples the LED sensor PINOSC frequency for 125ms are the optimum values to control LED intensity.
Author: Rafael Camarota, Non-Volatile Product Line Manager, Low-Cost Products
Mr. Camarota joined Altera in 2002, where he is responsible for all CPLDs, and configuration products. He has more than 25 years of semiconductor experience and in the PLD industry. He holds a BSEE from Carnegie-Mellon University, and has over 25 patents relating to programmable logic circuits.