I try to build a converter to take the arduino PWM output to a normalized 0-10V signal.
I read some topic already but most was talking about driving something not using it as a control signal.
So I tried to develop a concept: I've got the idea to take an optocoupler to rise the PWM signal to 10V then, put a RC filter.
-for that I use this caculator: RC filter calculator
now that what's it look like by now:
Now my question; am I in the good way? I did not made a lot of calculation, try to chose component that seem suit. but my electronic is pretty basic.
The last thing a should mention is that the device connected to the output should be hi impedance so not much current expected.
So if someone got some time to take a look, I'll appreciate it.
is that the device connected to the output should be hi impedance so not much current expected.
I think that answers Wawa's problem.
Circuit is OK ish but You don't need D5 and D6. Also most optos do not expose the base connection and those that do can be left unconnected.
How much ripple voltage can you stand? How fast do you want the output voltage to change?
These factors determin the sort of filter, and the component values.
For D5 I agree. I can remove it. but for D6, I prefer to keep it for protection cause the load I could use
are powered at 24V AC so if there is any connection mistake.. I don't know how I can do otherwise.
( @Leo, It is for the same reason that I made it opto isolated to...)
For the time repose, is to use with actuator as damper or bald valve or with drive modulation so it should be very smooth, as 0.1 even 1 sec response.
for the base expose, I read that It was to filter or pre-saturate the opto ? ... or something like that. I just copy an example from a optocoupler tutorial. I chose a model with the base for that reason. but if you tell me that is useless, I will remove it.. ( less part, less cost, less problem, more board space....)
I was trying to do this a few years ago and was sent the attached JPG by a forum member. I was feeding it into a 0-10 volt input to control on a variable speed drive on a large pump. I have used it many times since without problems.
For my setup I used the following:
V1 = the 12 volt supply to my arduino board
The PWM pin of the arduino connects to R1 (the plus terminal of V2). Remember to connect grounds together.
The Op amp that I use is a LM358 but there are 'rail to rail' Op-amps such as the TLV2370 series from TI that can go virtually right down to zero volts or right up to the supply voltage. The LM358 tops out at about 10.5 volts from a 12 volt rail (enough for your use) and down to about .25 volts (from memory).
The R2/R4 voltage divider I replaced with a 50 kilohm 25 turn trimmer so that I can finely tune the output voltage range to anywhere between the upper and lower limits above.
The standard way to convert your 5v pwm to 10v pwm is using a non inverting opamp circuit. For this case, with a gain of 2. The op amp power supply is 12V.
you can omit R18 in the above diagram. The two 4.7k resistors will give you a gain of 2.
If you want an analog 0-10v signal at the output, then you apply your RC filter there. But FWIW, from applications I have used, circuits that accept analog will accept the PWM signal and worked fine without an RC filter.
Maybe if you said what the load was it would make sense.
Sometime it is 3 wire 24V/ac actuator, so red 24+, black common and white signal 0-10V.
It is pretty common in control and industrial.
I'm no sure myself is the diode can or not protect correctly or even a bit. If you've got a good idea to suggest I'm open to suggestion.
@doughboy, Yes a tough to use an op amp to but I found 2 advantage to use an opto-coupler:
-one, like I said, device connected are powered at 24V and by and different power supply, so I like the idea to be electronically isolated from the arduino part.
-two, using and op amp will request an other gain of the amp to operate at 3.3V PWM output like arduino DUE (that I use). So with an opto-coupler, I think it will make no difference.
Another thing that bugging me: now I use a 10V regulator but is the output of the opto-coupler will make a 0.7V drop that will limit the output to 9.3V ???
Sometime it is 3 wire 24V/ac actuator, so red 24+, black common and white signal 0-10V.
That doesn't square with what you said before:-
The last thing a should mention is that the device connected to the output should be hi impedance so not much current expected.
It is pretty common in control and industrial.
Yes but you are not in Kansas any more Toto, it is not at all common here. Can you provide a link to one please.
Another thing that bugging me: now I use a 10V regulator but is the output of the opto-coupler will make a 0.7V drop that will limit the output to 9.3V
Not quite that 0.7V will be at the low level, so the PWM signal will go from 0.7V to 10V. This is not normally an issue as it is a PWM signal we are talking about, not an analogue one, and normally 0.7V is not enough for the receiving circuit to recognise it as a logic one. So it will still see a 10V logic level signal.
nitrof:
-two, using and op amp will request an other gain of the amp to operate at 3.3V PWM output like arduino DUE (that I use). So with an opto-coupler, I think it will make no difference.
just for general info, I know your mind is already made up using opto coupler.
In the op amp circuit diagram, if you remove R14 and use a 10k trimmer for R18, you have a continuously adjustable PWM output between 3.3v and 10v.
That is how I use the circuit on a teensy, which has 3.3v pwm output. and user can adjust the trimmer to suite whatever pwm voltage they need.
Are you controlling LEDs?
I connect 3.3v pwm to control Meanwell LDD drivers running at 48v.
ok. I do not see any further spec other than saying 2-10v dc input for control.
Since this requires analog input, feeding PWM signal (without RC filter) should work.
I think the op amp circuit will work just fine for this application. This is fairly common usage to control LED and speed controllable DC motors. I have not seen an application using opto coupler, though I suppose it is possible.
10k and 4.7k will get you close to 10v pwm using 3.3v input.
yes.. the op amp have the advantage to be calibrate...
I'll maybe do some test with the opto-coupler but if it's not concluent.... I'll will use your shematic.