# 4-20 mA pressure transducer convert signal to 1-5 volts circuit diagram help

hello,
I was looking at previous posts on the forum regarding the conversion of 4-20 mA sensor signals
to a 1-5 volt input for the Arduino analog input. My pressure transducer has an excitation voltage of 24 volts.
OMEGADYNE PX-409-100GI, 4-20 mA PRESSURE TRANSDUCER

0.004A250 ohms = 1V
0.020A
250 ohms = 5V

I wanted to see if the circuit I made accurately reflects the diagram below:
Reading 4-20 mA pressure sensor using Uno

In my example I did not include a 10kohm resistor going to the Arduino input.

4-20 mA converted to 1-5V

In this example I can't figure out where the DC power supply for the sensor is hooked up.
I get where the 0.1 microFarad capacitor is hooked in between arduino analog input and Ground for noise suppression.
Also is the 4.7kohm resistor hooked up in series right before it goes to the analog input?

The resulting pressure value of that circuit could depend on supply voltage of the Arduino.
If you power the Arduino with regulated 7-9volt on the DC socket, it might be stable.
But if you power the Arduino via USB, pressure value might fluctuate.

Better to change the sense resistor from 250ohm to 51ohm (standard E24 value).
Then read the analogue input with the internal 1.1volt Aref enabled in setup().

Keep the rest of the (protection) parts the same, but add a diode (1N4004) across the sense resistor (anode to ground) for added polarity reversal protection.
Leo…

I have the Arduino Uno hooked up to USB so that I can read my serial monitor values.
It's really useful from a programming aspect of seeing how well the code is working.
Doesn't the Arduino have a voltage regulator even after being powered via USB?
I'm using a 24 VDC power supply to power the pressure transducer.

The manufacturer of the pressure transducer advertises:
High Accuracy ±0.08% BSL Includes Linearity, Hysteresis, and Repeatability

I want to avoid losing accuracy of the sensor and I read somewhere if the resistor tolerances are off then our reported results are off too.
I found some higher tolerance resistors on digikey. Problem is availability, lead time, and price for some.
Digikey 250 ohm resistors with tolerances ranging from +/-.005 - 0.100 %

Sorry even with 53 ohms wouldn't I lose the resolution of my results?
.004 A * 53 ohms = 0.212 Volts
.020 A * 53 ohms = 1.060 Volts

Not sure what you mean by?

Then read the analogue input with the internal 1.1volt Aref enabled in setup().

So I will add the 1N4004 diode to the terminal block across the positive and negative leads (not sure what you meant by across the sense resistor)?

knightridar:
Doesn't the Arduino have a voltage regulator even after being powered via USB?

Yes, but that is not used when on USB power.

knightridar:
The manufacturer of the pressure transducer advertises:
High Accuracy ±0.08% BSL Includes Linearity, Hysteresis, and Repeatability

I want to avoid losing accuracy of the sensor and I read somewhere if the resistor tolerances are off then our reported results are off too.

Those things are not relevant if the A/D has a stability/accuracy of 20%.
A chain is as strong as it's weakest link.
A common \$0.05 1% metalfilm resistor is more than enough for this.

knightridar:
Sorry even with 53 ohms wouldn't I lose the resolution of my results?
.004 A * 53 ohms = 0.212 Volts
.020 A * 53 ohms = 1.060 Volts

I said 51.
With 1.1volt Aref enabled in setup(), the 1024 steps of the A/D are not spread out over 0-5volt, but over 0-1.1volt.
Then that 1.060volt you calculated uses about max count of the A/D.

Don't expect a lot from the basic 10-bit Arduino A/D.
With a 4-20mA sensor you can have a max span of 16/20 or 4/5 of the A/D, or ~820 values/steps.
0.08% is simply not possible.
If you want a high resolution, then you might want to look into using an external A/D, like the ADS1115.
Leo..

Edit:
Hope you didn't use the setup as in the picture with the terminal block.
24volt between A5 and ground would instantly fry the Arduino.
Look at the diagram again. The sensor goes in SERIES with the 24volt supply.

Thanks.

.004 A * 51 ohms = 0.204 Volts
.020 A * 51 ohms = 1.020 Volts

The 20% accuracy for the 10 bit ADC is good to know.
Is that due to noise?

I'm wondering if it can be improved with the 0.1 microfarad capacitor as shown in the first post and if so by approximately how much in terms of percentage?
It would be good to know for future projects and others on the forum.

