Interface with industrial devices

I was searching tru the forum of how to use 4-20mA output of industrial devices to work with an arduino in the 0-5volt range. I have been looking for schematics on how the wiring works with the resistor in place. I found one in this forum but the schematic is broken so I cant see anything.
I know how to code the arduino I just need the schematic to wire the device.
I will be using a 3 wire pt100 connected to a 4-20mA output paq by inor.

Any help would be great.

4:20madc will need a resistor to change current to volts.
you need to know the voltage of the 4-20.
typically, use a 500 ohm resistor to get 2 to 10 [ op's NOT 1 to 5 volts ]
use 250 ohm to get 2 to 5 volts
connect that to your analog pin to get 205 to 1024 or a span of 819 or so steps.

divide your temperature range of the transmitter into 819 steps to know how much resolution/sensitivity your device will be with the Arduino.

if you have a 100 degree span, then you will have a sensitivity/resolution of 0.125 theoretical. your transmitter may not be that accurate.

if your transmitter span is 819 degrees, then the arduino would have a resolution of 1 degree.

What voltage is the Industrial Device delivering that output and how fast does the signal change.

Is that output for sure analog?

I am supplying the the paq with 12volt dc. The paq only allows 4-20mA (0-120C) to flow through it.
The arduino can not measure current so I must measure voltage instead.
What I gave gathered so far is... if the temperature is at its maximum 120C then the paq will have 20mA current flowing through it.
Taking that into account 20mA x 154ohm resistor inline on the negative wire = 3080mV. So then the Arduino can measure the voltage and 3080mV would then be 120C. That all should be right.

How do I hook this up to the arduino?
Arduino ground to one side of the resistor and A0 on the other side of the resistor?

Use a 51ohm resistor, or 2x100ohm in parallel if you can't get one.
Connected between an analogue input and ground.
20mA current through that resistor produces 1volt.
Read that with the internal 1.1volt Aref enabled (much more stable than the default Aref).

Leo..

as a note the cheap and dirty way is to toss a resistor across the current to get a voltage. since you start at 4 ma, you will not get a 0 volt reading and will only get to read 80% of the range.

as an alternate, you can buy a current to voltage module with op-amp that can give you the 0 and 5 volts with a pot for zero and span adjustments.

It turned out I don't have the code figured out.

So I hooked it all up like this...
13.8volt to the transmitter.
250ohm resistor inline on the negative wire.
One side of the resistor to ground on arduino and the other side to A0.
On my multi meter the voltage across the resistor is 1v with 4mA current flowing through the circuit.
20mA flowing through the circuit gives me 4.94 volt across the resistor.

Now in my case 20mA equals 120 Celsius and 4mA equals 0 Celsius

Now my code when 20mA is flowing i get 120 Celsius (which is right)
But when 4mA is flowing I get 24.050 Celsius (which should be 0)

this gets hooked up to a PT100 - http://www.acdc.co.za/rhomberg/docs/RTD_PT100temp.pdf

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
lcd.begin(16, 2);

}

void loop() {
float voltage = sensorValue * (120 / 1023.0);

lcd.setCursor(7,0);
lcd.print(voltage);
delay(100);
}

dave-in-nj:
as a note the cheap and dirty way is to toss a resistor across the current to get a voltage. since you start at 4 ma, you will not get a 0 volt reading and will only get to read 80% of the range.

as an alternate, you can buy a current to voltage module with op-amp that can give you the 0 and 5 volts with a pot for zero and span adjustments.

thank you, makes more sense now why I only get 24 Celsius at 4 mA. So my code posted above is actually correct.
I have seen some of these paq's go lower than 4mA, so it might still work. Will test it later with a glass of ice water.

You need to subtract the 'live' zero from Vout. degrees C = ((Vout-1)/4)*120

tf68:
You need to subtract the 'live' zero from Vout. degrees C = ((Vout-1)/4)*120

Where does that fit in the code? Vout = 4.99 so ((4.99-1)/4)*120 = 119.77

The code I have gives me the same result...
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
lcd.begin(16, 2);

}

void loop() {
float voltage = sensorValue * (5 / 1023.0); //convert analog input 0 - 1023 to 0 - 5 volt
float temp = voltage * 24; // scale the voltage to a known temp 0 - 5 volt to 0 - 120C
lcd.setCursor(7,0);
lcd.print (temp);
delay(100);
}

With this code I get 120C at 5 volt and should give me 0 at 0volt

Is this correct? Is this a viable solution?

Hobby coder, so I could be wrong.
Untested.
Leo..

``````int offset = 204; // 0 degrees adjust
float temp;

void setup() {
lcd.begin(16, 2);
}

void loop() {
temp = (analogRead(A0) - offset) * 120.0 / (1023 - offset);
lcd.setCursor(7, 0);
lcd.print (temp, 1); // one decimal place for 10-bit A/D
delay(500);
}
``````

dave-in-nj, so others don't become confused, with your earlier post:

dave-in-nj:
4:20madc will need a resistor to change current to volts.
you need to know the voltage of the 4-20.
typically, use a 500 ohm resistor to get 2 to 10 [ op's NOT 1 to 5 volts ]
use 250 ohm to get 2 to 5 volts

Dave, with a 4-20mA loop, a 250Ω resistor will give 1 to 5 volts, not 2 to 5 volts.
You are correct with the 500Ω giving 2 to 10 volts.

You say you need to know the voltage, why ?
It is a current loop and regardless of the voltage, a certain value resistor will drop a calculable voltage drop according to the loop current. At 20mA and a dropping resistor of 250Ω, it will only ever produce 5 volts.

The thing to watch is that some industrial 4-20mA transmitters have an expanded range, for example some go to 22 or even 24mA for over range conditions. If this is the case, then you need to allow for this in the circuit design.

All in all, using a 10 bit ADC such as in the Arduino is often not a good choice when interfacing to 4-20mA transmitters as valuable span is lost, 20% in fact.

Keeping in mind that the internal ADC was not designed for accuracy or performance, I would be cautious with using the internal ADC for such applications.

Some times it is better to purchase a more appropriate ADC, with either an I2C or SPI interface.

Paul

O.k, so I don't think I will be using the pt100 with the arduino anymore.
Thanks for all the replies.