Design Idea
Mutliplexing technique yields a reduced-pin-count LED display
Adding a few discrete components to the output lines of a microcontroller allows you to control 2–N×(N–1) LEDs using only N I/O lines.
Saurabh Gupta and Dhananjay V Gadre, Netaji Subhas Institute of Technology, Dwarka, New Delhi, India; Edited by Martin Rowe and Fran Granville -- EDN, 10/16/2008
“Charlieplexing” as a method of multiplexing LED displays has recently attracted a lot of attention because it allows you, with N I/Olines, to control N×(N–1) LEDs (reference 1 through reference 5). On the other hand, the standard multiplexing technique manages to control far fewer LEDs. Table 1 lists the number of LEDs that you can control using Charlieplexing and standard multiplexing by splitting the available number of N I/O lines into a suitable number of rows and columns. Table 1 also shows the duty cycle of the current that flows through the LEDs when they are on.
Clearly, Charlieplexing allows you to control a much larger number of LEDs with a given number of I/O lines. However, the downside of this technique is the reduced duty cycle of the current that flows through the LEDs; thus, to maintain a given brightness, the peak current through the LEDs must increase proportionately. This current can quickly reach the peak-current limit of the LED. Nonetheless, Charlieplexing is a feasible technique for as many as 10 I/O lines, allowing you to control as many as 90 LEDs. To control an equivalent number of LEDs using the standard multiplexing technique would require 19 I/O lines.
This Design Idea proposes a modification to the Charlieplexing technique that allows you to control twice as many LEDs. Thus, the proposed method, “GuGaplexing,” allows 2×N×(N–1) LEDs using only N I/O lines and a few additional discrete components (Figure 1). To turn on LED D1 using the Charlieplexing method, set P1 to logic one and P2 to logic zero. To turn on LED D2, set P1 to logic zero and P2 to logic one. Figure 2 shows the proposed GuGaplexing scheme with two I/O lines controlling four LEDs. The GuGaplexing technique exploits the fact that each I/O line has three states: one, zero, and high impedance. Thus, with two I/O lines, states 00, 01, 10, and 11 of eight possible states control the LEDs.
Table 2 lists the voltage at the output of the transistor pair for various states of the two I/O lines, P1 and P2. The transistor pair comprises a BC547 NPN and a BC557 PNP transistor; matched transistor pairs are recommended. For N I/O lines, the GuGaplexing technique requires N–1 transistor pairs. Table 3 shows the state of the I/O lines P1 and P2 and the voltage at node PR1 to control the four LEDs. The circuit requires that the LED turn-on voltage should be slightly more than VCC/2. Thus, for red LEDs with a turn-on voltage of approximately 1.8V, a suitable supply voltage is 2.4V. Similarly, for blue or white LEDs, you can use a 5V supply voltage. Modern microcontrollers, especially the AVR series of microcontrollers from Atmel, operate at a wide variety of supply voltages ranging from 1.8 to 5.5V, and this design uses a Tiny13 microcontroller to implement the GuGaplexing technique.
Figure 3 plots the voltage at node PR1 for various supply-voltage values when the input to the transistor pair is floating. The Spice simulation ensures that the circuit would work properly to provide VCC/2 at the PR1 node for wide operating-supply-voltage values when the input is floating.
|
A 24-LED bar display validates the scheme in a real application (Figure 4). The display is programmable and uses a linear-display scheme for the input analog voltage. The input analog voltage displays in discrete steps on the 24-LED display. Controlling 24 LEDs requires only four I/O lines and three pairs of transistors. The system uses 5-mm, white LEDs in transparent packaging and a 5V supply voltage. The GuGaplexing implementation uses an AVR ATTiny13 microcontroller. The analog input voltage connects to Pin 7 of the ADC input of the Tiny13 microcontroller.
The control program for the ATTiny13 microcontroller is available. The source code is in C and was compiled using the AVRGCC freeware compiler. You can modify the source code to display only one range of input voltage between 0 and 5V. For example, it is possible to have a linear-display range of 1 to 3V or a logarithmic scale for input voltage of 2 to 3V.
| References |
|
















