# 0-10V, 4-20mA to microcontroller

I have a communication board, and I am designing an analog interface to it. The point is, to be able to measure 4-20mA and 0-10V analog signals. I know this is not a professional solution, but I just want to provide some data to my board. MY board is supplied with 24VDC wich is also the supply of the 0-10V buffer amplifier. The other opamp for 4-20mA is supplied with a regulated 5V. The opamp outputs are connected to my microcontrollers ADC wich is capable of accepting 3.3V. My question is, do you think that the circuit on the picture would work properly?

• Can you post a higher resolution schematic? It's pretty hard to read text on this one. Dec 28, 2017 at 9:07
• Yes it was really crappy. Now, it should be OK.
– Tage
Dec 28, 2017 at 9:13
• I assume R6 is supposed to be current sensing resistor. It is too big in my opinion. In your case it could be like 1 ohm. It depends what voltage drop you allow. Dec 28, 2017 at 9:23
• In a 4-20mA current loop, normally the maximum current would be 20mA. Using a 150 Ohm resistor, the voltage drop is a bit less than 3.3V, which is the upper limit of my ADC. Am I not correct?
– Tage
Dec 28, 2017 at 9:29

In contrast to Asmyldof's answer I would be inclined to make a dual-mode input as is common on industrial PLCs, etc. Typically these add a 500 Ω shunt resistor across the 0 - 10 V input to convert 20 mA to 10 V.

simulate this circuit – Schematic created using CircuitLab

Figure 1. A 0 - 10 V / 4 - 20 mA input for 3.3 V ADC.

• R2, 3 and 4 provide an easy to make 3:1 divider. Their impedance is very high relative to the shunt resistor so the loading should not introduce a significant error.
• There is no reverse protection diode on the input as this will cause a voltage drop in the signal to the ADC.
• D1 and D2 provide over-voltage and reverse-voltage protection to the ADC without voltage drop and without the worry of Zener leakage as the voltage approaches 3.3 V. The current shunted to the PSU through these diodes will be limited by R2 and R3 to a low value.
• The op-amp can be eliminated.

With this arrangement you have a standard dual-purpose input.

• Thank you! I actually quite like this solution. At first I was trying to figure out something similar, but I chose the 2 channel solution with opamps for the reason of the parallel resistors. But as you said it really wont generate too much error. I think I'll go with this in the end.
– Tage
Dec 29, 2017 at 10:43
• @Transistor, any reason to use 2 x 10K resistor (R2 and R3) in series in set of 1 20K one?
– Marc
Mar 11, 2022 at 10:12
• @Marc, 10k is an E12 series value. 20k is not. "R2, 3 and 4 provide an easy to make 3:1 divider." Mar 11, 2022 at 11:42
• The circuit is not working. I verified it through the analog output extension module of Siemens Logo PLC. The PLC can hold a constant 20 mA current up to 452 ohms load. Then it gets nonlinear. According to IEC 60381-1 ( webstore.iec.ch/publication/1948 ), if the PLC can hold constant current for 0 - 300 ohms load, it will pass the standard. So if a slave device has a 500 ohms resistor in series to read current, the device may malfunction. Plus, wire resistance will also add up. Feb 21 at 10:11
• @SadatRafi, sure, so reduce the resistor to 250 ohms and work with 0 - 5 V and half the resolution. This was done in many PLCs. Feb 24 at 17:16

Since the standard is intended to work with relatively large wire and connection losses, in your situation the resistor you chose may well work, but if you mean to use this with more... internet-open-source-type device, you may want to reduce the resistor. With some of those devices, and possibly even some professional ones, you can probably not be sure they can cleanly generate the full current range with voltage drops up to 3V.

You can reduce the resistor to 15 Ohm and have the op-amp amplify the signal by a factor of 10 to get the same effect. You may also want to add a resistor to the op-amp's output and a clamping diode, in case a connection mistake introduces more signal than what you expect, as well as protections for reverse connections:

simulate this circuit – Schematic created using CircuitLab

You can also add a capacitor of 10nF or so on the output of the Op-Amp here for filtering. And if you want to be 100% sure the op-amp is also safe, add a zener diode there too, if you have a 3.3V or 5.6V type they won't leak all too much at the 0.3V for maximum current in the loop, but still offer full protection to a 24V powered op-amp. Of course, with 5V coming in from a mis-connection the resistor will likely clamp or burn-up.

The diode will cost you 0.7V here, you can also use a Schottky diode with a very low forward voltage, like the BAT54 types, they will leak a bit more in reverse, but even 1mA will only generate 15mV in reverse across the op-amp, which should be damage free.

I would not put the zener diode directly on the input. On a too high input you will load the device generating the voltage a lot, possibly damaging it and if you apply 12V or 24V supply, your zener will probably just blow up.

If you put a 3.3V or 3.6V zener on the junction of the resistive divider your device will be protected, but any current coming in will be clamped. In that case you want to be sure the zener doesn't leak too much at 3V (or whatever your maximum signal is). If the leakage is too high, you can also protect with a diode from that junction back to the 3.3V supply voltage.

The capacitor likely should also not be directly on the input. If the device creating the signal has an immediate op-amp output, capacitive loading may create oscillations or other problems. If you move the capacitor to past the divider as well, the loading effect will reduce significantly and it will actually become an R-C filter, which is much more effective.

If you don't know anything about the device creating the signal, it may be better to buffer the input and then divide resistively, since you have 24V available. Of course, still taking some protective measures:

simulate this circuit

The zener starts to clamp at 11V, allowing some over-voltage on the input, and when the input goes higher the resistor limits the current to protect the zener and the device creating the signal.

• Why change what is virtually a standard? Almost all instrumentation current inputs are 125 to 500 ohms. Not lower, not higher. Dec 28, 2017 at 12:04
• @RDrast As stated, nothing is known about the purpose and many of these hobby DIY sensors use 3.3V or 5V from their internal rail to create what they claim is a current loop output. Causing a 3V drop on such a "sensor" will not allow them to operate correctly. Dec 28, 2017 at 12:08
• Thank you! Great explanation. I have no experience with analog circuits and this really helped me a lot. What I'm still confused about is the opamp. Clearly I would need to use rail to rail devices in order to measure close to 0V. Are they really rail to rail? Arent they inaccurate in that range?
– Tage
Dec 29, 2017 at 10:31