# 4-20mA Analog sensor to 0-3.3V Digital conversion

#### sk1ppy

Joined Nov 18, 2019
4
I have a question about signal conversion since I am pretty new to this.
I want to translate a 4-20mA signal into a 0-3.3V digital signal.
I have done a lot of research and came up with a circuit, but i am unsure if this is possible / correct.
My idea was to use a Transimpedance amplifier to transform the 4-20mA to 0.82-4.1V.
Then use a voltage offset of -0.8 to shift the voltage to 0.02-3.3V.

Is it possible to connect the negative input of the Opamp to ground to limit the output voltage of the Opamp to positive voltages only?
Is there anything wrong with this circuit?

#### ericgibbs

Joined Jan 29, 2010
14,691
hi sk1,
Welcome to AAC.
Which type of OPA are you planning to use.?
A good choice would be a MCP6001 rail 2 rail type.
E

#### crutschow

Joined Mar 14, 2008
28,532
Is there anything wrong with this circuit?
Yes.
You can't input a 0.8V negative voltage to a single supply op amp.

Where are you getting the -0.8V?

#### ronsimpson

Joined Oct 7, 2019
1,750
Is there anything wrong with this circuit?
I think your 4-20mA needs to come from the +5V, output of opamp, through 205 resistor.
Can the opamp supply 20mA?

Some people use this:

#### crutschow

Joined Mar 14, 2008
28,532
Some people use this:
That uses the opposite polarity for the current input.

This brings up the question of, what is the source of the current?
Typically that's provided by a positive voltage power source at the receiver end, which then also monitors the sensor current.
A positive voltage could then be generated by having the shunt resistor in the return leg, as your R1 would be.

It would appear that the TS doesn't understand this.

Last edited:

#### BobaMosfet

Joined Jul 1, 2009
1,917
I have a question about signal conversion since I am pretty new to this.
I want to translate a 4-20mA signal into a 0-3.3V digital signal.
I have done a lot of research and came up with a circuit, but i am unsure if this is possible / correct.
My idea was to use a Transimpedance amplifier to transform the 4-20mA to 0.82-4.1V.
Then use a voltage offset of -0.8 to shift the voltage to 0.02-3.3V.
View attachment 191812
Is it possible to connect the negative input of the Opamp to ground to limit the output voltage of the Opamp to positive voltages only?
Is there anything wrong with this circuit?
I redact this.

Last edited:

#### crutschow

Joined Mar 14, 2008
28,532
I don't think you understand OpAmps. OPA are _high_ impedance on the inputs which nullifies your current into.
I don't think you understand the TS's circuit.
It is a typical transimpedance configuration that converts an input current to an output voltage (below).
The (-) input is a virtual ground point, since the op amp will adjust the output voltage to maintain that point at essentially 0V.
Thus Vout = -In/Rf

Last edited:

Joined Feb 20, 2016
3,983
If you already have a 4-20mA sensor, just reading the voltage across the termination resistor is the way to go. No amp needed.
It is best practice not to scale the 4-20mA to 0-3.3V.
If you do that, you loose the ability to read a fault condition in the sensor.
This is more or less what I have used in my industrial control systems for years..

A 50mA Polyswitch is protection for all those times 24V is connected to the input, or the sensor shorts.
The series resistor to the ADC input limits the current to a safe value so the clamp diodes can protect the ADC.

#### BobaMosfet

Joined Jul 1, 2009
1,917
I don't think you understand the TS's circuit.
It is a typical transimpedance configuration that converts an input current to an output voltage (below).
The (-) input is a virtual ground point, since the op amp will adjust the output voltage to maintain that point at essentially 0V.
Thus Vout = -In/Rf

View attachment 191853
It doesn't actually convert. It regulates per Ohm's Law. I'm being nitpicky for no reason but to be obstinate - This is an interesting way to do this.

#### crutschow

Joined Mar 14, 2008
28,532
It doesn't actually convert. It regulates per Ohm's Law.
I don't see that as being mutually exclusive.
You are certainly entitled to your opinion, but the common term for the transimpedance function is current-to-voltage converter.
I'm being nitpicky for no reason but to be obstinate -
Well, that explains a lot.

#### sk1ppy

Joined Nov 18, 2019
4
If you already have a 4-20mA sensor, just reading the voltage across the termination resistor is the way to go. No amp needed.
It is best practice not to scale the 4-20mA to 0-3.3V.
If you do that, you loose the ability to read a fault condition in the sensor.
This is more or less what I have used in my industrial control systems for years..

View attachment 191854
A 50mA Polyswitch is protection for all those times 24V is connected to the input, or the sensor shorts.
The series resistor to the ADC input limits the current to a safe value so the clamp diodes can protect the ADC.
What would safe resistor values for this circuit be? im having a little trouble understanding

#### ericgibbs

Joined Jan 29, 2010
14,691
hi sk1
By using a 175R termination resistor a loop current of 20mA will give a voltage across the resistor of 3.5V.
Is this what you are asking.??
E

#### sk1ppy

Joined Nov 18, 2019
4
doesn't the current limiting resistor act like a voltage devider?

#### ericgibbs

Joined Jan 29, 2010
14,691
doesn't the current limiting resistor act like a voltage devider?
Hi,
Which current limiter resistor, I do not follow.?
E

Updated:

#### Attachments

• 31.2 KB Views: 52
Last edited:

#### sk1ppy

Joined Nov 18, 2019
4

I ment this circuit from dendad, since the ADC can only handle currents up to 1mA. But when you add the current limiting resistor doesn't it create a voltage divider?

#### Bordodynov

Joined May 20, 2015
2,949
See

Joined Feb 20, 2016
3,983
Oops.
The termination resistor should be 150R, not 175R. That will give you 22mA full scale.
The series resistor between the 150R and the ADC input may be 10K if your ADC is high impedance in. See what works for you.
Also, the higher resistance along with the cap will greatly limit the frequency response, but many 4-20mA sensors are on slow signals.

#### ericgibbs

Joined Jan 29, 2010
14,691
hi sk1,
Yet another option.
In my experience you will require Trim pots to get the correct Zero and Slope.
E

#### Attachments

• 37.6 KB Views: 68

#### swr999

Joined Mar 30, 2011
35
As per @dendad, here's my take on a 'bare-bones' simplified view:

4-20 mA would give you 0.6 - 3.0 Vout at the ADC. Of course the power source has to be able to source enough current to power the sensor. As per @dendad, the live zero (0.6V at 4 mA) is nice to have for detecting a sensor fault.