# 0-10v and 4-20ma supply

Discussion in 'The Projects Forum' started by Chayvo, Sep 25, 2013.

1. ### Chayvo Thread Starter New Member

Sep 25, 2013
2
0
Im looking for a circuit to build a 0-10v variable voltage to simulate an input into a PLC and a circuit to produce a 4-20mA supply from a 12V battery.
All help welcome.

2. ### wayneh Expert

Sep 9, 2010
15,553
5,763
Do you really need zero, with precision? An LM317 circuit can give you a nice variable, regulated voltage but it cannot control below ~1.5V. You could chop off 1.4V by using two diodes in series but the precision of this isn't great.

For the 4-20mA circuit, you'll use 2 op-amps, one to control the current loop and the other to provide the offset and scale. I think I have an example around here somewhere.

Chayvo likes this.
3. ### #12 Expert

Nov 30, 2010
18,076
9,676
A simple potentiometer and a resistor might do the 0 to 10 volts. (strantor is good with these.)

The 4-20 ma circuit is very common. Probably googlable.

4. ### strantor AAC Fanatic!

Oct 3, 2010
4,990
3,070
Calling me out, eh? Lol.

I use a resistor/ pot kludge for 0-10 AND 4-20. I really need to get on the ball and make a sleek source/simulate box. When I do, I will post it up with drawings. Don't hold your breath.

For 0-10v you can just use a pot across the 12v. Start at 0 and don't go up past 10, simple. For 4-20, ohms law. You don't want to go higher than 20 ma so your resistor needs to be (12/.020) 600 ohms. To get down to 4ma, you need an additional ((12/.004)-600) 2400 ohms. Now this is going to be a little bit off since the plc input has its own impedance, but it should get you close. It could be ideal to have a current source instead, but you can make this work in a pinch (i'm always in a pinch). You just put your dmm in series with it, and as long as your plc input value corresponds exactly in proportion to what your dmm says, at high and low measurements, then you don't really have to go to exactly 4.000 mA and 20.000mA.

#12 likes this.
5. ### strantor AAC Fanatic!

Oct 3, 2010
4,990
3,070
BTW, you know how to verify the input, right? It's pretty simple, but it had to be explained to me, so in case you haven't figured it out already, the input corresponds to 16mA, shifted up by 4mA. So you do your math for 0-16mA and then add 4. the input usually is represented by 0-32767.

So for example, let's say your low reading with the resistor/pot kluge is 4.385mA.
step 1, subtract 4mA
0.385mA

Step 2 perform a proportion (cross multiply & divide);
(16/32767)=(0.385/X)
X=788

Now do the same for your high measurement; let's say the highest you get is 18.925mA
18.925 - 4 = 14.925

(16/32767)=(14.925/Y) cross multiply & divide
Y = 30,565

so if your PLC displays numbers that are reasonably close to this, then that indicates the input is functional. it doesn't hurt to check a few points in the middle as well.

6. ### #12 Expert

Nov 30, 2010
18,076
9,676
Yep. I'm putting you in the hot seat, and you missed what I was cooking up.

I'm thinking this guy needs to know how many ohms are in the pot. Sensitivity of the PLC? How much current must flow in the voltage divider in order for the input impedance of the PLC to be properly served?

ps, thanks.

7. ### THE_RB AAC Fanatic!

Feb 11, 2008
5,430
1,311
I use a pot and an ammeter in series (multimeter on 200.0 mA range).

That simulates 4-20mA just fine if you don't mind fiddling a bit.

8. ### strantor AAC Fanatic!

Oct 3, 2010
4,990
3,070
Yeah that works too, but I advise installing the 20 mA current limiting resistor because it's too easy to turn the pot too far and short out the input. Once you get to that low resistance/ high current end of the pot, it's really touchy. The difference between 20 ma and 200 ma might be too small to adjust reliably.

THE_RB likes this.
9. ### wayneh Expert

Sep 9, 2010
15,553
5,763
I totally missed that part. I thought you were looking to supply power or drive a 4-20mA loop from a voltage input.

Nevermind.

Chayvo likes this.