Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Multiplex vs Charlieplex

Status
Not open for further replies.
Nigel is right but here is a place to start.

Charlieplexing is a form of multiplexing

Using charlieplexing you can control n*(n-1) leds with n lines. The downside is that you can only light one LED at a time. The time each LED can be on is inversely proportional to the number of LEDs used. This limits the number of LEDS that can be used in many cases.

n=2 2 LEDs
n=3 6 LEDs
n=4 12 LEDs

The Junebug schematic is an excellent example of charlieplexing with 3 line to light 6 LEDs.

The newsletter JPUG #1 has some good information on how how to setup the code for charlieplexing for the PIC in both ASM and C.
 
Last edited:
Using charlieplexing you can control n*(n-1) leds with n lines. The downside is that you can only light one LED at a time.

Many people have this misconception, you can actually light n-1 LEDs at any one time. Take the Junebug, you can make each pin low and control two LEDs by making the other pins high or input. Check out MikeK8LH's clock for a very good example of a 7x8 matrix.

Mike.
 
Many people have this misconception, you can actually light n-1 LEDs at any one time. Take the Junebug, you can make each pin low and control two LEDs by making the other pins high or input. Check out MikeK8LH's clock for a very good example of a 7x8 matrix.

Mike.

I knew I was going to get bit by that one.

The problem is that you can not light them randomly.

There may be problems with differences in brightness depending on how many LEDs are on. The amount of current flowing in each pin and several LED sinking/sourced by a single resistor sort of thing. As the number of LEDs increase the problem gets worse.

May I suggest that you can do it, but it is not very useful?

3v0
 
It is very useful if you need status indicators and have limited I/O and budget for some equipment. I have seen really good VU indicators using charlieplexing for instance.
 
Gordz is right...very useful when you have only a few spare IO pins and just want to do some indicators. For example you might only have three pins available (or three wires left on a cable) but with these you can light up 6 LEDs.
To make several indicators appear at a time, you can quickly run through them taking advantage of the persistance of vision effect.

My instructable:
Charlieplexing LEDs- The theory

Has the basics, and if you have the time and patience you can wade through the comments where MikeK8LH showed me the light about being able to illuminate (n-1) LEDs at once.

Phil
 
PICs generally source/sink 25ma per pin. So the current through each LED will be 25ma/n when you light n-1 at once.

The solution is to switch the leds fast enough such that they appear to stay on. In JPUG 1 there is an article that shows how to do this in C using interrupts that allows the display to stay on while running other code.
 
Last edited:
Here is a good explanation to Charlieplexing.I learned many things from it.
One of our Charlieplexing guru (K8LH) also there in that discussion.
 

Attachments

  • Charlieplexing-LEDs--The-theory.pdf
    410.3 KB · Views: 4,182
Wow, a 4 year old thread. Guess you didn't notice the text that warned how old this thread is.

Mike.
 
Wow, a 4 year old thread. Guess you didn't notice the text that warned how old this thread is.

Mike.
Does that make my input any less valid or something? The most charlieplexing I have done is 144 LEDs, with 20 appearing to be on at any one time. This is very doable and a huge advantage over a normal matrix.
 
A 12 x 12 matrix uses 24 outputs to address 144 LEDs. A 12 x 13 Charlieplex uses just 13 outputs to address 144 LEDs, with 12 more combinations to spare. One can use an 18 pin device rather than a 40 pin device, so there is an advantage in both cost and real estate.
 
Here is a small clock I have designed using 72 charlieplexed 0805 LEDs. The board is 5cm x 5cm and is a one chip solution on a standard 18 pin DIP PIC. It would be hard to make a clock this small using a conventional matrix. You'd need a 9x8, 17 pins. I actually use 12 pins rather than the possible 9 charlieplexed outputs. The reason is I need fewer bus lines around the clock - essentially it's mirrored in two halves and simplifies the PCB layout.

View attachment 65044

The visual effect is the same as the clock I made using 10mm LEDs. The concept is that 'Minutes turn into hours'. So the lights always appear to stream out of the minutes LED and disappear in either direction into the hours LED. The seconds LED marches around relentlessly on its own. Thus you have a kinetic representation of the time, with the pattern changing every minute. Just before the hour all the LEDs appear to spin one way. After the hour they appear to reverse.

 
Last edited by a moderator:
My site is more a showcase for my own creations than a place where I actually sell clocks. People ask me for the chips and circuits a lot, so I sell them. I very rarely sell a built clock, people don't seem to want to pay what it takes for a hand-made limited edition item. The ready-built pinball display clocks sell now and again.

I will concentrate on supplying the hobby market more in future and I am gearing up to support that in the form of complete kits.
 
Well I think those are absolutely excellent Charlieplexed matrix applications. Since you're only lighting a set number of LEDs at any given time you can increase duty cycle, average current, and brightness dramatically simply by using a carefully designed driver. Nicely done.

Cheerful regards, Mike
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top