I may have to use an alternate ADC as you suggested.
I2C ADS1115 ADS1015 16 Bit ADC 4 channel Module with Programmable Gain Amplifier 2.0V to 5.5V RPi

I found this 4-20 mA to conversion module and it seems convenient to use and not as pricey as some of the other ones I have found.
Gravity: Analog Current to Voltage Converter(for 4~20mA Application) SKU:SEN0262

Measurement Accuracy: ±0.5% F.S. @ 16-bit ADC, ±2% F.S. @ 10-bit ADC

I'm curious if I can increase the ±0.5% F.S. accuracy of this module if I use a higher accuracy resistor in place of the one they have in it.
Digi key PN MR106-250-.01-ND, 250 ohms, ±0.01%

Don't confuse accuracy with stability.
The 20% comes from the ±10% accuracy of 1.1volt Aref (not factory calibrated).
Meaning YOU have to calibrate (to 0%).

The 100n cap is added to reduce possible noise pickup, e.g from long sensor wiring.

Tha analogue buffer could reduce groundloop issues (if they exist), but does nothing to improve resolution.
It could add unwanted temp drift.

Up to you to use an expensive precision resistor.
If you decide to use the ADS1115, then the value should NOT be 250ohm, or 51ohm.
The ADS1115 has a full-scale of 1.024volt or 2.048volt or 4.096volt, depending on PGA setting.
Leo..

This is getting more complicated than I thought it would be.
I'm almost tempted to get this:
Automation Direct FC-33 signal conditioner

page 2 has FC-33 tech specs
FC-33 Tech Specs, Page 2

Would I calibrate by smoothing the readings and mapping them?
That's what I've done with photoresistor readings via the ADC in the past (only used mapping).

My wire from the sensor is about 1.83 meters (6 ft long).

The PGA setting kind of gets confusing for me, I know it has to do with multiplying the voltages.

In the default mode, the setting is +/-6.144 volts.

Thus the value of 32767 would represent a value of 6.144 volts.

Dividing 6.144 volts by 32767 yields a scale factor of 0.1875 mV per bit. This is a significant improvement over the Arduino ADC which resolution of approximately 5 mV per bit. In fact, its about 26 times better!

The neat thing about this is that this is worst case. In another PGA setting, you can establish a full scale of +/- 2.048 volts. That provides us a resolution of 0.0635 mV.

The PGA setting of +/- 6.144 range can be a little misleading as it seems to infer that you can measure voltages that high. You can’t.

Instead, the maximum measurable voltage is established by the supply voltage to the chip. Specifically, the maximum measurable voltage is 0.3 volts more than the supply voltage. In fact, exceeding this voltage at your analog input may damage your chip.

Note the differentiation here between the PGA range and the maximum measurable voltage. The programmed range determines the value of a bit (or scale factor), while the maximum measurable range determines what your analog input can safely handle.

So i.e. if I were to use:

In another PGA setting, you can establish a full scale of +/- 2.048 volts. That provides us a resolution of 0.0635 mV.

Does that mean, for measuring I would use:

Full range is : 4.096 volts
Therefore:

.020 A * R = 4.096 V, R = 204.8 ohms
.004 A * 204.8 ohms = .8192 Volts

Start small, and improve the working setup.

If you use an ADS1115 library, then PGA setting is just uncommenting one line of code.

You could also use the 2.048volt option, and use a 100ohm (standard value) resistor.
Then the A/D limit is 20.048mA.
Absolute accuracy of the resistor is not important. You can calibrate that out.
Temp coefficient is more important (avoid old carbon resistors).
Leo..

Supply voltage is 9 ~ 30V, page B-25f.
https://www.omega.com/pressure/pdf/PX409_SERIES.pdf

BTW: You can get close to 250Ω with 270 and 3.3k in parallel, 249.6k, for 12V change R3 to 15 ~ 22k.
And close to 50Ω with a 51Ω in parallel with 2700Ω, 50.054Ω.

And another trick, put a diode (1N4148) between sensor output and R1 / R3 junction with anode toward sensor, then you can check the actual current without breaking the circuit by clipping your Ammeter across the diode, current will take the lower impedance of the meter before building 0.65 volts to flow through the diode.

Ok, so if I understood things properly assuming I decide to use the PGA setting
with a full scale of +/- 2.048 volts →

16 bit ADC → 216 = 65,536 → ±2.048V → +2.048V (32,768) →

