0-10V PWM (2 Solution)

Hi friends, how are you? Hope, you fine.

I will make an aquarium light system. I use power leds and Meanwell LCM25 Driver. So this driver wants 0-10V PWM signal. But our Arduino has an 0-5V PWM Signal.

I found some solution for this purpose. First one:

1 CNY75 optocoupler and BD137. I purchase these materials, but it didn't work as I want. If I set PWM 0, Output is 3.6-4V. If PWM is 1, output is 6V. If PWM is 2, output 9V etc.

I want to use Optocoupler for its isolation. I don't want to destroy my Arduino.

Second one, Mike's solution:

*) Is this solution is safe to use like optocoupler circuit?

*) I have some BC547 and BC557. But this circuit has BC183. Can I use BC547 instead of BC183?

*) I have 560 Ohm, but didn't have 680 Ohm and didn't find it. Can I use this resistor for this solution?

Thanks for your help.

The second circuit is safe, as far as an Arduino is concerned. You shouldn't need the 680 ohm resistor or the 1uF capacitor, either. The LCM25 is designed to take a normal PWM signal between Dim- and Dim+. Nothing is mentioned in the datasheet about the input resistance between the "Dim" inputs, but it could probably be done with a BC547. (A BC547 has the same collector current rating as a BC183 - 100mA.)
The problem might be your 12V supply. The recommended PWM signal for that unit is 10V as you mentioned, and not 12V. A crude way to limit the voltage would be 3 x 1N400x diodes,(or a single LED with a Vf of about 2V), with the "Dim+" output being taken from the bottom of the diodes/LED, (and "Dim-" from the transistor's emitter/ground, of course).

You need to be aware that as the transistor inverts the PWM signal, then the duty cycle will be changed.

For instance if you apply a 20% duty cycle input, then the output will be 80% duty cycle.

You can easily correct for this in your software.

JohnLincoln:
You need to be aware that as the transistor inverts the PWM signal, then the duty cycle will be changed.

For instance if you apply a 20% duty cycle input, then the output will be 80% duty cycle.

You can easily correct for this in your software.

Good point John. I didn't think to mention that.

Thanks OldSteve and JohnLincoln. I have one more question.

I made this circuit, and I see 0-12V PWM. This is good. Problem:

When I set PWM to 255, at first, output is 12V then 0Volt. One more example, when I set 245, at first Output is 12Volt, then Voltage reduces.

Every PWM set, at first voltage peak to 12V, then reduces correct level. So my Power Led system flashed to max level at first, and then reduces brightness.

How can I prevent this issue?

kursatufuk:
I found some solution for this purpose. First one:

1 CNY75 optocoupler and BD137. I purchase these materials, but it didn't work as I want. If I set PWM 0, Output is 3.6-4V. If PWM is 1, output is 6V. If PWM is 2, output 9V etc.

This will conform to your expectation (where the output is full on when PWM is 255):

My "suggested" lower resistance values there are, maybe, a little too low. 5K.

Hi Runaway Pancake,

I made your circuit. But when I set PWM to 0, output is 3.4V.

PWM=10 output=6V

PWM=20 output= 6,4V

PWM=30 outpu=6,7V

PWM=100 output=9,12V

PWM=200 output=11,80V

PWM=255 output=12,4V

(I used 4.7k Ohm. )

Did you wire the input as my circuit shows, with the CNY and resistor between +5 and Pin9 ?
My redrawn circuit is like yours in that the load (shown as a fan) is between +12 and the collector.
When you refer to "output voltage", where are you measuring?
A) Across the fan
or
B) across the transistor (V_ce)?

Thanks for your reply Runaway Pancake.

Yes I wired like yours and I measured the Output Voltage, between +12V and BD137 Collector.

Disconnect the CNY from Pin9
Connect the CNY cathode to Ground and measure the output voltage.
Vout = ____ ?
Then Connect the CNY cathode to +5 and measure the output voltage.
Vout = ____ ?

The idea is to switch the CNY between Ground (case1) and +% (case2)

Voltage is going up as PWM goes up [good], but doesn't go to 0 [not so good.]
So, is the phototransistor under-driven?
Try a lower value on the CNY (550 ohms change to 220 ohms).
When Pin9 is LOW, the IRED is full on, so then the phototransistor should be on, taking the base to ground, turning the output transistor off. And vice versa.

Both of them, 12.4V.

I use 220ohm instead off 550ohm but again doesn't work :slight_smile:

kursatufuk:
Both of them, 12.4V.

Not possible.
You said before that with PWM 0 (mostly at Gnd) the output was 3V and with PWM 255 (mostly +5) the output was 12V.
Can you substitute an LED and a 1k resistor for the load (don't use the meanwell, in other words) for experimentation?
I could propose an emitter follower version of the circuit, in case one end of the meanwell is supposed to be ground referenced, but the disparity in results (Reply6 vs Reply12) leaves me concerned.

It would be interesting to know the output transistor base voltage, too.
PWM value, V_b, "output voltage". (In other words: Take Data.)

Thanks for your help Runaway Pancake.

PWM 0, V_b = 12.4 Output= 3,4

PWM= 100 V_b=12,1V Output=9,1V

PWM=200, V_b=11,9V Output=11,8V

PWM=255, V_b=11,8V Output=12,4V

You might be overthinking this.
It seems the dimmer has an inbuild pullup to an internal supply.
Because when you leave the Dim pin "open", LED current is max.
Try an opto.
Opto transistor across the Dim+/- pins.
And opto LED via a 1k current limiting resistor to Arduino.
Leo..

1 Like

Hi Wawa thanks but some question marks...

Where will I connect the 12V DC?

If my first post's second circuit is safe, I can use it. (I don't want to destroy my Arduino board) It works, I see 0-12V PWM. But it has a peak problem.

kursatufuk:
Hi Wawa thanks but some question marks...

Where will I connect the 12V DC?

You don't.
The LED driver already provides that voltage.

You don't have to convert Arduino PWM to voltage, and feed a voltage into the LED driver.
Just leave it as PWM.

Just try.
Connect the opto transistor collector to Dim+, and the opto transistor emitter to Dim-.
Opto LED cathode to Arduino ground, and opto anode via a 1k current limiting resistor to an Arduino PWM pin.
Draw a diagram, and post if for approval if you're not sure.

The IDE has some LED fade examples.
Leo..

2 Likes

Wawa:
You don't.
The LED driver already provides that voltage.

You don't have to convert Arduino PWM to voltage, and feed a voltage into the LED driver.
Just leave it as PWM.

Just try.
Connect the opto transistor collector to Dim+, and the opto transistor emitter to Dim-.
Opto LED cathode to Arduino ground, and opto anode via a 1k current limiting resistor to an Arduino PWM pin.
Draw a diagram, and post if for approval if you're not sure.

The IDE has some LED fade examples.
Leo..

Wawa, you you you you you are my hero.

Now my PWM is 0-10V really? Is this simple like this? Wow...

Edit: I control with Voltmeter, between Opto Emiter and Collector. 0-8V. This is good. But why not 0-10V?

Ok ok, I tested the Power Led's brightness (First Opto Dim with full PWM, then without dim) and these two brightness was same. Opto provide 0-10V PWM. Yeah, many many thanks Wawa.