Offset Timing for PWM on Two Channel LED's

In a nutshell:
I want to build a dimmable two channel LED fixture using PWM to alternate the pulses of the individual channels in addition to dimming them. I would also like to have the PWM signal dimming created as a response to a 0 to 10 output of a Neptune Apex aquarium controller. That is where the Arduino may be a good match for the project. I added background and detail to describe why I want this functionality for those that are curios but I hope that it is not necessary to read.

Please help me in this planning phase.

Background and detail:
I want to build a custom LED fixture for a one sided, horizontal, dump style Algal Turf Scrubber. I will need to cover a 45 inch by 6 inch area and be very close to the algae tray. I believe that I need about 60 watts of LED light for my screen.

What I can find out from charts, papers and current best practices, the following is my idea of a dream fixture.

After playing with the layout on computer aided design, I think that I could employ 7 lamps using custom ordered 10watt COB chipsets, each with two channels that are strung together. An output ratio of 8 to 1, red to hyper-violet, that is 660nm (red) and 420nm (hyper-violet) respectively, yields the best algal growth in scrubbers. These lamps would have standard reflectors. Added center pyramid shaped pre-reflectors can redirect the light that is just under the chip which could be too intense and create hot spots.

Additionally, the variability of PWM dimming can be a very valuable feature in both quick starting the scrubber and for obtaining maximum growth output. In short high frequency flashing along with its accompanying dark periods, allows algal cells to process more total light than if it were constant. Being able to separate the timing of the flashes of the different colors, one after the other, allows even better processing of more total light.

If I had two tunable channels, I could use a low amount of light during the startup phase and increase the output as the screen becomes more mature. At that point, I could farther tune the ratio of light spectrum to find the best blend to maximize the harvesting.

The dimming feature could be used to bring the LED’s online in such a way that the photosynthesis in the algae compensates for that of the corals in the display tank at night. This would help minimize, if not regulate pH swings in the water column.

Finally, I want to control the fixture with a Neptune Apex Aquarium controller. Its output for this type of lighting is 0 to 10 volts so I think that I will need something like an Arduino mini-controller to read the analog output and create the PWM signal accordingly.

Now, this may sound like a lot of feature overkill for a simple algae scrubber but if I can implement this, it would be a prototypical project that might inform my reef tank lighting system build with more channels and focusing where intensity, spectral balance and quality is more critical. While the spectral blend is quite different for corals, the flashing is reported to be even more important for them to reduce the likelihood of bleaching.

All that being said, how can I do what is in the first two lines of the nutshell?

Is this what you're looking for?


Interesting project!

What frequency of pwm is best for algal growth?

How will the 8:1 ratio of red: HV be achieved? By selecting numbers of leds, current or pwm?

The 0-10V input is easy. Just use a voltage divider with, for example, 3K3 on one side and 6K7 on the other. This will halve the voltage.

Getting the light colours to alternate might be trickier. Think the standard Arduino pwm outputs are synchronised, ie on at the same time. Might have to use some logic gates, or do the whole thing in code.

The following are excerpts from several studies ranging from leaves, micro and macro algae to corals:

LEDs can also be pulsed in the microsecond range.

10, 20, and 50 kHz

light/dark cycles ranging from 5 to 100 Hz at a light-dark ratio of 0.1 and a flash intensity of 1000 µmol m−2 s−1

Flashing Light
A frequency modulator, based on a LM555C timing
chip and IRF640 MOSFET was constructed in order to
generate pulse power for the flashing light as described
earlier [16]. The device provided the frequency range in
1-100 kHz. At the selected frequency, the device could
provide the duty cycle of 10-50%. The duty cycle was
achieved by a combination of a timing chip and a
MOSFET. The average light intensity of the flashing
light was equal to that of the control continuous light
in order to deliver the same number of photons into the
cultures in the same experimental set.
The frequency and duty cycle of the flashing light
were measured by a digital oscilloscope (model HP54512B,
Hewlett Packard, Colorado Springs, CO, USA).

At these frequencies,
flashing times were very short (tf = 2-50 μs), which was
corresponding to the time constant of light adsorption
in photosynthesis

Even at 5 Hz flashing, the rate of linear electron transport during the flash was still 2.5 times higher than during maximal growth under continuous light, suggesting storage of reducing equivalents during the flash which are available during the dark period

“How will the 8:1 ratio of red: HV be achieved? By selecting numbers of leds, current or pwm?

