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.

charlieplexing - brightness

Status
Not open for further replies.

tresca

Member
Hey
How can one determine the brightness of an led when charlieplexing.

Im looking at charlieplexing anywhere from 30-50 leds. Im going to be using a pic micro.
Lets assume that each pin can source/sink 20mA. And the pic has an xtal of 20Mhz so the clock is really at 5Mhz.

How long would the led be on, in order to receive max brightness ?

Any thoughts ? I'd rather not do it trial and error, and if i can get an idea or a start, it can help reduce trial and error time.
 
To receive maximum brightness, the LED has to be on 100% of the time, if it's only on 50% of the time then the average radiant power will be halved but because the eye's response is logarithmic, it'll appear about 75% as bright.
 
interesting...so.. having a 50% duty cycle causes only a 25% drop in brightness ?
thats pretty cool. You've given me a start and where i need to read up on a bit...

i think ill start by googlin 'how does vision work'...:p
 
I remember a site that went into great detail and a lot of math about charlieplexing a lot of LEDs, will post a link if I find it again. It was for AVR though, so might not be a huge help. I think it was related to those cubes people were building a year or so ago. I don't get the 20 Mhz crystal only being 5 Mhz on a PIC. 20 Mhz on an AVR, is 20 Mhz. There is a fuse you can set to divide by 8. Maybe PIC has something like that... Don't really know much about PIC, I just look at how other stuff is hooked up to them.
 
Everything that has been said is true. But getting MAX brightness out of 30-50 charlieplexed leds is not possible.

The number of lines N needed is #leds = N(N-1)

For 30 leds you need six lines because 30=6*5.

With the way charlieplexing works you can think of 30 leds as 6 banks of 5.
Each bank will be on at most 1/6 of the time.
But it is worse because the LEDs in each bank are selected sequentialy.

I attached a worksheet with 20 LEDs. If you look at the schematic you can see how the LEDs are arranged and why you can not get MAX brightness.

My suggestion is that you take a look at the 74HC595 shift register or one of the nice chips from Micrel, TI, etc designed to drive LEDs. Some of these are constant current drivers which lets you run the LEDs without limit resistors.

3v0
 

Attachments

  • charlieplex20.pdf
    20.6 KB · Views: 307
With the way charlieplexing works you can think of 30 leds as 6 banks of 5.
Each bank will be on at most 1/6 of the time.
But it is worse because the LEDs in each bank are selected sequentialy.
3v0

I don't understand the blue part of your statement. With a bank of 5x6 LEDs each LED will be on for 1/6th of the time. However, LEDs can normally be pulsed at 2½ times their steady current and so in reality they receive nearly 50% of their maximum current. This is the same as any multiplexing routine except charlieplexing uses less I/O pins.

Mike.
 
I don't understand the blue part of your statement. With a bank of 5x6 LEDs each LED will be on for 1/6th of the time. However, LEDs can normally be pulsed at 2½ times their steady current and so in reality they receive nearly 50% of their maximum current. This is the same as any multiplexing routine except charlieplexing uses less I/O pins.

Mike.
We have been down this road earlier.

Maybe you can convince me I am wrong.

It depends on how you arrange the current limiting resistors. If one put a resistor on each LED or used LEDs with built in resistors one could light any combination of LEDs within the bank and have the same brightness. In this case what I am saying is bull, but these is still an issue about where the current come from.

If you sink or source several leds through a single PIC pin as charlieplexing does the current through each LED will be a fraction of what each pin can deliver. With a regular multiplexed display you can use a transistor to overcome this. With charlieplexing the current can flow either way. It is not so easy.

Most of the time only N resistors are used. As the number of illuminated LEDs increases the current through each LED goes down. Like using a single current limiting resistor with several LEDs. So you can only get uniform illumination if you light 1 LED at a time or sequential.

That is why I thing they should be used sequentialy within each bank.

-------------------------------

But going back to the math. Even with the 2 1/2 current overdrive a six bank display will not be full brightness.

(5/2)*(1/6) = 5/12 of less then half the current. With the visual log response as suggested by hero999 you may see 75% brightness.

Also the OP was talking 30-50 so 6 lines is only for the lowest case. To do a full 50 requires 8 lines.

----------------------------

If I am full of bull please let me know.

3v0
 
We have been down this road earlier.

Maybe you can convince me I am wrong.

3v0

I thought the same as you until Mike KLH8(?) convinced me otherwise.

Looking at the diagram you posted earlier, to light the left column of LEDs (except the top one) you make output zero high and the other outputs either hi z or low. With this arrangement each LED has it's own resistor even though there are only 5 individual resistors. You then repeat this for the other 4 outputs.

You can also add 5 NPN transistors - one to each line - C to 5V - B to I/O and E to LEDs. However, as you pointed out power has to flow both ways and so you have to move the resistor connections to the base of the transistors. I can draw it out later if your can't see it from my bad explanation.

With this arrangement you can get high current and equal brightness with a 20% duty cycle. Practically the same as normal multiplexing.

Mike.
 
Charlieplexing and multiplexing reduce the brightness of LEDs.
Your vision responds only to the average brightness that is very low since each LED is turned off most of the time.
 
I am looking at the data sheet for fairchild QTLP282-2.
It can handle a peak current of 3x the average current.
At 3x the current the light is 4x!
At 100% duty cycle current is 1x, light is 1x
At 33% duty cycle the current can be 3x, light 1.33 x (average).
At 25% duty cycle, current 3x light 1x (average).
12.5%, current 3x, light .5x
 
Your vision's response to brightness is logarithmic so you can see in sunshine and in starlight. 1 times or 1.33 times the brightness looks the same. 10 times the brightness looks twice as bright.
 
Your vision's response to brightness is logarithmic so you can see in sunshine and in starlight. 1 times or 1.33 times the brightness looks the same. 10 times the brightness looks twice as bright.

And so 1/10th the brightness would be half as bright. Perfect for multiplexing.:D

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top