Single Circuit Crossfade with PWM and H-Bridge

Ladies and Gentlemen, some advice please.

I am trying to develop Arduino based Hardware/Software solution to the following problem: adjusting the brightness levels of 2 separate arrays of LEDs with the following parameters:

-all of the LEDs must share the same 2 bus conductors. -one group of LEDs will be wired with reverse polarity. -the LEDs must appear to be constantly on. -the brightness level of the 2 groups of LEDs must be adjustable, something like a "pause-able cross-fade"

any advise is greatly appreciated.


Well Charlieplexing will only work if you can set an output to a high impedance input. However why the curious wiring setup? And why a H-bridge? What sort of H-bridge and does it have an enable input.

If you could post the schematic perhaps we could see but the description as it stands doesn't make much sense.

Connect the LEDs antiparallel to the output of the bridge. Drive leg A with a 50% duty cycle square wave. Driving leg B with the same timed signal keeps both LEDs off. Now, delaying, say, the falling edge of B in respect to the falling edge of A, lits proportionally one LED. Respectively, delaying the rising edge of B in respect to the rising edge of edge of A, lits proportionally the other LED. At the extreme (full scale) the B pulse train is the inverted of A pulse train. Care for cross-conduction should be applied in the edge regions. Of course the maximum on time, and hence the maximum intensity, of each LED is 50% of the dc-driven case. Also the repetion frequency, control resolution and overall timing and workload must be worked out.


In what possible way does that address the needs originally stated in this post. What advantages does this method of LED control have over anything except putting your head in a bucket of Parana fish.

Advantages? I don't know. He asked, i was intrigued somehow, i submitted an idea. On the other hand, i think that all four requirements of the OP are covered. If he finds it practical/suitable/viable/affordable/... that's even better - and my paranas deserve a treat for the inspiration.


Thanks all for the info.

I ended up using 40 amp H-bridge that I had left over from another project. I replaced the old PWM driver with some charlieplexing code and my Arduino.

I had hoped to use an off-the-shelf motor controller for the H-Bridge, but I didn't want to spend the cash.

So, now i'm trying to find code for a cross PWM fade. Shouldnt be to far off.

thanks again

i submitted an idea.

Yes but it was a total rubbish idea.

So go on you show him the code to drive it.

some more rubbish …
(this is pseudo-code )

void setup() {
notyetA1000 = true;
//other things

void loop()
setpointled1 = getsetp(LED1); //returns <1000
setpointled2 = getsetp(LED2);

elapsed= micros()-periodmark;

if notyetA1000 == true { //within the first half period
if elapsed > 1000 {
notyetA1000 = false;
if elapsed > setpointled1 {

else {
if elapsed > 2000 {
notyetA1000 = true;
periodmark = micros()
if elapsed > setpointled2 + 1000 {

// do other things