1K RTD Sensor: voltage to temp conversion - Solved! See library for 1K RTD code provided by LarryD!

I have an older Johnson Controls 25-5700 1K RTD sensor that has long been out of production.
No luck on finding a datasheet. This thing is like 30 years old but still functions just fine and I would like to use it as an outdoor air sensor in an UNO equipment monitoring sketch.
I am trying to figure out the best way to interpret the sensor input resistance/voltage. I have discovered various online code examples but most use a reference coefficient value for a specific sensor.
This 2-wire sensor is tied into my UNO analog input like so:

1K resistor_________ > +5vdc
:
:____________________> Analog In
:
:1K Sensor
> Gnd
RTD

At 72F room temp this arrangement gives me around a +2.5 vDC input. As the temperature increases the sensor resistance rises and voltage level drops.
Voltage Test Liquid Temp Raw analog input data Sensor Resistance w/ meter
2.05 212 DGF 1415 1433
2.65 32 DGF 537 876

I was able to use some online code and get a mid-scale readout of the voltage input but have been unable to figure out how to interpret the data over the range of the sensor. It only needs to read accurately between 10 DGF and 100 DGF. This sensor changes about 3 ohms per degree or .003 vDC per degree; the resistance goes one way while the voltage goes the other. Would it be wiser to not convert the input to a voltage value and just go with the raw data input? And then make some sort of extrapolation table?
If you look at the screenshot you can see about a third of the way down where the temp
sensor was placed in a glass with ice and the temp started to go "UP" at that point. The 24.62 reading at the top was the temp probe at room temp (72F). I have played with the input values but nothing seems to get close to a valid value.

Here is code I used to get voltage value:

int analogPin = 2;
int raw = 0;
int Vin = 5;
float Vout = 0;
float R1 = 1000;
float R2 = 0;
float buffer = 0;

void setup(){
Serial.begin(115200);
}

void loop(){
  raw = analogRead(analogPin);
  if(raw){
    buffer = raw * Vin;
    Vout = (buffer)/1024.0;
    buffer = (Vin/Vout) - 1;
    R2= R1 * buffer;
    Serial.println();
    Serial.print("Vout: ");
    Serial.println(Vout);
    Serial.println();
    Serial.print("R2: ");
    Serial.println(R2);
    delay(1000);
  }
}

And this is the code to try and get a valid reading:

#include <Wire.h> 

const int analogInPin = A2; 
const int SensorValueLow = 537; 
const int SensorValueDiff = 878; // difference between high and low sensor value
const int TempValueDiff = 180 // difference between high and low Temp value
const int TempValueLow = 32;

int sensorValue = 0;
double Temp = 0;

void setup() 
{
 Serial.begin(115200);
}

void loop() 
{
  sensorValue = analogRead(analogInPin);
  Temp = sensorValue-SensorValueLow;
  Temp = Temp/SensorValueDiff;
  Temp = Temp*TempValueDiff;
  Temp = Temp+TempValueLow;

  Serial.print(sensorValue); 
  Serial.print(Temp); 

  delay(200); 
}

Going to recommend you place the RTD in your museum box then buy a DS18B20 for $1.00

Measures Temperatures from -55°C to +125°C (-67°F to +257°F)
• ±0.5°C Accuracy from -10°C to +85°C

Or ask Mrs. Claus for a stocking stuffer.

1 Like

I have several DS18B20s already employed. I just wanted to utilize this particular sensor
as something different.

If I was doing this, I think these would be the steps:

  • For maybe 20 to 30 readings (from 10 to 100 °C) I would record the temperature of a water bath against the raw Analog readings.

  • Place these two columns of data in Excel.

  • Using the Linest function, get Excel to give you the formula for the resulting graph.

  • Use this formula in an Arduino sketch to convert the sensor readings to temperature.

Is that a PT1000 RTD, does it have that sort of response?
If so Google;

pt1000 rtd arduino

Tom... :smiley: :+1: :coffee: :australia:

Nah, its not a platinum sensor, rather nickel. But I did type in your suggestions and found another algorithm from another Arduino forum sensor thread:

Calibrating a PT1000 RTD sensor - #5 by dariusCurt

I did find some datasheet info at:

The 25- 5700 series has been replaced by the T-6000-1. The resistance values in that chart are verybsimilar to what I ohmed out on the 25-5700.
I just need to figure out how to make an interpolation table to convert the raw input.

Attach your table of analog readings verses temperatures and I'll see if a formula can be created from the set of data.

example
Analog readings
20, 40, 60, 100, . . . 1023
Temperature readings
10, 20, 30, 40, . . . 100

I can do that. It will take a bit of time.
Essentially this 1K Nickel sensor tracks along a path of 3 ohms per degree F rise or 5.4 ohms
per degree C rise according to the datasheet:

[https://cgproducts.johnsoncontrols.com/met_pdf/24403426.pdf]
Temperature Coefficients (All Positive and Approximate)
Nickel: 0.15, 1.0, 1.5 and 3 ohms/F° (0.27,1.8, 2.7, and 5.4 ohms/C°)
for 50, 333.3, 500, and 1,000 ohm elements respectively
Platinum: 2.2 ohms/F° (3.9 ohms/C°)
Reference Resistance At 32°F (0°C) TE-6359-1: 1,00

That also works out to a decreasing .003 vDC per 1 degree F rise:

2.05 vDC @ 212 F
2.63 @ 32
2.65 @ 26
2.73 @0 F

I have a sketch that will readout the RAW input and will need to reference that for
any Raw data numbers needed to be used. Its 11:30 pm so I will get back on providing more data.

Rather than the DC voltage, just give me the raw analog values, i.e. 0 to 1023. vs temperature.

If you are interested in 10C(F) to 100C(F), include these in the data set and a good number of elements in between 10C(F) and 100C(F).


I assume you will place the RTD in a bath and will raise the temperature bit by bit to generate the readings for your actual sensor.

Get the A/D values at various temperatures and put them in a spread sheet , draw a graph .
You can then curve fit the data and use the resulting equation in your sketch .

Or a suggested , just use a DS18B20 sensor - job done

10-4 ... :+1:

Please just consider a 95-cent 10K NTC as almost all examples are based on the use of a 10K resistor to form a voltage divider.

Thermistor 10K - SEN-00250 - SparkFun Electronics

Note: AliExpress sells this stuff for less. Multiple electronics parts warehouses too.

I guess I should share that I have an unusual sentimental attachment to this temperature
sensor. I have had it in my possession for nearly thirty years from when I worked as an building automation technician decades ago. It is something I would to incorporate into my current project monitoring a boiler house. I have other types of sensors already employed that do a great job. I just want to use this one as well. Call me quirky. Lol

I have some RTL and DTL gates that have the same status :nerd_face:

Similar to these:

image

Ok Larry, here ya go:

25-5700 Sensor Data.ino (436 Bytes)

A couple candy making thermometers and a tray of ice cubes later...lol

I didn't immediately realize all uploads are changed to .ino extensions.

Mister Ed

Those are sexy looking...kinda look like mini water towers....lol

1961 water towers :nerd_face:


Your formula should be:

Temperature = (0.00329 * RAW * RAW) - (4.66508 * RAW) + 1588.651

1 Like

int temp;

This should be

float temp;

It would be recommended to look at a rolling/moving/sliding average.

1 Like

Larry,

Undoubtedly you ARE the "Algorithm God" :place_of_worship: I have been seeking these past couple weeks!!!!
Your calculation is within a degree, if not spot on, I am very happy to report!!!!

Is there any issue within adding a "temp adjustment" parameter to your result if I wanted to "dial in" the sensed value? It wouldn't be much from what I can tell right now.

Again, I am so fortunate to have you extend your calculation prowess my way!

Thank you very much.

Your faithful follower/adherent (LOL),

Mister Ed