This content requires the Adobe Flash Player and a browser with JavaScript enabled. Click here to get the latest version of Adobe Flash Player.

One microcontroller pin drives two LEDs with low quiescent current

Antonio Muñoz, Laboratorios Avanzados de Investigación del I3A, Zaragoza, Spain, and Dr Arturo Mediano, GEPM University of Zaragoza, Zaragoza, Spain -- EDN Europe, 01 Mar 2008

The basis for this Design Idea is a circuit that uses three resistors and a microcontroller-I/O pin to work as input high impedance or output to independently drive two LEDs (Reference 1). The idea sounded good for this design, mainly because of the lack of spare I/O pins in the microcontroller and the simplicity of the implementation. Unfortunately, you cannot use the circuit in battery-powered designs because it exhibits a current leakage on the order of 2 mA even with both LEDs off. This Design Idea modifies that circuit, using only one I/O pin to drive the two LEDs but with a low current drain (Figure 1). Although the circuit uses a couple of diodes and a resistor, the price and the component count are low.

The basis for the operation of bothcircuits is the nonlinear characteristicof a diode, in which current grows exponentiallywith the voltage appliedacross it. To describe the operation,suppose that the microcontroller pinis configured as an input, leaving thepin in high impedance. In the first circuit,assume that LEDs need a voltageof approximately 1.5V to turnon and that the small-signal-diodevoltage drop is approximately 0.6V(Figure 1a). So, to turn on both LEDs,you theoretically need 4.2V. In practice,the LEDs start dimming at approximately4V with a current of80 µA and are fully on with 4.4V ata current of 1 mA. With 3.3V, leakagecurrent is merely 2.41 µA. Thenominal voltage for this circuit can beslightly lower than 3.3V, but, in thatcase, you should use Schottky diodes.

The second circuit is for supply voltages greater than 5V (Figure 1b). Using the values in the figure, the LEDs start dimming with 7V at 74-µA current and are fully on with 8.5V at 1 mA, remaining off for a 5V supply at 1.53 µA. To turn on the LEDs, you must configure the microcontroller’s I/O pin as an output; an output value of one turns on the lower LED, and a value of zero turns on the upper LED. If both LEDs must appear to be on, your program can cycle the port pin between one and zero with a frequency greater than 50 Hz. To calculate the value of the resistor in both cases, the following formulas apply: R(3.3V-VD-VLED)/ILED (Figure 1a), and R(VCC-VZ-VLED)/ ILED (Figure 1b), where ILED is the desired LED-on current, VD is the voltage across the diode when an ILED current flows through it, VZ is the zener-diode voltage, and VLED is the forward voltage across the LED when an ILED current flows through it. You should use a Schmitt trigger or an analog input for the I/O pin to avoid excessive current draw.

 

REFERENCES
  1. Pefhany, Spehro, “Circuit Controls Two LEDs With One Microcontroller Port Pin,” Electronic Design, April 1, 2002, http://electronicdesign.com/Articles/Index.cfm?AD1&ArticleID1683.


 

Our Sponsors



Ads by Google