Calibration of 4-20 mA pressure transducer and using a 4-20 mA signal converter

Hi, I am trying to include an offset value to zero out the voltage at 0 kPa (0 psi), but it's still not zeroing out my values. Any suggestions?

Even with zero pressure applied to the pressure transducer, I am still getting a 0-20 kPa output in my serial monitor. This is with everything plugged in and turned on in my setup in the picture below.

Please note the pressure transducer outputs values using 4-20 mA and I used this conversion module to convert the signal to a 0-5V signal so that I can input it into my Arduino UNO R3:
(I am trying to adjust the zero and span values on the signal conversion module, but nothing changes on my serial monitor output)

https://bit.ly/2CwncAK

I plugged the signal conversion module to a 24V din rail power supply (voltage read with multimeter is 24.3). The pressure transducer itself has an excitation voltage of 24VDC.
Its range is 0-689.476kPa (0-100 psi).

https://www.omega.com/pressure/pdf/PX409_BAR.pdf

/************************************************************
  Pressure Sensor Key Parameters
  - Part No.: Omegadyne PX-409
  - Sensing range: 0 - 0.689476 MPa
  - Input Voltage: 24 VDC
  - Input Current: 4-20 mA
  - Output Voltage: 0.0 - 5.0 VDC
    (Linearly corresponding to 0 - 0.689476 MPa)
  - Accuracy: ±0.08% BSL Includes Linearity, Hysteresis,and Repeatability

  Pressure Sensor Calibration

  Calibration: connect the 3 pin wire to the Arduino UNO (VCC, GND and Signal)
  without connecting the sensor to the water pipe and run the program
  for once. Mark down the LOWEST voltage value through the serial
  monitor and revise the "OffSet" value to complete the calibration.

  After calibration the sensor is ready for measuring!
**************************************************************/

int inputPin = A5;
const int numReadings = 400;
unsigned int RawValue = 0;
float Voltage = 0;
const float  OffSet = 0.1;
float Pressure;

void setup()
{
  Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
  Serial.println("/** Water pressure sensor measurement **/");
}

void loop()
{
  for (int x = 0; x < numReadings; x++) // analog readings for averaging
  {
    RawValue = RawValue + analogRead(inputPin); // add each A/D reading to a total

    delay(1); // wait "x" milliseconds before the next loop, for the A/D converter to settle, after the last reading
  }

  Voltage = ((RawValue / numReadings) / 1023.0) * 5; // Gets you V

  Serial.print("Raw Value = " ); // shows pre-scaled value
  Serial.print(RawValue / numReadings);
  Serial.println();
  Serial.print("Voltage = "); // shows the voltage measured
  Serial.print(Voltage, 3); // the '3' after voltage allows you to display 3 digits after decimal point
  Serial.println();

  Pressure = (Voltage - OffSet) * 137.8952;  // Calculate pressure --> 689.476kPa / 5V = 137.8952 kPa/V
  Serial.print("Pressure = ");
  Serial.print(Pressure, 3);
  Serial.println(" KPa");
  Serial.println();

  RawValue = 0; // reset value

  delay(4000);
}

Is this the result of just noise in the system?
I know the signal converter itself has an accuracy.
Right now there is no fluid going through the pressure sensor.

Raw Value = 33
Voltage = 0.161
Pressure = 8.452 KPa

Raw Value = 38
Voltage = 0.186
Pressure = 11.822 KPa

Raw Value = 35
Voltage = 0.171
Pressure = 9.800 KPa

Raw Value = 23
Voltage = 0.112
Pressure = 1.712 KPa

Raw Value = 27
Voltage = 0.132
Pressure = 4.408 KPa

Raw Value = 24
Voltage = 0.117
Pressure = 2.386 KPa

Raw Value = 29
Voltage = 0.142
Pressure = 5.756 KPa

Raw Value = 20
Voltage = 0.098
Pressure = -0.310 KPa

Raw Value = 34
Voltage = 0.166
Pressure = 9.126 KPa

Raw Value = 31
Voltage = 0.152
Pressure = 7.104 KPa

Raw Value = 37
Voltage = 0.181
Pressure = 11.148 KPa

Raw Value = 31
Voltage = 0.152
Pressure = 7.104 KPa

Raw Value = 28
Voltage = 0.137
Pressure = 5.082 KPa

Raw Value = 30
Voltage = 0.147
Pressure = 6.430 KPa

Raw Value = 34
Voltage = 0.166
Pressure = 9.126 KPa

Knightrider,
Here is a link to a pretty good article that addresses the problem you are having.
https://www.mensor.com/upload/TA_Zeroing_Absolute_Sensor_en_um_68327.pdf
Good luck

Thanks.
I have a gauge pressure sensor though not an absolute pressure sensor.
Not sure if the same concept applies in the article.