2.048V/32,768 = .0625mV / bit = .0000625V / bit →

689.476 kPA (100 psi) max. pressure spec. of transducer →689.476kPa / 2.048 = 336.658203125 kPa/V

→ 336.658203125 kPa/V * .0000625V/bit = 0.0210411376953125 kPa/bit

→ 0.0210411376953125 kPa / 689.476 kPA = 0.000030517578125

→ 0.000030517578125 * 100 = 0.0030517578125 %
(theoretical resolution of pressure transducer readings)

Using 100 Ω resistor,

V = IR
2.048V = I *100 Ω = .02048A = 20.48 mA
V = .004A * 100 Ω = .4V

Here is mockup picture drawing of my circuit
I didn't include:

1. A diode yet for reverse polarity protection
2. A 0.1 nF capacitor for noise protection

Weird thing is my 24 VDC is making a strange whining noise and I've barely used it in the past.
I have the output voltage measured at 24.3 volts, and there is no adjustment for it.
It's from Phoenix contact, 24V DC, 30W.
My AC power cable going into it has a ground cable and there is no place to attach it on the power supply. Hopefully this is not an issue.

The whine is normal for a switching power supply, the frequency and amplitude vary with price. 20 mA thru a 100 Ω R = 2V, with an AREF of 2.048V and full scale count of 32767 the output number should be about 2 * 32768 / AREF = 32000, 4 mA = 0.4 * 32768 / AREF = 6400. I think.
And pressure: (ADC output - 6400) / (32000 - 6400) * 689.476

Wait, the diode in my drawing is not for reverse polarity, it makes it possible to insert an Ammeter without breaking the circuit, it is not necessary, although it would work for RP protection, you do need a resistor to limit current from the 24V supply in case the sense resistor or connection fails.

knightridar:
Ok, so if I understood things properly assuming I decide to use the PGA setting
with a full scale of +/- 2.048 volts →

16 bit ADC → 216 = 65,536 → ±2.048V → +2.048V (32,768) →

2.048V/32,768 = .0625mV / bit = .0000625V / bit →

689.476 kPA (100 psi) max. pressure spec. of transducer →689.476kPa / 2.048 = 336.658203125 kPa/V

→ 336.658203125 kPa/V * .0000625V/bit = 0.0210411376953125 kPa/bit

→ 0.0210411376953125 kPa / 689.476 kPA = 0.000030517578125

→ 0.000030517578125 * 100 = 0.0030517578125 %
(theoretical resolution of pressure transducer readings)

Using 100 Ω resistor,

V = IR
2.048V = I *100 Ω = .02048A = 20.48 mA
V = .004A * 100 Ω = .4V

Wow.
I would say you get 16/20 (4-20mA) of the 15-bit (single-ended) range, which is about 25000 values spread out over the range of the sensor.
Leo…

I’ve read in a few places, that you don’t get the full read out of the ADC converters, something about effective bits, kind of like the megapixels in a camera (i.e. 20 mp camera, effective pixels 16 mp)

What do you mean by 16/20? (80% of the full range of +2.048V readout?)

Is it 15 or 16 bits?
The output of the ADS1115 is what as known as a signed integer. That means one of the bits in the 16 bit words is going to be used to tell us if it’s a positive or negative value being reported. This will be discussed more later, but what is important to grasp is that only 15 of the 16 bits are used to communicate the value of the voltage measurement.

What this means is that there are 32,768 possible output values, where zero is the first and 32,767 is the last.

Bottom line is that is indeed a 16 bit device, but only 15 of those bits are use to communicate the magnitude of the measurement.

16 bit ADC → But only 15 bits are used for communicate measurement?
215= 32,768 → ±2.048V → +2.048V (16384) →

2.048V/16384 = .125mV

Is that correct or is it?
.8* 32768= 26214.4 steps

What kind of numbers do you get from the ADC with 50 PSI on the sensor?
2048 mV / 32768 steps = 0.0625 mV per step.

knightridar:
What do you mean by 16/20?

The sensor outputs 4-20mA.
0-4mA (20%) is not used, so those lower A/D bits are also not used.

knightridar:
16 bit ADC → But only 15 bits are used for communicate measurement?

16-bit in differential mode (two A/D inputs).
A 4-20mA sensor has one output, so one A/D input is used (single-ended).

Don't worry. ~25000 useable A/D values is likely way higher/better than the pressure sensor.
Leo..

Ok got it.
I won’t be able to try anything using the 100Ω resistor until I get the ADS1115 modules in the mail.

