Blue LEDs are becoming prevalent in the industry, and sometimes make their way onto control panels as flashy indicators. Their high forward voltage, however, runs counter to the downward trend in supply voltages. A panel that includes a 3.3V supply voltage may have a hard time driving LEDs that sometimes require upwards of 3.5V for illumination. To drive multiple blue LEDs you may require a charge pump or boost regulator, but for a single LED you can do the job with a few discrete components and an IC that may, with luck, already reside on the PC board.
GPIO expanders are often designed onto control panels to accommodate their remoteness. (Routing a serial bus in place of 8 or 16 parallel wires is much more convenient, and the smaller cable and connector saves cost.) You can drive the LED by using a couple of the GPIO lines. Thus, a GPIO expander with built-in pulse-width modulation (PWM) capability, combined with 50mA sink capability on each I/O line, forms an inexpensive discrete-component charge pump (Figure 1
). The charge pump is limited by the oscillator's low switching frequency (2kHz), but this approach works because the LED needs only about 10mA.
Figure 1. While performing other functions, this GPIO-expander chip can easily drive a blue LED as well.
Adding a capacitor and Schottky diode to one of the eight outputs (P4) and placing that output in PWM mode (at about 50% duty cycle) generates enough voltage to drive the LED. A second output (P6) turns the LED on and off. On/off capability is needed if the LED forward voltage is near or below the power-supply voltage, because current can flow though CR1 even when the oscillator is turned off. Capacitor C1 charges to about 3V when P4 goes low. When P4 goes high, the capacitor voltage adds to the power supply voltage, and delivers current to the LED through R1. The LED current discharges C1 during P4's off time, so the capacitor must fully recharge on the next cycle.
Having a 3.3V supply voltage, the circuit delivers about 15mA average, which produces a brightly glowing LED. At 3.0V the current drops to about 10mA, and at 2.0V to about 3mA. By altering the values of R1 and C1, you can modify the current to suit a particular LED. Note that you must stop the PWM before P6 is turned off. The charge pump places up to twice the supply voltage on P6, which comes precariously close to that output's maximum application voltage rating.
A similar version of this article appeared in the "Tips and Tricks" section of the January 17, 2005 issue of EE Times