《电子技术应用》
您所在的位置:首页 > 电源技术 > 设计应用 > 仅用一个微处理器管脚驱动两个低静态电流的LED
仅用一个微处理器管脚驱动两个低静态电流的LED
摘要: 本设计方案的基础是使用三个电阻和一个微处理器I/O引脚作为输入高阻抗或输出,独立地驱动两个LED工作的电路。本设计的想法听上去很好,主要出于微处理器缺少多余I/O引脚和简化设计的考虑。
Abstract:
Key words :

  两个简单的电路实现用电池供电的微处理器驱动两个LED

  本设计方案的基础是使用三个电阻和一个微处理器I/O引脚作为输入高阻抗或输出,独立地驱动两个LED工作的电路(参考文献1)。本设计的想法听上去很好,主要出于微处理器缺少多余I/O引脚和简化设计的考虑。不幸的是,电路不能使于电池供电设计,因为其在正常工作下的有2mA泄漏电流,甚至在两个LED都不工作的情况下也存在。本设计方案改进了原电路,仅使用一个I/O引脚驱动两个LED,但存在低漏电流(图1)。虽然电路使用了两个二极管和一个电阻,但价格低且器件数少。

仅用一个微处理器管脚驱动两个<a class=低静态电流的LED" border="0" height="354" hspace="0" src="http://files.chinaaet.com/images/20100816/bdcdc76d-2bce-44ed-b514-92f3cd4130c1.jpg" width="419" />

  两个电路工作的基础是二极管的非线性特征,电流随通过其的电压呈指数增长。为描述其工作过程,假定微处理器管脚被设置为输入,其余管脚为高阻状态。在第一个电路中,假设LED需要约1.5V电压才能工作,小信号二极管电压降约为0.6V(图1a)。所以,为使两个LED都工作,理论上需要4.2V。实际上,LED在约4V电流80µA时开始变暗,4.4V电流1mA时完全暗掉。对3.3V,漏电流仅为2.41µA。电路名义上的电压稍小于3.3V,但如果那样的话,应该使用Schottky二极管。

 

  第二个电路的电源电压大于5V(图1b)。使用图中值,LED在7V 74µA电流下开始变暗,8.5V 1mA电流下完全暗掉,5V电源1.53µA下仍关闭。为导通LED,必须配置微处理器的I/O引脚为输出;输出值为1导通下面的LED,输出值为0导通上面的LED。如果两个LED都必须表现为工作,可以编程使引脚在0和1之间以大于50Hz的频率循环。为计算两种情况的电阻值,使用下面的公式:R=(3.3V–VD–VLED)/ILED(图1a),和R=(VCC–VZ–VLED)/ILED(图1b),在这里ILED为LED所需的电流,VD为ILED电流流过二极管产生的电压,VZ为zener二极管电压,VLED为ILED电流流过LED的前向电压。应该使用Schmitt触发器或I/O引脚的模拟输入来避免过电流。

  英文原文:

  One microcontroller pin drives two LEDs with low quiescent current

  Two simple circuits allow a battery-powered microcontroller to drive two LEDs.

  Antonio Muñoz, Laboratorios Avanzados de Investigación del I3A, Zaragoza, Spain, and Arturo Mediano, PhD, GEPM University of Zaragoza, Zaragoza, Spain; Edited by Charles H Small and Fran Granville -- EDN, 2/7/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 both circuits is the nonlinear characteristic of a diode, in which current grows exponentially with the voltage applied across it. To describe the operation, suppose that the microcontroller pin is configured as an input, leaving the pin in high impedance. In the first circuit, assume that LEDs need a voltage of approximately 1.5V to turn on and that the small-signal-diode voltage 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 approximately 4V with a current of 80 µA and are fully on with 4.4V at a current of 1 mA. With 3.3V, leakage current is merely 2.41 µA. The nominal voltage for this circuit can be slightly lower than 3.3V, but, in that case, 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.

  Reference

  Pefhany, Spehro, “Circuit Controls Two LEDs With One Microcontroller Port Pin,” Electronic Design, April 1, 2002.

 

此内容为AET网站原创,未经授权禁止转载。