4-20mA sensor read by an arduino

Thread Starter

Nicolas Chalhoub

Joined Jul 20, 2015
3
Good morning everyone.
In my company we have a chlorine sensor that gives a 4-20mA output and a controller that displays the output on a screen with specific units.
How can i replace this controller and use an Arduino Uno (That's what i have right now). I know it has an analog inputs, but any more information about the program i must write?
In summary, i want to replace the chlorine controller with an Arduino, that can read the Chlorine sensor's 4-20mA output.

Thanks in advance.
 

Alec_t

Joined Sep 17, 2013
14,280
Welcome to AAC!
In principle you need to pass that current through a resistor chosen such that 20mA gives a voltage across the resistor no more than the supply voltage of the Arduino, then use the ADC converter in the Arduino to read the resistor voltage. Sorry, I don't do Arduino, so can't help with the program, but others here hopefully can.
 

strantor

Joined Oct 3, 2010
6,782
Do you have any good reason to replace an industrial grade, purpose-built controller that has been designed and approved for use in control of hazardous processes, with a generic consumer-level hobbyist platform that is required to meet absolutely none of the same criteria? Do you have any good reason to take that kind of liability onto yourself? Do you have the money to pay people's children and spouses for the rest of their lives when you kill their breadwinners by hazardizing a deadly chlorine operation?

If the answer to all of those questions is "yes," then simply place a precision 250 ohm resistor across the 4-20mA output and it turns into a 1-5V output.
 

Thread Starter

Nicolas Chalhoub

Joined Jul 20, 2015
3
Hehe, Thanks for your concern, but i want just to read the Chlorine amount, i just need to put a LCD on the bread board next the arduino.
And the dosing pump that pumps aqua chlorine runs independently.
I just need to know the necessary program to convert this 4-20mA signal coming from the sensor to a well read ppm unit.
Thanks.
 

AnalogKid

Joined Aug 1, 2013
10,987
Max and others know more about industrial controls than I do, but as I understand things a 4-20 mA loop can originate at either end of a sensor - display system. If the sensor generates the current loop with the information modulated onto it, then indeed a single precision resistor at the A/D input might be all that is needed. But if the sensor expects the remote controller/display to generate the current loop, which it then derives operating power from and modulates its data onto, then you need to create the current loop as well as extract the analog data for the A/D. Do you know where the 4-20 mA loop source is?

ak
 

strantor

Joined Oct 3, 2010
6,782
if the sensor expects the remote controller/display to generate the current loop, which it then derives operating power from and modulates its data onto, then you need to create the current loop as well as extract the analog data for the A/D.
True, but this is trivial. The sensor will (in all likelihood) be either a 2-wire or 3-wire 24VDC sensor. If 2-wire, connect the positive sensor lead to +24V, negaive to 250ohm resistor, other end of resistor to GND. If 3-wire, connect the positive sensor lead to +24V, negaive to GND, and SIG to 250ohm resistor, other end of resistor to GND.
 

shteii01

Joined Feb 19, 2010
4,644
like others already said, Uno does not have facility/feature to read analog current.

you have to convert current into voltage, then feed the voltage to Uno ADC. the use of the resistor is by far the simplest way to do it. but you will have to figure out how precise you need to be.
 
Top