Variable 0-10V from 0-5V

Hi guys, I have found in the old forum a guy that had the same problem as mine: control a device that is 0-10V controlled with the 0-5V from the Arduino. One of the users answered this solution, but was not sure about the resistors values :

Assuming my device needs 200mA and using a 2n2222 transistor (beta=300), I found that R1 needs to be of 8.3k Ohm. Now I am stuck for the value of R2. Can anyone give some help?

Thank you (and sorry if I made some spelling mistakes, english is my second language)

The normal Arduino’s do NOT have a 0-5V :wink: It’s PWM. Is you device fine with PWM?

If so, the schematic is kind of fine. Use something like 1k for R1 and you’re safe. BUT the circuit can only sink the 200mA, NOT source it. R2 is just to pull up the output but will limit the voltage.

If the device does need real 0-10V but no significant current (<1mA) you can just use a RC filter on the output of this circuit. Or a RC filter and an opamp circuit.

If the device does need real 0-10V and indeed 200mA, start looking for a proper heat sink…

As always, devil is in the details, WHAT do you want to drive?

It's a Electronic Proportional Control Unit (E908A001). And what do you mean by "real" 0-10V? That it will more likely output 1-9V?

Real as in not PWM ;) Like I said, ATmega based have no 0-5V (aka DAC) output although analogWrite() suggests it. analogWrite() is PWM (Google it ;)).

That E908A001 expects real 0-10V. It doesnn't specify the current but it's a control signal so it's probably low. Increase PWM frequency, add amplification (transistor like above or opamp etc) and a RC filter

I used 3kHz PWM, an opamp* with gain 2x and an RC filter (1k and 100nF if I recall correctly) on the input of the opamp.

Btw, it's a bit ironic. The E908A001 will translate the 0-10V to PWM again ::)

*Remember you need more supply voltage then the max desirable output voltage. The opamp can only reach like 90% (see datasheet) of it's supply voltage. Aka 12V supply if you want 10V out. OR you can use a rail-to-rail opamp.

TouchTheFishy: It's a Electronic Proportional Control Unit (E908A001).

Using 0-10V DAC will help you out to drive this unit easily with the help of Arduino with external power supply of 24V DC

I have used something similar to the following circuit for driving a 0-10v analogue input for speed control of variable frequency drives. I just use an lm358 op-amp (but most use a rail-to-rail type) and replace the R2/R4 combination with a trim pot. its accurate and works well in noisy environments.

29hieg.jpg

That first circuit is useless for this task. The valve requires an analog value between 0 and 10V.

Put an RC smoothing (lowpass) filter direct from the Arduino. Use at least 10k to swamp the difference in the Arduino output's source and sink impedance. That should give you 0 to 5V analog voltage from the Arduino's 0 to 100% PWM signal.

Put that in an Op Amp with a gain of 2, with a V+ of 12V and a V- of -2V or more.

TouchTheFishy: Assuming my device needs 200mA and using a 2n2222 transistor (beta=300), I found that R1 needs to be of 8.3k Ohm. Now I am stuck for the value of R2.

Not that it matters for this, but R1 needs to be 220 ohms or so if using a transistor as a switch. beta is not relevant.

For a 2N2222, or any older transistor when used as a switch, the base current should be about 1/10th of the collector current.

You’ll find it on the datasheets.