Go Down

Topic: 4-20 mA pressure transducer convert signal to 1-5 volts circuit diagram help (Read 2591 times) previous topic - next topic

knightridar

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

Quote
0.004A*250 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?

Wawa

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..

knightridar

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?
Quote
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)?

Wawa

Doesn't the Arduino have a voltage regulator even after being powered via USB?
Yes, but that is not used when on USB power.

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.

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.

knightridar

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
Quote
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%






Wawa

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..


knightridar

 :smiley-eek-blue: 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).

I found this article regarding the use of ADS1115 with Arduino
Arduino ADS1115 ADC Getting Started Tutorial

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

From the link above:
Quote
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.

ADS1115 Maximum Measurement Range
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:
Quote
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

Wawa

Arduino is all about experimenting.
Start small, and improve the working setup.

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

Your calculations are correct.
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..

outsider

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.

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

****************************************************************************

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
3. A resistor for protection of the analog input



*******************************************************************
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.





outsider

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.  :smiley-confuse:
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.

Wawa

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..


knightridar

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?)

From: Henry's Bench Getting Started with ADS1115

Quote
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

outsider

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.

Wawa

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.

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..


Go Up