Charlieplexing help

Hello everyone,

I need some help with a charlieplexing project in working on. I built a charlieplexed cube using regular rgb LEDs and they were powered directly through my arduino and it works flawlessly. I'm now building a second one except this time I'm using 12v LEDs and I know they can't be powered by the arduino but I don't know how to go about powering them using a external/separate power supply. Can anyone point me in the right direction?

Thanks.

Hi. Sounds tricky!

Reason is, charlieplexing, as you know, makes use of the fact that the Arduino pins can be in one of 3 states (HIGH, LOW, INPUT=HIGH-Z).

To drive 12V leds (never heard of those by the way, except strips) from an Arduino output, you need a pair of transistors, one to act as the high-side switch and the other to act as a low-side switch. The difficult part is getting those high and low side switches to switch on/off correctly, particularly when the Arduino output goes high-z.

Even if you can get that to work, you now have a pair of transistors attached to each Arduino output, and an rgb cube is going to need a lot of outputs (15?). This means you kind-of loose the advantage and simplicity of charlieplexing. In which case you might as well do it without charlieplexing.

If/when I get around to building an rgb cube, I think I will use ws2812b leds. This will make the wiring simple and allow colour fading & mixing. Paul

Indeed - once you attempt to buffer and level-shift a tri-state output, you lose all the advantages of Charlieplexing.

You have also committed a cardinal mistake in asking questions here. :astonished:

"Using 12v LEDs" is absolutely meaningless. If you want suggestions, specify what these are, give a link to them on a website, and if necessary, a link to a datasheet. :grinning:

Paul__B: Indeed - once you attempt to buffer and level-shift a tri-state output, you lose all the advantages of Charlieplexing.

You have also committed a cardinal mistake in asking questions here. :astonished:

"Using 12v LEDs" is absolutely meaningless. If you want suggestions, specify what these are, give a link to them on a website, and if necessary, a link to a datasheet. :grinning:

Thank you for replying but maybe in the future I would suggest replying to a post only if you have something positive to contribute. Your opinion on losing the advantage of charlieplexing in this case is irrelevant and not helpful in the least. Just as irrelevant is your comment about using 12v LEDs is "absolutely meaningless ". The fact is the LEDs run on 12v so what difference is a data sheet going to make. I could understand your "request" if I was asking if the power supply I was using would be sufficient to power the LEDs but I'm not. If you can't help answering a question maybe think twice before hitting that reply button and offering a opinion with smiley faces and all. Now I'm sure I'll get some heated response from you but remember this is a forum people go on to for help with something they are working on and not for irrelevant opinions.

Well, it seems you have guaranteed that not only will you not receive further help from me - because you are unable to comprehend the accurate advice I have given - but from no-one else either and for the same reason!

Paul__B: Well, it seems you have guaranteed that not only will you not receive further help from me - because you are unable to comprehend the accurate advice I have given - but from no-one else either and for the same reason!

Wow, you sure do think a lot about yourself. Especially considering that you gave absolutely no advice whatsoever other than your opinion which funnily enough wasn't asked for. You might also consider refraining from speaking on other people's behalf because not everyone is conceited like yourself.

In closing I would like to say again seeing as you didn't get it in my first reply that these forums are here so that people can get help with things they are working on and if you're unable to contribute in a positive and helpful way then don't reply to people's posts. If you feel the need to bestow your non requested opinion may I suggest you join a forum like TMZ or entertainment tonight.

Methinks this is very much the pot calling the kettle black!

But I am open to others' thoughts. :grinning:

Paul__B gave some good points. If you didn't understand comments maybe you could have asked what was meant. Attacking the way one expresses oneself doesn't gain you any points in the eyes of others. Some people are curt others are not. If you only want advice that makes you happy, maybe stick with reading books.

We all are volunteers here, you have the choice to not read or ignore the advice of others.

LarryD: Paul__B gave some good points. If you didn't understand comments maybe you could have asked what was meant. Attacking the way one expresses oneself doesn't gain you any points in the eyes of others. Some people are curt others are not. If you only want advice that makes you happy, maybe stick with reading books.

We all are volunteers here, you have the choice to not read or ignore the advice of others.