PGA setting with a full scale of +/- 2.048 volts →

16 bit ADC → 216 = 65,536 → ±2.048V → +2.048V (32,768) →

2.048V/32,768 = .0625mV / bit = .0000625V / bit →

For 0-20 mA → 32,768 steps
For 4-20 mA → 16/20 * 32,768 steps = 26,214.4 steps (range of steps for 4-20 mA)
At 4 mA → 4/20 * 32,768 = 6553.6 steps (starting point of readings)
→.0000625V / bit * 6553.6 = .4096V (voltage read out at 4 mA)
→.0000625V / bit * 32768 = 2.048V (voltage read out at 20 mA)

I managed to get the FC-33 signal conditioner I mentioned below used from eBay.
I’m hoping it’s in working condition… : Just got it in the mail.

With both options, I will be using a laptop screen to view serial monitor results from Arduino IDE.

Setup 1:

1. Use 100Ω resistor in series with the current loop
3. Results sent via I²C to Arduino

Setup 2:

1. Use FC-33 signal conditioner to convert 4-20 mA signal to 0-5 volts

The 20% comes from the ±10% accuracy of 1.1volt Aref (not factory calibrated).
Meaning YOU have to calibrate (to 0%).

With the signal conditioner, I won’t/can’t use 1.1v Aref? Correct?
I would still have to calibrate for 0-5 volts due to Arduino being plugged in via USB port?

The resulting pressure value of that circuit could depend on supply voltage of the Arduino.
If you power the Arduino with regulated 7-9volt on the DC socket, it might be stable.
But if you power the Arduino via USB, pressure value might fluctuate.

So I’m confused a bit…

I want to view results from the serial monitor so I must have the arduino plugged in via USB port.
My 5 volt value will fluctuate???

What if I got a converter and powered the Arduino via the 24V dc power supply and
still had it plugged into the USB port? Will I still get fluctuating 5 volts?
7-26V input to 5.0V output converter, with output ripple of 30mV
Is this output ripple sufficient for good results and is it relevant to the fluctuating voltage?

Have you tried the sensor with the Arduino ADC? Remind me again, which Arduino?

I have tried the Arduino ADC on the UNO R3, but I was using this to convert the current to a voltage:

Current To Voltage Module 0/4-20mA To 0-3.3V 5V 10V Voltage Transmitter

It gave me no luck the potentiometers maxed out at a range of ~2.7V.
the pressure transducer ratings were the same or fluctuating.
I was applying water pressure within the ranges of 0-50 psi (0-344.738 kPa)

I'm going to try it with the signal generator first and see what kind of readings I get first.
FC-33 Signal Generator Manual

Then when I get the ADS1115 in the mail I will use that.

Well it looks like the used signal generator I got on eBay doesn’t work. It was worth a try.

Here is some info I found on Arduino ADC
Precise voltage measurements with the Arduino

These specifications tell us the Arduino is capable of measuring voltages to an accuracy
of ± 2 LSB - so the maximum error is 2 bits (4 decimal) in 10 bits (1024 decimal)
So the worst case accuracy of the converter is 4 / 1024 or 1 part in 256 i.e. 0.25%.

The Arduino has its own voltage references - but they are not very precise
The chip - depending on type - is provided with SOME of the following reference voltages
DEFAULT: the default analog reference of 5 volts (on 5V Arduino boards) or 3.3 volts (on 3.3V Arduino boards)
INTERNAL: a built-in reference, equal to 1.1 volts on the ATmega168 or ATmega328 and 2.56 volts on the ATmega8 (not available on the Arduino Mega)
INTERNAL1V1: Vint1 - a built-in 1.1V reference (Arduino Mega only)
INTERNAL2V56: Vint2 - a built-in 2.56V reference (Arduino Mega only)
EXTERNAL: the voltage applied to the AREF pin (0 to 5V only).
(3)

However the accuracy of these “reference” voltages is very limited. For example
DEFAULT: depends on your computer power supply
(4: 7.3.2) USB2 Vbus = 4.4V - 5.25V
(2: 31.8) Vint 1 = 1.10V actually 1.00 – 1.20V
(2: 31.8) Vint 2 = 2.56V actually 2.40 – 2.80V

The accuracy of the reference against which the voltage is measured - using any of the above references - is at best only 5.25 - 5.0/5.0 * 100 = 5% - much worse than the 0.25%. the ADC provides. Clearly if we wish to measure voltages to the accuracy provided by the Arduino the on-chip references are not good enough. The diagram below shows these errors as compared to a 4.096v reference described below.

