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

Thanks. I realized what I was doing wrong.
I was measuring at both points after the resistor.

This time I have the leads to the DMM connected properly.

  1. One negative lead connected before resistor from power supply ground
  2. One positive lead connected after resistor to ground.

I've got a voltage readout of .972 volts at zero pressure.
.972V * 250 ohms =~ .0039 A

The multimeter accuracy could be throwing the result off.
The resistance I am also reading is 249.9/249.8 ohms (.01% tolerance resistor reads at .04%)
Fluke 11 DMM Specs

Good enough, you should see near 3V with 50 PSI. Whats next?

It worked. The multimeter reads 3.010 V at 344.738 kPa (50 psi)
But the Arduino input pin isn't reading it.

I just put in this simple code and raw value is being reported as 0 on the serial monitor.
:frowning:

int inputPin = analogRead(A0);

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(inputPin);
  Serial.println();
  delay(4000);
}

knightridar:
But the Arduino input pin isn't reading it.

Really?

You have connected the A0 resistor to Arduino ground.
Leo..

I took a look at post #42 from @outsider and matched the wiring to that now.
I have the ground wire connected to the same location where the blue wire from the power supply is connecting.

The Arduino analog output wire doesn't have anything else connected there, except for the opposite side of that terminal where the sensor ground and 250 ohm resistor are connected.

4-20mA current sensor setup.PNG

This other post seems to show the same thing.
reading 4-20 mA pressure sensor

In another post of mine I have analog out connected right before 10 kohm resistors. hook up to ground.
I tried that and I got the same 0 results.

4-20mA current sensor setup.PNG

Oops.It was my code giving me the problem it seems. The code below outputs a raw value. I will figure out how to substitute serialprintln variable with a name.

int inputPin = analogRead(A0);

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(A0));
  Serial.println();
  delay(4000);
}

Here is some serial read out from other code at 0 kPa:

Raw Value = 195
Voltage = 1.00097
Pressure = 0.1666 KPa

Raw Value = 195
Voltage = 0.99608
Pressure = -0.6758 KPa

Raw Value = 195
Voltage = 1.00097
Pressure = 0.1666 KPa

Raw Value = 195
Voltage = 1.00097
Pressure = 0.1666 KPa