Actually the first reply I got was from PaulRB not Paul_B which was helpful. The opinion from Paul_B was not of any help whatsoever. I understand that everyone on here are volunteers and that's what makes these types of forums great but time and time again it seems that a person will come across these people that will criticize one and offer no help whatsoever as in this case. Yes I am looking for advice that makes me happy, happy as in helping me solve a problem which is what these forums are for.

Paul__B: Methinks this is very much the pot calling the kettle black!

But I am open to others' thoughts. :grinning:

Really, that's your best response? Seeing as your are unable to give any actual advice may I suggest you move on and troll somewhere else with your "opinions".

PaulRB: Hi. Sounds tricky!

Reason is, charlieplexing, as you know, makes use of the fact that the Arduino pins can be in one of 3 states (HIGH, LOW, INPUT=HIGH-Z).

To drive 12V leds (never heard of those by the way, except strips) from an Arduino output, you need a pair of transistors, one to act as the high-side switch and the other to act as a low-side switch. The difficult part is getting those high and low side switches to switch on/off correctly, particularly when the Arduino output goes high-z.

Even if you can get that to work, you now have a pair of transistors attached to each Arduino output, and an rgb cube is going to need a lot of outputs (15?). This means you kind-of loose the advantage and simplicity of charlieplexing. In which case you might as well do it without charlieplexing.

If/when I get around to building an rgb cube, I think I will use ws2812b leds. This will make the wiring simple and allow colour fading & mixing. Paul

Thanks for the info Paul. I think I'll look into doing it with addressable LEDs on the next one I build but for now I'm going to try the transistor route as I have my cube pretty much constructed already and it's all part of learning how things work.

Well, let us know how you get on, it will be interesting to see how you crack the problem.

Can you share how you made the rgb charlieplexed cube? I have seen single colour 4x4x4 charlieplexed cubes, but not rgb ones. I can maybe think of a way to do that with 5V supply, you would just need some npn transistors to act as non-inverting high-side switches, but they would drop so much voltage that the blue leds might not even light.

To get around the problems of creating a 12V high current tri-state line, the only way i can think of would need 2 digital outputs to control each line (which themselves would not actually need to be tri-state, so ordinary logic outputs such as shift register outputs for example). The two outputs would control the high and low side transistors of the tri-state line. But as i said before, thats getting quite complicated, and might not have any benefits over other, non-charlieplexed solutions.

PaulRB: But as i said before, that's getting quite complicated, and might not have any benefits over other, non-charlieplexed solutions.

(at 1:20 :grinning: ) If you need to duplicate the drivers to Charlieplex, you run into a couple of problems. One is that you are using an "H-bridge"; you need to be very careful that you do not activate both high-side and low-side drivers simultaneously as they are controlled by different ports.

And you are losing "n" elements in the array as Charlieplexing limits you to n*(n-1) elements whereas by keeping the lines separate, you can have n*n.

Buffering a Charlieplexed display is relatively easy, and buffering only one direction in particular is very practical and allows you to use a separate power supply for the display - allowing that you lose 0.7V in each direction you buffer. It is level-shifting that becomes impractical without duplicating the driver ports (and then also needing two-transistor high-side drivers).

There is still one potential advantage to Charlieplexing as it will minimise the number of wires in your cabling between drivers and display. Not usually a concern for a small LED cube.

PaulRB: Well, let us know how you get on, it will be interesting to see how you crack the problem.

Can you share how you made the rgb charlieplexed cube? I have seen single colour 4x4x4 charlieplexed cubes, but not rgb ones. I can maybe think of a way to do that with 5V supply, you would just need some npn transistors to act as non-inverting high-side switches, but they would drop so much voltage that the blue leds might not even light.

To get around the problems of creating a 12V high current tri-state line, the only way i can think of would need 2 digital outputs to control each line (which themselves would not actually need to be tri-state, so ordinary logic outputs such as shift register outputs for example). The two outputs would control the high and low side transistors of the tri-state line. But as i said before, thats getting quite complicated, and might not have any benefits over other, non-charlieplexed solutions.

Hey Paul,

You will be surprised how simple a 4x4x4 rgb cube is and there is no need for transistors all you need are the LEDs and your arduino. It's all explained here: http://aglick.com/charliecube.html I built it and it works flawlessly.

