Charlieplexing is an electronics technique pioneered by Charlie Allen at Maxim in which relatively few I/O pins on a microcontroller can be used to drive a large number of devices, in my case LEDs. It has become known as Charlieplexing in his honour. This technique is possible because each pair of pic pins can be used either way around or made inputs which makes the pin high impedence and essentially invisible to the rest of the circuit.
With Charlieplexing, N output pins can be used to drive N x (N-1) LEDs. This is a huge advantage over a traditional multiplexed display. So for 72 LEDs we can use just 9 pins to address 72 pins, 9 x 8 = 72. A conventional matrix would need a 9 x 8 configuration or 17 pins to achieve the same result.
I started to design my first charlie clocks on this basis and they worked just fine.
An etched board and an assembled clock. This one is for a dual LED clock and uses all combinations of an 11 x 12 charlieplex to drive 132 LEDs.
After a few experiments and changes of layout, I discovered that a 72 LED clock face lends itself much better to twelve sets of six LEDs, although this means using more pic pins and intellectually is less satisfying. So if I used twelve outputs I found I could simplify any hand wiring, especially useful as I etch single-sided boards. Eventually I have settled on a system where the LEDs are divided into two sets of six cathode groups, with the six unused anodes on one side providing the cathodes for the other side. I can best explain this by means of a diagram:
Left: the 12 colours represent the wiring from the 12 pins from the microcontroller. Right: a PCB design derived from the concept.
The circuit layout includes the cathode resistors for each group of 6 LEDs, switches, watch crystal and caps, the PIC microcontroller, a 5v voltage regulator and its associated caps. That is the sum total components. The board measures 4″ or 100mm square.
This Post Has 4 Comments
Dear friend if you don’t mind. can you please send me the clock code. I would like to make one for me 😊
Programmed microcontrollers are available from me at modest cost.
Have you ever done a 60 sec + 60 min + 12 hour clock requiring 12 pins and 132 leds?
I realise you would have to sweep across potentially 3 led’s per second and utilise persistance of vision to get a realistic display but, what a clock!
The two small pictures at the top of the page show a Charlieplexed clock with 132 LEDs. It has its own page at http://clock-it.net/dual-redgreen-clock-with-animations/ I am driving about 15 in rapid succession to create the illusion that they are lit at the same time. This rate has to be way in excess of 3 times a second, more like 1000 times a second.