I would have expected raw value to be closer to 204 (1 volt with a 5 Volt AREF, but the voltage reading looks good. Can you check your AREF voltage with your DMM? Black probe to GND, red probe to AREF pin, should read close to 5.0 volts.
Have you tried it with pressure on the sensor?
Don't mean to be picking you, but I'm planning a similar project.

Here's my 2-pennuth.
4-20-mA is a current loop, usually driven by something like a 24-V supply on industrial stuff.
You stick a precision resistor usually 500 or 250 ohms in the loop and pick off the voltage generated across the resistor. You can put as many resistors in the loop as you like, provided the total voltage you are picking off doesn't exceed the transducers supply ability to maintain the current loop accurately - this is called the compliance.Don't forget to take care of the offset (4-mA) when you do your sums - the span is actually 16-mA.

@outsider

My voltage readout is .972 volts at 4 mA.
I haven't even measured current yet (measure across one lead only, I learned the hard way a while back by shorting my multimeter by trying to measure current in parallel I believe)

The DMM supposedly has a ±(0.9%+2) for resistance up to 400.0Ω.
For voltages 4-40V its ±(0.9%+1).
Fluke 11 Manual

The results are better than my Harbor Freight Multimeter or Klein tools multimeter.
I measured the resistance of the resistor.
250 Ohms ±0.01% 0.25W, 1/4W
The Fluke gave me the closest answer 249.9 (off by .04%), where as the others were off by 1-3 ohms.
Wish there were cheaper multimeter options with higher accuracy it's 2019 for goodness sake.

In my code I included an offset value (.021-.043 V) for Voltage so that it matches close with my 0 pressure rating.
The raw value though does not have an offset.
For other pressure ratings (I'm measuring in increments of 25% so at 1V,2V,3V,4V,5V) the offset is slightly different.)

I'll measure the voltage for 5V AREF as soon as I get a chance.
It's being powered via usb out of laptop.
I'm still keeping in mind @Wawa's comments on voltage fluctuations from 5V sources.

Still waiting for ADS1115 16bit ADC in the mail.

I see you're still focussed on the absolute value of the resistor, which has nothing to do with measuring accurate pressure.
A resistor with 10% tolerance gives you the same accurate pressure readings as a 0.1% resistor.
What matters is resistance drift (ppm/°C in the specs). That COULD be less (better) with the 0.1% resistor.

You must calibrate out all the variables (there's more than one) in the final code, by adjusting pressure on the sensor to readout on the LCD.
That takes care of all the sensor/resistance/current/AD/Aref/etc. tolerances in one sweep.
So all you really need for accurate results is stable parts and a calibrated pressure sensor, not a calibrated DMM.
Leo..

@Wawa
I see, I get what you mean now for the most part I think. Thanks.
The resistor will have a specific value due to tolerances.
We refererence our values based off of that value.

Then in addition to that we calibrate our values (i.e. Arduino voltage).
Arduino Tutorial Calibration
I've used this example with photoresistors, but I just left the sensors out in open day light.
I didn't keep my hand over them to get the min value and take off my hand to get max value for light.

After taking a look at it more carefully it seems it's using min and max values of the range of the sensor.
Does that mean I would have to ramp up my pressure from 0-100%?
I'm guessing in that case I should raise up the delay time to do this since it may take longer than 5 seconds as shown in the example?

If I understood things correctly.
These are the specs we should calibrate for:

  1. Voltage

What about the resistor?
Is that just an offset I take into account in the voltage?

Here is some comparison of resistance drift (ppm/°C in the specs) for the 250Ω resistors.
I'm reading up on the drift.
Not too much of an issue for me but may be for others:

Understanding resistors and temperature

RESISTOR 250 OHM 1/4W .01% WW
±10ppm/°C

RES 250 OHM 0.1% 0.4W AXIAL
±25ppm/°C

RES 250 OHM 3W 1% AXIAL
±20ppm/°C

RES 250 OHM 1/2W 1% AXIAL
±20ppm/°C

RES 250 OHM 3W 5% AXIAL
±30ppm/°C

Pressure can be calculated directly (no intermidiate volt steps) with this formula.
pressure = (measured A/D value - 4mA A/D offset) * sensor max rating / (20mA A/D value - 4mA A/D offset);

For the Arduino, A/D that could be:
pressure = (analogRead(A0) - 200) * 500 / (1000 - 200); // (example)

Different values for the 15-bit A/D ofcourse.
Leo..

@wawa

got it I'll try that out in the next version of code.

@outsider
I measured voltage from GND and 5V output pin of Arduino Uno.
My measured voltage is ~5.06-5.07 volts.
Voltage readout across 250 ohm resistor is .971 volts.

Here are my serial output results with a voltage offset of 0 at 0 pressure.

/** Water pressure sensor measurement **/
Raw Value = 194
Voltage = 0.94819
Pressure = -8.9302 KPa

Raw Value = 194
Voltage = 0.95308
Pressure = -8.0877 KPa

Raw Value = 194
Voltage = 0.94819
Pressure = -8.9302 KPa

Raw Value = 194
Voltage = 0.94819
Pressure = -8.9302 KPa

Raw Value = 194
Voltage = 0.95308
Pressure = -8.0877 KPa

Raw Value = 195
Voltage = 0.94819
Pressure = -8.9302 KPa

Raw Value = 194
Voltage = 0.94819
Pressure = -8.9302 KPa

Raw Value = 194
Voltage = 0.94819
Pressure = -8.9302 KPa

Raw Value = 195
Voltage = 0.95308
Pressure = -8.0877 KPa

Here is code I'm using:

/************************************************************
  Pressure Sensor Key Parameters
  - Part No.: Omegadyne PX-409
  - Accuracy: ±0.08% BSL Includes Linearity, Hysteresis,and Repeatability (Linearly corresponding to 0 - 0.689476 MPa) 
  - Sensing range: 0 - 0.689476 MPa
  - Input Voltage: 24 VDC
  - Input Current: 4-20 mA
  - Output Voltage to Arduino or measuring device: 1.0 - 5.0 VDC (using 250 ohm resistor, .004 A * 250 ohms = 1V, .020 A * 250 ohms = 5V 
**************************************************************/

int inputPin = A0;
float Voltage = 0;
const float  Offset = 0.00;
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) / 818.4) * 4 + Offset; // Gets you V, using 4 due to 1-5V range based on 4-20 mA range using 250 ohm resistor

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

  Pressure = (Voltage - 1.00) * 172.36893232945;  // Calculate pressure --> 689.4757293178 kPa / 4V = 172.36893232945 kPa/V (read out using 250 ohm resistor is 1-5V)
  Serial.print("Pressure = ");
  Serial.print(Pressure, 4);
  Serial.println(" KPa");
  Serial.println();

  delay(4000);
}

