Activity › Forums › Questions & Troubleshooting › 24V 4-20mA industrial temp sensor, how to connect/read?
-
24V 4-20mA industrial temp sensor, how to connect/read?
-
Hi all,
Let me introduce myself, my name is Wouter. I work for a company Sensor Partners in the Netherlands. Through the use of Controllino we are trying to industrialize the use of Arduino paired with our industrial sensors.
In my spare time I get to play around with Arduino/Controllino to test some of our sensors and combine them with self made sketches.Since a lot of our sensors (the analog ones) work with a 4-20mA signal I’m trying to get the Controllino to read this signal, I’m having a hard time getting it to work though.
I am using a Calex PyroMini OEM sensor, with a 2-wire 4-20mA current loop.
The one I have here is a -20 – 100°C version.
https://www.calex.co.uk/product/temperature-measurement/infrared-temperature-sensors/pyromini-oem/
I have the Controllino and the sensor connected to the same TDK-Lambda DRL60-24-1 24Vdc power supply.From what I gather from the Controllino manual when connected to a 24V supply the analog input measures between 0-26,4V.
<font face=”inherit”>Am I correct to assume that this means the 0 – 1023 values are scaled over this range?</font>
<font face=”inherit”>And that therefor I would make the best use of this range if I convert the 4-20mA to as large as possible voltage range within 0-26,4V?</font><font face=”inherit”>Following Ohms law I figured using a 1kOhm resistor would scale my 4-20mA to 4-20V (1-on-1 conversion).</font>
<font face=”inherit”>So I set out to work. I made the following connection:</font>
<font face=”inherit”>Sensor + goes directly to V+ (24V)</font>
<font face=”inherit”>Sensor – goes to V- through a 1kOhm resistor and also goes to A0 directly</font>
<font face=”inherit”>Sensor shield is grounded to the dinrail</font>
<font face=”inherit”>Controllino GND is connected to V-</font>
<font face=”inherit”>Controllino 24V is connected to V+ (24V) </font>https://photos.app.goo.gl/YfFoKN5mQ4zdRTDu7
<font face=”inherit”>The above is what I gathered from Googling and other topics in this forum.</font>
<font face=”inherit”>Now the problem I face is that the measurement results through an analogRead of the sensorValue are very close to each other and do not run through the entire 0-1023 range as I expected. </font>
<font face=”inherit”>I tested room temperature (my desk), body temperature (my hand) and a fresh hot cup of tea. The values I get (I do not remember them exactly) are somewhere between 50 and 75.</font>
<font face=”inherit”>By my calculations I expected the following:</font>
<font face=”inherit”>-20°C = 4V = 155</font>
<font face=”inherit”>0°C = 6,66V = 258</font>
<font face=”inherit”>20°C = 9,33V = 361</font>
<font face=”inherit”>80°C = 17.33V = 672</font>
<font face=”inherit”>100°C = 20V = 775</font><font face=”inherit”>So for my desk I expected 361 or something in that </font>neighborhood<font face=”inherit”>, and for the hot cup of tea I expected something between 672 and 775.
</font>
What am I doing wrong?- This discussion was modified 3 years, 9 months ago by Grimmie.
-
Apologies, not sure where these “font” HTML codes came from, I didn’t put them there…
-
To be complete, this is the code I use:
/*
ReadAnalogVoltage
Reads an analog input on pin 0, converts it to voltage, and prints the result to the Serial Monitor.
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/ReadAnalogVoltage
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
}
-
-
Did you take into account (see datasheet of sensor):
Minimum Sensor Voltage
8 V DC (all other models)Therefore you’d be better off if you’d be using a MAXI Automation (0-10V input) and a 500 Ohm resistor.
- This reply was modified 3 years, 8 months ago by Friedl. Reason: typo fixed
-
Hi Friedl,
Thank you for your reply.
I must admit that I did see minimum supply voltage @8v for the sensor. I ignored that for convenience sake. Because the readings did change with the temperature I asumed the sensor still worked, furthermore @100C the voltage would have been well over 8v, but the reading did not change significantly.
That being said, you might be right this is an issue. I do however not see how using the Maxi Automation in 0-10v with 500ohm resistor would help my situation, am I missing something?
The more I think about it I start to see this sensor simply isn’t suited for 4-20mA to 0-10v conversion. Because of it’s two wire construction, the power supply and signal share the same wires.
Perhaps I should try again with a 3 wire sensor, where power and signal are separated.
-
You need to give the sensor “space to breath” (=enough voltage left), otherwise it just won’t work.
If you take this setup (from the product page):
https://www.calex.co.uk/site/wp-content/uploads/2020/01/pyromini-oem-connections-4-20-ma-1024×411.png
and add the 500 Ohm resistor across the +/- of the instrument shown in the picture, which would then be your Controllino, we can conclude:- 0,020 A * 500 Ohm = 10V
- 0,004 A * 500 Ohm = 2V
- 24V – 10V = 14V > 8V ! (24V power supply assumed)
And BTW (see datasheet):
Max. Loop Impedance
900 Ω (4-20 mA output)Put aside your Controllino, only leave the resistor, take a digital multimeter and verify your setup first. When you know what voltages are to be measured, verifying what you measure with the ADC is much easier.
- This reply was modified 3 years, 8 months ago by Friedl. Reason: Stray DIV tags from the editor again. (PLEASE FIX THIS)
-
When you successfully verified the sensors output voltage, you can even
replace the sensor and the resistor with a lab power supply. This makes verifying your code much easier.
-
-
Log in to reply.