I'm thinking of mapping the sensor values.
https://www.arduino.cc/en/tutorial/calibration

Also I've used smoothing from a previous program to get better results:
https://www.arduino.cc/en/tutorial/smoothing

Or I'm wondering if using an esp32 with a 12 bit ADC converter would give me better resolution/results.
Although I hear the ADC converter on the esp32 is noisy (it can be made better with capacitors I believe based on the documentation I read).
https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/adc.html

Or perhaps maybe I can go with another sensor?

But these modules are more expensive and I don't know if it will get rid of the problem.

If I understood the accuracy percentage of the sensor correctly (total range of accuracy is .16 %) than that would mean my results should have an accuracy range error of 1.103161 kPA (.16 psi). This does not include any accuracy error due to the signal converter though.

Do you have a 220 Ω, 5% resistor and accurate DMM for testing?

I'd hate to see you throw more money at this. Seems like that's a decent gauge. Can you connect that device to an air pressure hose then you can measure tire pressure and compare it to other gauges to see if you are at least in the ball park for accuracy.

Sensing range: 0 - 0.689476 MPa

That's 100 PSI, the link you posted is for barometric pressures, less than 16 PSI. What kind of pressure are you trying to measure? Post the complete part # (PX-409-xxxx?).

I got used ones on ebay so luckily I didn't spend much. They have NIST calibration certificates from 2011.

It's px-409-100gi.

The link is:
https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.omega.com/pressure/pdf/PX409_SERIES.pdf&ved=2ahUKEwjok_O9pdPfAhUF-lQKHbMPDIEQFjAAegQIAxAB&usg=AOvVaw0mr7MyfA_zKVBv7J9wqFhC

I actually pressurized it to 50 psi with water.
Weird thing was the readings didn't go above 101 kpa and still fluctuated by 20kpa even after smoothing the readings. Will try individual readings with no smoothing tomorrow.

I think I have to fine tune the 4-20mA converter zero and span settings. I turned the span potentiometer and got a max voltage reading of 2.68 volts (used multimeter and touched leads at vout going to arduino and gnd on signal generator) until the potentiometer started making a click sound as I rotated it clockwise.

50 PSI should be 2.5V.
Step1: With 0 PSI, adjust ZERO pot for 0V output.
Step2: Apply 50 PSI (hope your gauge is accurate), adjust SPAN pot to 2.5V.
Repeat 2 or 3 times, when setting ZERO, only adjust the ZERO pot, when adjusting SPAN, only the SPAN pot, they interact somewhat.

I think my converter is broken.
I tried to adjust it for both 0 kPa (0 psi) and 50 psi .
It maxes out at in terms of its overall range of around 2.8 volts.

At lowest ZERO span setting voltage read through multimeter is:
-2.392/2.385 volts
If I adjust the potentiometer such that the read out is 0 volts at 0 psi, then the half way point of 50 psi should read 2.5 volts but that is not the case even after adjustment ( I was assuming it might have to read 1.25 V based on the instructions below in bullet point 4)

I have found the voltage range does not extend beyond approx. 2.8 volts from what I last remember.
The potentiometers start to make a clicking sound when they are maxed out.

The instructions they have are confusing:
https://bit.ly/2CwncAK

Instructions for use:

  1. Module according to the definition of wiring, power supply voltage 7-36V (if the output to 10V, the supply voltage must be greater than 12V)
  2. After power-up, the D2 indicator should be on, otherwise check the line connection. Board with reverse protection, reverse does not burn.
  3. When the current input is the minimum (0mA or 4mA), adjust the ZERO potentiometer so that the VOUT output is the minimum (0.0V or other voltage)
  4. When the current input is at maximum (20mA), adjust the SPAN potentiometer so that the VOUT output is the maximum (3.3V or 5V or 10V, the output can be as low as 2.5V when the input is 4-20ma)

I have both jumpers on for 0-5.0V range.
According to your needs, through the jumper cap to select the appropriate range:
4--20ma: 0-2.5V range: J1 1,2 feet short, 3,4 feet shorted
0 - 3.3V range: J1 1,2 feet off, 3,4 feet off
0 - 5.0V range: J1 1,2 feet short, 3,4 feet shorted
0--10.0V range: J1 1,2 feet short, 3,4 feet off

I tried to use code without smoothing and I am still getting inconsistent results

