2 x 100W LEDs to be "mixed" so the only use 100W power in total.

Im new to this scene, but have some ideas I need to try out, but I am stuck. Hence my first need of help.

I made a sketch (fritzing) how its connected and below is how I would like to get it to work:

I need to be able to change 2 values in the code, telling the Arduino how to "mix" the light of these to high power leds. Since I want to use PWM to do this but not exceed the 100W power of the led driver, I need to control how the leds are turned on and off in the PWM cycle.

Example: Led1 has a value of 70 and Led2 has a value of 30 (Together 100)

Now I would like to have Led1 on 70 percent of the time and Led2 the remaining 30 percent. This would be like 1 piece of 100W led at full power, just perfect for the LED power supply (designed for 1 x 100W LED).

I allready done it with the standard "blink" and it works great. The problem is that it is in the loop and I will have a lot of other tings there and that just rules out the "blink with delay" approach.

Just to be even more clear on what I am trying to solve, I want led1 ON at full power for 70% of the time/cycle and led2 OFF during this 70%. The remaining 30% of the time/cycle I want led2 ON at full power and led1 OFF.

Is this even possible, to do it the way I would like?

Hints and help are great, or if you are sure you can do this code neat and with the vaiables for how to mix, clearly visible (so I easily can change them myself) - Ill be happy to "donate" around 20 USD for a good working code, I can paypal the money (I hope I didnt offend or break any forum rules, if so let me know and I will delete inapropriate text)

Thanks in advance for any help :slight_smile:

mix_pwm_led_bb.jpg

and that just rules out the "blink with delay" approach.

Why?

Is this even possible, to do it the way I would like?

Here's a clue. -

Use 1 PWM output, and invert it externally for the 2nd device.
This guarantees that the 2 are in sync and only 1 is on at a time.

Why?
Answer: The blink is ruled out because during the delay function everything is paused. And since this has to be looped all the time, other code (before or after that small block) would end up disturbing the output and show as flicker from the light. At least thats how I thought it worked, and thats not a nice solution.

So, go with the blink without delay solution.
That really isn't worth 20 dollars.

Warning - while you were reading 3 new replies have been posted. You may wish to review your post.
... What Crossroads said.

Use 1 PWM output, and invert it externally for the 2nd device.
This guarantees that the 2 are in sync and only 1 is on at a time.

Thats really a great idea, I will try it! Thanks!

If you don't want to have external hardware to invert it, you can use two PWM outputs, and as long as they are on the same timer, you can setup the arduino to invert one of them for you.

you can setup the arduino to invert one of them for you.

Or you can do it in C, with the clue I gave earlier.