PAGE 113 OF 150 · MICROCONTROLLERS & LEDS
Charlieplexing Basics
Tri-state pins drive many LEDs from few pins.
LED SYMBOLTriangle points from anode to cathode; the arrows show light leaving the part.
More LEDs from fewer pins
Charlieplexing lights many LEDs from few pins by using each pin as high, low or disconnected. With n pins you can drive n × (n − 1) LEDs, so 3 pins run 6 LEDs, 4 run 12 and 5 run 20.
How it works
- LEDs are placed in opposite-direction pairs between every pair of pins.
- To light one, set one pin high, one low and the rest to input, which is high impedance.
- Scan through the LEDs fast enough for the eye to see them all lit.
Limits
Only one LED is lit at a time, so each is dimmer than normal and needs a higher pulse current. Wiring and coding are harder than with a shift register.
REMEMBER
Disconnected pins are what make Charlieplexing possible.Try it yourself
Sketch the circuit on paper first, calculate the values, then build it on a solderless breadboard using a low-voltage supply. Measure with a multimeter before you make anything permanent.
Explore LED clocks, stopwatches and electronics at cosycom.com.