Design Idea

“Chipiplexing” efficiently drives multiple LEDs using few microcontroller ports

"Chipiplexing" approach simultaneously drives two LEDs.

Guillermo Jaquenod, La Plata, Argentina; Edited by Martin Rowe and Fran Granville -- EDN, 11/27/2008

Actual microcontrollers have powerful bidirectional I/O ports, and you can use different techniques to fully exploit such capabilities. Recent Design Ideas described the “Charlieplexing” method as an effective way to drive M=N×(N–1) LEDs using only N bidirectional I/O ports and N resistors (reference 1 and reference 2). Unfortunately, using Charlieplexing allows you to drive only one LED at a time, so, when using a large number of LEDs, only a tiny slice of time is available to multiplex each LED: TDRIVE=T/M, where T is the PWM excitation period. As a consequence, to obtain a given average current and bright LEDs, you must excite them with a current M times higher, and you can’t usually obtain such peak currents from the microcontroller port.

This Design Idea describes “Chipiplexing,” a method in which you need to add only N cheap, bipolar transistors. This circuit uses PNP types, but you can also use NPN devices. (The term Chipiplexing comes from my nickname, Chipi.) The benefits pay the additional cost because you can simultaneously drive N–1 LEDs, thereby reducing peak currents N–1 times.

Figure 1 shows the approach for N=3 and M=6, but you can use the same criteria for different values of N; in this case, you can simultaneously drive two LEDs. The current-limiting resistors connect in parallel with the base and emitter of the added PNP transistors, and all the collectors connect to ground. If you set one of the microcontroller ports to zero, or ground, the respective PNP transistor has a grounded base, and its emitter is at a fixed voltage—typically, 0.7V. You can excite every LED whose cathode connects to this emitter through the remaining ports. If you set the port to one, the battery voltage, the LED turns on; if you set the port to high impedance, the LED turns off.

See all of EDN's
Design Ideas

Table 1 shows how there are now nine possible combinations of the three microcontroller ports: the six available when using Charlieplexing to drive one LED at a time and three new combinations to drive two LEDs at a time. The microcontroller port grounds the transistor’s base. This action fixes a junction-drop voltage at the emitter and collects and sinks all the LED currents to ground without overconstraining the microcontroller port, which has to sink only the transistor’s base current plus 0.7V per resistor. Each of the other ports set to the battery voltage needs to source only one LED current.

With Charlieplexing, two resistors are in the LED-current path; in this case, however, you can easily compute the limiting resistors as R=(VBAT–VLED–0.7)/ILED, where VBAT is the battery voltage, VLED is the LED voltage, and ILED is the desired LED current. The benefits are more noticeable as the number of LEDs increases. For N=5, with 20 LEDs, this approach gives 20% of the total time to drive each LED, instead of only 5% of the time using Charlieplexing.


References
  1. Gadre, Dhananjay V, “Microcontroller drives 20 LEDs,” EDN, Sept 27, 2007.
  2. Gadre, Dhananjay V, and Anurag Chugh, “Microcontroller drives logarithmic/linear dot/bar 20-LED display,” EDN, Jan 18, 2007, pg 83.


ADVERTISEMENT

ADVERTISEMENT

Feedback Loop


Post a CommentPost a Comment

There are no comments posted for this article.

Related Content

 

By This Author

There are no additional articles written by this author.


ADVERTISEMENT

Knowledge Center





Technology Quick Links

EDN Marketplace


©1997-2009 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.
Use of this Web site is subject to its Terms of Use | Privacy Policy

Please visit these other Reed Business sites

ADVERTISEMENT
You will be redirected to your destination in few seconds.