Serial.print(Pressure, 4); // wishful thinking

In kPa, you're not even getting a one decimal place accuracy from the sensor.
Leo..

True...
0.55158058345 kPa (.08 %)

Here is newer code it is nice that it's simpler.
Thanks.

/************************************************************
  Pressure Sensor Key Parameters
  - Part No.: Omegadyne PX-409
  - Accuracy: ±0.08% BSL Includes Linearity, Hysteresis,and Repeatability (Linearly corresponding to 0 - 0.689476 MPa)
  - Sensing range: 0 - 0.689476 MPa
  - Input Voltage: 24 VDC
  - Input Current: 4-20 mA
  - Output Voltage to Arduino or measuring device: 1.0 - 5.0 VDC (using 250 ohm resistor, .004 A * 250 ohms = 1V, .020 A * 250 ohms = 5V
**************************************************************/

int inputPin = A0;
const int  Offset = 194;
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();

  Pressure = (analogRead(inputPin) - Offset) * 689.4757293178 / ( 1023 - Offset); //(measured A/D value - 4mA A/D offset) * sensor max rating  / (20mA A/D value - 4mA A/D offset)

  Serial.print("Pressure = ");
  Serial.print(Pressure, 2);
  Serial.println(" KPa");
  Serial.println();

  delay(4000);
}

Some serial output results:

/** Water pressure sensor measurement **/
Raw Value = 195
Pressure = 0.83 KPa

Raw Value = 194
Pressure = 0.83 KPa

Raw Value = 194
Pressure = 0.83 KPa

Raw Value = 195
Pressure = 0.00 KPa

Raw Value = 195
Pressure = 0.00 KPa

Raw Value = 195
Pressure = 0.00 KPa

Raw Value = 194
Pressure = 0.00 KPa

Raw Value = 195
Pressure = 0.83 KPa

Raw Value = 194
Pressure = 0.00 KPa

Raw Value = 194
Pressure = 0.83 KPa

Raw Value = 195
Pressure = 0.83 KPa

Raw Value = 195
Pressure = 0.00 KPa

Raw Value = 195
Pressure = 0.00 KPa

Raw Value = 195
Pressure = 0.00 KPa

Raw Value = 194
Pressure = 0.83 KPa

Raw Value = 195
Pressure = 1.66 KPa

If I wanted a cleaner 5V output from the Arduino and
still use the USB outlet to view serial results on my pc,
would inputting a clean dc source work through the dc jack or Vin?
Will the USB port automatically be the default voltage source at that point?

What about something like this?
5-12V to 3.3v dc converter with 30mV ripple
I know this outputs 3.3V but they sell other versions of this that outputs 5V dc.
If I understood it correctly output voltage would vary by 30mV, so 5 to 5.03?
I wonder if there is something more accurate out there?

See that the readout jumps in 0.83kPa steps.
No use displaying that with two decimal places, or even one.

You can improve that course jumping with smoothing code (oversampling).

Those jump problems will disappear with the ADS1115.
You can't however get a better (realistic) than 0.1kPa display with that sensor.
Leo..

knightridar:
If I wanted a cleaner 5V output from the Arduino...

Told you to forget about default Aref for that reason.
Use the buildin 1.1volt Aref, and a ~50ohm resistor.
Leo..