How to interface 4-20ma sensor to arduino?

Does anyone know how to wire up a 12 volt, 4-20ma sensor to the analogue input of an arduino so I can get some pressure readings?

The way it's normally done is to run the current loop through a 250 ohm resistor, the resulting voltage drop and measurement range across the resistor would then be 1-5vdc. This will only work if you can connect the loop power supply's negative terminal directly to the arduino ground. The resulting current loop would then be from ground through the 250 resistor to the device and then to the + loop power source. The high side of the resistor would wire to the Arduino's analog input pin. By the way 12vdc is down near the bottom of loop voltage specs for most 2 wire devices, as 24vdc is more normal.

Lefty

Thanks lefty.

Just getting the connections right.....

I would do the following?:

  • connect the 12v supply ground to Arduino ground.
  • connect a 250 ohm resistor between ground and arduino analogue pin.
  • connect the +ve wire of sensor to +12v
  • connect the -ve wire of sensor to arduino analogue pin

Also I am running Arduino at 3.3 volts to interface with an Xport device. I assume that the resistor should now be ~160 ohms?

Yes, the wiring sounds correct. Yes, the 250 ohm resistor would have to change if your A/D voltage reference is 3.3vdc. You might be better off using a 10 turn 500 ohm pot instead of a fixed resistor, so as to set the resistance value just right for whatever your Arduino voltage regulator happens to be at. That way you could calibrate the loop by forcing it to 20ma and adjusting the pot until the A/D conversion equals 3FF Hex. Then fource the loop to 4 ma and note the A/D counts for your 'zero' amount.

By the way the reason they use 4-20ma instead of say 0-20ma for the measurement loop is a concept called 'live zero'. It's so the measurement system can tell the difference between a valid field zero measurement value and a broken current loop. If there is 0 ma in a 4-20ma loop then the measurement system 'knows' that it's an invalid measurement and ignore the reading. Later with low power electronic components they were able to utilize the 0-4ma power to acutally power the remote field sensor. Also the use of current loops means the wiring to the remote sensor can be hundreds and even a few thousand feet long without effecting the accuracy of the measurement, no voltage drop worries as current is the same in any part of the loop.

Lefty

Thanks Retrolefty,

I was curious why they didn't go from 0 to 20 ma.

That trim pot sounds like a good idea too.

Cheers