04-20 mA Pressure Transmitter Reading with Arduino

I have a 04-20mA Wika Pressure Transmitter type S-10-3A (link to item below).

I am trying to get accurate readings and am having trouble with it. the code I am currently using is below, taken from another post on the forum with a similar issue. I have the positive terminal of the transmitter connected to a 24 V power supply, the negative terminal connected to 250 ohms of resistance to the negative terminal of the 24 V supply along with 250 ohms in series with the Arduino.

"
int inputPin = analogRead(A0);

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

void loop()
{
Serial.print("Raw Value = " ); // shows pre-scaled value
Serial.print(analogRead(A0));
Serial.println();
delay(2000);
}”

When connecting my transducer to a multimeter it seems to be getting accurate readings between 04-20mA, but when I connect it to the 250 ohm arduino assembly the readings are random, with values ranging tremeoundusly without applying pressure to the transmitter. Has anyone had a similar issue and if so, is there any examples of code, or wiring tips that they used that made your readings more accurate. I am using a breadboard, and am honestly not too sure if I wired it properly. I also tried a soldering assembly, where i soldered the components together and the same issue persists.

Please use pen and paper and make a wiring diagram, and attache it. Those Shakespeare type of diagrams aren't very good.

You need to declare the input pin better I think.
Like this:   pinMode(charge_button, INPUT); or

  pinMode(charge_button, INPUT_PULLUP);

Normaly done in Setup().

You don’t need to declare pins for analog input , ( so drop the int inputPin bit ), but I expect you have a wiring problem .
You also need some protection for the input in case a wire cones off and you put 24v in the input -series resistor/ zener maybe?

Do you have the 24V GND connected to the Arduino GND? Put a 22k resistor between the Arduino input pin and the sense resistor to protect the Arduino from the 24V.

Good to protect the project for future possible issues but anyone having an idea about the current issue?

If the readings are random and varying all over the place, I would guess a lack of reference (no signal return). Why don't we wait for a response from the OP?
BTW: Analog input pins do not need to be pinModed.

@JCA34F
Karma++
It is a too oftenly observed situation that helpers are on high alert letting advice rain on OP.

Many times uneasy OPs are told to wait for helpers ending their sleep. Of course, OPs might be sending his/here question late during the day and, naturly, goes for his/hers sleep.

Being OP some years ago I faced the same situation, being bombarded with lots of advice. I didn't manage to follow up every advice and was told to quit electronics by one "helper".

The reason the 22k resistor was suggested was IF the connection anywhere between the 250 Ohm sense resistor and GND failed, the sensor would output up to it's maximum voltage trying to drive 4mA through a high resistance or open circuit, and forcing how much current through the input pin's protection diode and into the 5V Vcc circuits. 27k would be better (in case the Arduino was unpowered) but that's getting up in the too high impedance range.

gewwda, I had a project that needed to monitor 100 4-20 mA Pressure sensors
I found the device in the link below to be very reliable, gave very consistent values.

https://www.circuitar.com/nanoshields/modules/adc-4-20/index.html

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile: