Charlieplexing


What is charlieplexing?

Charlieplexing is a technique to reduce the number of used i/o's of a microcontroller while the number of controlled LEDs stays the same. The trick is that each pair of i/o's control two LEDs connected anti-parallel. By switching polarity while multiplexing each LED can be controlled seperately. The number of i/o to LED ratio can be calculated with the folowing simple formula:


NUMBER OF LEDS = NUMBER OF I/O * (NUMBER OF I/O - 1)


Example: How much LEDs can be controlled when five i/o are available?

Number of LEDs = 5 * (5 - 1) = 5 * 4 = 20 LEDs.

From the formula we can see that when the number of i/o is two the outcome is also two, thus charlieplexing with a number of LEDs lower than three is useless. The next list shows the i/o to LED ratio's from three to ten i/o's:

3 i/o's -> 6 LEDs
4 i/o's -> 12 LEDs
5 i/o's -> 20 LEDs
6 i/o's -> 30 LEDs
7 i/o's -> 42 LEDs
8 i/o's -> 56 LEDs
9 i/o's -> 72 LEDs
10 i/o's -> 90 LEDs

On this page you find examples on how to charlieplex LEDs.