/************************************************************
  Pressure Sensor Key Parameters
  - Part No.: Omegadyne PX-409
  - Sensing range: 0 - 0.689476 MPa
  - Input Voltage: 24 VDC
  - Input Current: 4-20 mA
  - Output Voltage: 0.0 - 5.0 VDC
    (Linearly corresponding to 0 - 0.689476 MPa)
  - Accuracy: ±0.08% BSL Includes Linearity, Hysteresis,and Repeatability

  Pressure Sensor Calibration

  Calibration: connect the 3 pin wire to the Arduino UNO (VCC, GND and Signal)
  without connecting the sensor to the water pipe and run the program
  for once. Mark down the LOWEST voltage value through the serial
  monitor and revise the "OffSet" value to complete the calibration.

  After the calibration the sensor is ready for measuring!

  4-20 mA to 0-5 V Signal generator potentiometers settings:
  -2.392/2.385 volts read as lowest possible ZERO span setting

**************************************************************/

int inputPin = A5;
float Voltage = 0;
const float  OffSet = 0.09286412239074;
float Pressure;

void setup()
{
  Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
  Serial.println("/** Water pressure sensor measurement **/");
}

void loop()
{
  Serial.print("Raw Value = " ); // shows pre-scaled value
  Serial.print(analogRead(inputPin));
  Serial.println();

  Voltage = (analogRead(inputPin) / 1023.0) * 5; // Gets you V

  Serial.print("Voltage = "); // shows the voltage measured
  Serial.print(Voltage, 14); // the '3' after voltage allows you to display 3 digits after decimal point
  Serial.println();

  Pressure = (Voltage - OffSet) * 137.8952;  // Calculate pressure --> 689.476kPa / 5V = 137.8952 kPa/V
  Serial.print("Pressure = ");
  Serial.print(Pressure, 14);
  Serial.println(" KPa");
  Serial.println();

  delay(4000);
}

Do you have a 220Ω and 27k or 33kΩ resistors?

I have 200 ohms and 20 ohms, but they have 5% tolerance values.

I read elsewhere on the forum and other websites that a 250 ohm resistor can be used.
I found some here though the cheapest one was: ~$4 for +/-.01% tolerance on the resistor.

My sensor has an excitation voltage of 24V and I am using a 24V dc power supply.
I just don't want to fry my Arduino.

I get:
5V = .02 amps (20 mA) x 250 ohms
1V = .004 amps (4 mA) x 250 ohms

@0:28 in the video
I get confused as to what his schematic is saying. I posted a picture of my setup.
Can anyone let me know if it's accurate?

  1. The resistor is in parallel in between the positive and negative leads of sensor/power supply?
  2. The analog out wire goes from the positive lead of transducer to the arduino analog in?
  3. A ground wire from the negative circuit lead goes to Arduino?

Surely you're not putting 24 volts on your Arduino pins? How many wires on your sensor, and how are they connected?

I'm not putting 24 volts to the Arduino to the best of my knowledge. Right now I have everything powered off. One of the reason's for me wanting to use a module to convert my 4-20 mA signal to 0-5V was because I was not sure about how to make the conversion circuit below.
Also some other modules have 12/16 bit ADC converters built in so I can get better resolution and that was the other reason I was trying to use a conversion module but they quickly jump up in price from my current conversion module that I am using.

The pressure transducer has two wires.
Positive and Negative.
They are connected to the terminal block in the picture in the previous post.
The other end of the terminal block is connected to a din rail mounted 24V power supply.
I have the resistor in parallel connected to the positive and negative leads on the terminal block.

I just find reading schematics a bit confusing sometimes.
Sometimes it's easier for me to visualize things on a breadboard.

I found some sample circuits on the forum:
http://forum.arduino.cc/index.php?topic=327612.0

In this example I don't get where the arrow is going to (gnd???)
https://forum.arduino.cc/index.php?topic=504676.0

A better circuit includes a 10K resistor for overvoltage protection at the input, and has the negative sensor power supply connected to Arduino ground, as follows:

What are the green and white wires for? Did you get a wiring diagram with the sensor? If so, can you scan or photograph and post it? If I don't know exactly which wire does what, I can't advise any further. I could not find that info on Omega's website.

Sorry I didn't get a wiring diagram for the sensor.
I got the sensors used on Ebay.
The sensor comes with different options.

This is a pdf hand out of the sensor.
Page 7 describes what each wire is for.
For the 4-20 mA the green and white wires are NC (normally closed) or not used???

https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.omega.com/pressure/pdf/PX409_SERIES.pdf&ved=2ahUKEwjok_O9pdPfAhUF-lQKHbMPDIEQFjAAegQIAxAB&usg=AOvVaw0mr7MyfA_zKVBv7J9wqFhC

It may be easier for the manufacturer to use one wire for multiple models.
For 4-20 mA sensors it's just positive and negative wires that are needed and it came hooked up like that to the terminal block when I got them on ebay.

The links in previous post show two wires as well for 4-20 mA sensors.

I am going to move the topic over to the sensors section since it seems the code is not really the issue and most likely it is my signal converting hardware. Thanks everyone for the feedback.