As far as my current project goes, I think I have found a possible easy solution in the way of a voltage booster that will take the 5v out from the arduino and boost it to 12v thereby powering the LEDs. The only thing I'm not sure about is the return/ground line and if/how it would affect the arduino. If that works then the only downside to me is the fact that I'd need 16 of these boosters. One for each output.

Paul__B: (at 1:20 :grinning: ) If you need to duplicate the drivers to Charlieplex, you run into a couple of problems. One is that you are using an "H-bridge"; you need to be very careful that you do not activate both high-side and low-side drivers simultaneously as they are controlled by different ports.

And you are losing "n" elements in the array as Charlieplexing limits you to n*(n-1) elements whereas by keeping the lines separate, you can have n*n.

Buffering a Charlieplexed display is relatively easy, and buffering only one direction in particular is very practical and allows you to use a separate power supply for the display - allowing that you lose 0.7V in each direction you buffer. It is level-shifting that becomes impractical without duplicating the driver ports (and then also needing two-transistor high-side drivers).

There is still one potential advantage to Charlieplexing as it will minimise the number of wires in your cabling between drivers and display. Not usually a concern for a small LED cube.

I am stunned Paul__B. I apologize and take back all I have said. I would like you to know that I'm not a ungrateful a..hole but I belong to several forums from electronics to cars to adrenaline sports and so on. Basically the things that interest me. I have noticed that there are these people on all these forums (not just this one) that do nothing but give their opinions or are critical of a persons post. Having said that, giving your opinion in a helpful way is what I consider advice. Advice is always welcome.

I hope you understand where I'm coming from. These trolls that go around the forums offering nothing positive is one of my biggest pet peeves and drives me nuts.

Now, as far as your advise goes, I don't understand what you mean by buffering the charlieplex. What exactly does that involve? Ive only been dabbling with the arduino and electronics for about 2 months now so I'm still really green at this and learning the ins and outs.

After doing a little research, I thought of using a voltage booster on each output to boost the output from 5v to 12v. What do you think about that?

Nice!

Charlieplex takes advantage of 3 possible states, 0v, 5v and Hi Z.
To create a buffer that just attaches to the Arduino and makes 0v, 12v and HiZ becomes very complex and requires more than the original number of pins in regular Arduino charlieplexing.

“Buffering” means nothing more nor less than providing more current (or in fact, more voltage as well).

It is what you wanted to do in the first place. The Arduino can only source - or sink - something between 20 and 30 mA per pin (given an absolute maximum specified at 40 mA) and even then, not all at once. For a little 4 by 4 by 4 cube (192 LEDs) you can just get away with it if you do not demand too much current.

The next step is to use emitter followers on the anodes which you are using as the “commons” to perform the strobing (I seem to have written the same just recently!) which has the advantage that the collectors go to your unregulated supply voltage and the current is not drawn from the Arduino, while the cathodes go to the current controlling resistors and you can have up to 30 mA sinking from each (as long as the total is allowable to the microcontroller chip) whilst (only) one anode group after the other is held high.

But the emitter follower can only pull as high as the Arduino can drive it, less the 0.7V VEB drop of the transistor. The reason why you can not simply “boost” it is that in order to effect the “Charlieplexing”, the control pin must be allowed to float or be pulled down without interference.

Now as I consider that, it actually is possible to “boost” it - you would need an NPN transistor with a base resistor to the control pin and the emitter held precisely at some 3.5V, which in turn would via a base resistor drive a PNP transistor whose emitter was the 12V supply and its collector driving the LED strip anode. The only limitation here would be that the LED strip when not being lit but pulled up to 12V, must absolutely not pull its cathode higher than 3.5V; it must have a hard threshold voltage of at least 8.5V and the 12V supply must be closely regulated.

At this point, it should become clear why the exact specifications of your “12v LEDs” always were a critical part of the question. :grinning: All the more so as the threshold voltages are different for different colours.

Next, this still only allows the 30 mA single and whatever the total sink rating is of the Arduino. If you want to drive higher current to a number of cathodes, you might want a buffer circuit on the negative side - which would essentially be the opposite (polarity) of the above.

Well thank you for the explanation Paul. I think im going with the buffering on the negative side however it might be a while till I get around to attempting it as Ive ive been called away and so ill be heading out of town in the next few days and wont be back for at least 2 months but once im back and ready to go, ill touch base with you regarding a few other questions i have.

Thanks again and we will talk soon.