As to getting the ratio that I want I can order the COB chips with the color ratio that that is close to what I want. If there are 100 phosphors then I believe that I can ask for 12 or the hyper-violet and 88 of the red which will get me very close. On the other hand, if there are only 10 phosphors then I would have to ask for 2 and 8.

Then I would have to further tune the channel to get what I want. I might want to ask for 15 and 85 to give myself some room to experiment.

I might also ask for 20 watt chips for a total of 120 watts so that I could over expose the cells for a shorter time. I could simply add more and more exposure until I reach photo saturation or photo-inhibition. This would be determined by measuring harvest output.

Unfortunately, there aren’t any hard and fast rules here. The first papers on flashing were published in 1905 and they used a spinning wheel with a hole in it like an old mechanical disco strobe.

“The 0-10V input is easy. Just use a voltage divider with, for example, 3K3 on one side and 6K7 on the other. This will halve the voltage.”

“Is this what you're looking for?


Thank you both for your input. I originally thought about placing this topic in the Project Guidance section because I don’t know much about electronics. I may have to go off and do some reading to understand some of this stuff.

Sorry, that voltage divider should be 4K7 on one side and 4K7 on the other! That would reduce a 0-10V signal down to 0-5V.

…voltage divider should be 4K7 on one side and 4K7 on the other! That would reduce a 0-10V signal down to 0-5V.

Is this what you're looking for?


I built a 2 axis robot and a controlled power bar to turn on pumps and lights but didn’t really need to get down in the electronic weeds. So ….If I buy this stuff and do some work, an electronics newbie like me should be able to get this done successfully?

Well, the forum members can probably help getting the electronics & code working. I don't know if any are experts on algal growth!

Your first step should probably be to draw up an electronic schematic, just as you have started the mechanical design with a diagram. Hand drawn on paper is OK, but if you want, there are at least a couple of free apps you could start learning to use. CadSoft Eagle has a good reputation here but is a little daunting for beginners. Less well liked is Fritzing, but that is only because so many newbies use it incorrectly. They post "breadboard view" pictures from Fritzing, but Fritzing does have a proper schematic editor too.

Make sure you can get (affordable) LED drivers for the LEDs you want to buy.
LEDs and LED drivers have to be matched (voltage/current).
It might be better to use two 10watt LEDs than one 20watt LED.

Single 3watt LEDs on a star base might a better option.
Then you can make the string length to suit.
24volt open frame supply (affordable), six (or seven) 3watt LEDs per string, and the 6-channel version of the board I linked to. That could give you 6 channels * 6 (or 7) LEDs * 3watt = 108watt (or 126watt).

I have been busy but thinking how I would convey my thoughts on laying out what I want in a PWM controller using a pseudo schematic. I keep coming up very short because I don’t know enough.

I don’t know much about optimal algal growth other than what I have read in papers and they may be misleading …or I may have just missed the point altogether. There really isn’t any real consensus on lighting because this is a young field of study.The LED market is just getting mature enough to lower costs while increasing acceptable offerings that surpass other forms of light output.

I want to try it and experiment for myself.

I want to be able to offset the firing so that the pulses happen at different parts of the cycle and to change the pulse width which will affect the appearance of brightness (black arrows). Additionally, being able to arrange the beginning of the individual pulses could be beneficial as more information about optimal rest time becomes available (gray arrows). This could also be valuable if more and more channels were add to later versions of this project. A multi-channel version might be used over a coral tank.

Hopefully, changing brightness with a fixed offset timing is low enough hanging fruit to actually be accomplished.

Your Fritzing picture shows mains powered constant current drivers.
Do you think they can be PWM-ed/dimmed by an Arduino?

You have your LEDs connected in parallel in your diagram. Never do this - connect them in series only.

When you're selecting your LED driver make sure you look for one rated with an amp (or milliamp) rating equal to your LEDs and then make sure it outputs a voltage approximately equal to the total Vf of your LEDs. With LED drivers powered by AC current make sure they explicitly state that they can be dimmed and that they have a connection for a "dim" input -- inexpensive AC drivers typically cannot be dimmed.

Be aware that any LED driver is going to have its own "internal" PWM frequency for the current that it provides the LED. That frequency will typically be in the 100KHz to 1 MHz range. Putting that another way, while the driver's input control might allow pulsing in the 50KHz range it's still pulsing the current to the LED at a much higher frequency in the backend. I don't want to be overly picky about a technicality here but your project seems to be based on that kind of technicality.