Quick recap…

Using 100 Ω resistor,
V = IR
2.048V = I *100 Ω → .02048A = 20.48 mA
V = .004A * 100 Ω = .4V

16 bit ADC → 216 = 65,536 → ±2.048V → +2.048V (32,768) →
2.048V/32,768 = .0625mV / bit = .0000625V / bit
For 0-20 mA → 32,768 steps
For 4-20 mA → 16/20 * 32,768 steps = 26,214.4 steps (range of steps for 4-20 mA)
At 4 mA → 4/20 * 32,768 = 6553.6 steps (starting point of readings)
→.0000625V / bit * 6553.6 = **.4096V ** (voltage read out at 4 mA)
→.0000625V / bit * 32768 = **2.048V ** (voltage read out at 20 mA)

689.476 kPA (100 psi) max. pressure spec. of transducer →689.476kPa / 2.048 = 336.658203125 kPa/V
→ 336.658203125 kPa/V * .0000625V/bit = 0.0210411376953125 kPa/bit
→ 0.0210411376953125 kPa / 689.476 kPA = 0.000030517578125
0.00305 % of pressure transducer rating (theoretical resolution)

Using 250 Ω resistor,
V = IR
5V = I *250 Ω = .020A = 20 mA
V = .004A * 250 Ω = 1V

10 bit ADC → 210 = 1,024 → 0-5V→ +5V (1,024) →
5V/1,024 = 4.88mV / bit = 0.0048828125V / bit
For 0-20 mA → 1,024 steps
For 4-20 mA → 16/20 * 1,024 steps = 819.2 steps (range of steps for 4-20 mA)
At 4 mA → 4/20 * 1,024 = 204.8 steps (starting point of readings)
→0.0048828125V / bit * 204.8 = 1V (voltage read out at 4 mA)
→0.0048828125V / bit * 1,024 = 5V(voltage read out at 20 mA)

689.476 kPA (100 psi) max. pressure spec. of transducer →689.476kPa / 5 = 137.8952 kPa/V
→ 137.8952 kPa/V * 0.0048828125V / bit = .67331640625 kPa/bit
→ .67331640625 kPa / 689.476 kPA = .0009765625
0.09765625 % of pressure transducer rating

Using 51 Ω resistor,
V = IR
1.02V = I *51 Ω → .020A = 20 mA
V = .004A * 51 Ω = .204V

With Aref 1.1

10 bit ADC → 210 = 1,024 → 0-1.1V→ +1.1V (1,024) →
1.1V/1,024 = 001.07421875mV / bit = .00107421875V / bit
For 0-20 mA → 1,024 steps
For 4-20 mA → 16/20 * 1,024 steps = 819.2 steps (range of steps for 4-20 mA)
At 4 mA → 4/20 * 1,024 = 204.8 steps (starting point of readings)
→.00107421875V / bit * 204.8 = .22V (voltage read out at 4 mA)
→.00107421875V / bit * 1,024 = 1.1V(voltage read out at 20 mA)

689.476 kPA (100 psi) max. pressure spec. of transducer →689.476kPa / 5 = 137.8952 kPa/V
→ 137.8952 kPa/V * .00107421875V / bit = 0.148129609375 kPa/bit
→ 0.148129609375 kPa / 689.476 kPA = 0.00021484375
.021484375 % of pressure transducer rating

Why are you calculating in volt. Are you making a voltmeter?
I thought you were making a pressure sensor.

Makes more sense to directly calculate the available bits/steps to pressure.
And, since humans think in the decimal system, you have to incorporate that in your calculations.
Every added digit requires a 10x better setup.

Take a 100psi sensor as example.
With the ~820 steps available from a Arduino, the limit is 'almost' 0.1psi. For 0.1psi you need 1001 steps.
Oversampling might just get you to one decimal place.
It will make no difference if you use default Aref or 1.1volt Aref.
1.1volt Aref is just more stable, given that the sensor is a ratiometric type (4-20mA).

With the ~26000 steps of an ADS1115, you can have a 0.01psi readout.
Not a 0.001 readout, because that would require 10001 steps.

If the readout is in different units (bar, kPa), you might be able to make better use of those ~26000 steps.

"0.0048828125V/bit" is a bit silly if you know that the 5volt supply can vary a few percent in seconds.