ok so i found i need to read liquid temperatures off an termister (2pin)
I dont have the specs or any datasheets for it. What i did was measured the resistance in a glass of ice cube water (5.20 ohms) and in boiling water (0.4 ohms), now what i dont understand is how to use thes ref points to calibrate in teh code ?
What i did was measured the resistance in a glass of ice cube water (5.20 ohms) and in boiling water (0.4 ohms), now what i dont understand is how to use thes ref points to calibrate in teh code ?
The thermistor is used as part of a voltage divider. So, what you need to do is read the analog pin with the sensor in the circuit, and record the reading when it is in ice water (0C) and boiling water (100C). The actual resistance of the sensor is of little use, without knowing what the other resistor value is.
When you have minimum and maximum analog readings, you will be able to determine actual temperature quite easily.
With resistances like that, you're going to need a low value resistor at the other side of the voltage divider. 5 ohms would be about right to get a reasonable balance, but with 5 volts across 7-8 ohms its going to use a lot of power and the thermistor/resistor is going to get warm/hot and completely negate any temperature you're trying to read.
You really want one with a resistance of about 10k ohm at room temperature to make life easy.
I forgot to mention, when measureing the resistance of the sensor it was hooked directly to a multimeter at 20k setting and those where the readings ...
Do i need to first hook it up to a voltage divider with other resistor a 10k resistor and then measure the voltage at the junction at 0Deg and 100Deg ?
the other issue also is that the temps sometimes goes below -5 to 0 and above 100 to about 130 would would knowing the 0 and 100 work with this ?
Do i need to first hook it up to a voltage divider
Yes, you do. A 10K resistor forms one side of the voltage divider. The thermistor forms the other side. The midpoint goes to the analog pin. One end goes to +V, the other to ground.
I forgot to mention, when measureing the resistance of the sensor it was hooked directly to a multimeter at 20k setting and those where the readings
Big difference between 5.2 Ohms and 10400 Ohms.
the other issue also is that the temps sometimes goes below -5 to 0 and above 100 to about 130 would would knowing the 0 and 100 work with this ?
The 0 and 100 degree readings define two points on a line. If you then use the readings at 0 and 100 as the from range in a map call, values outside that range will still be mapped correctly (negative temperatures and above 100 C readings), presuming that the sensor IS linear and functions from below 0 to above 100 (a big assumption).
Does this mean that 5.20 reading at 20k setting = 5.20* 20 000 ?
giving 10400ohm ? sorry for n00bness but just getting to terms with this and loving it ,,,
Will redo the measurements once i the hardware hooked up fully with the voltage divider.
Something else to keep in mind (which you will only be able to find by experiment) is that some thermistors aren't linear in their response; I've seen datasheets where the graphs of response were like this (curved). So with two data points (freezing and boiling), that might not give you the whole picture (and if the graph is non-linear, readings outside of freezing/boiling might be meaningless).
Ok so i connected up the 10k pot as part of the dividor, and i thouhg id wire up an LM35 just to use a reference to see if thermistor is on track,
what i notice when i connect up the thermistor to the analog pin from the junction on the 10k res, the reading on the lm35 start jumping around ...
then remove pin from the thermistor and the lm35 settles down..
Rechecked the wiring all 100%
A multimeter reading 5.2 on the 20k setting is almost certainly 5.2k ohm. The range denotes the maximum reading on that range. Having 2xxx usually denotes its using a 3.5 digit display (the first digit either isn't used or its a 1 depending on the reading) 20k would give a reading of up to 19.99 k
Heres the Sketch, i know the code for the themistor is incorrect but right now i just want to figure out why the lm35 reading is going all nuts when i connect up the thermistor.
// include the library code:
#include <LiquidCrystal.h>
#include <math.h>
double Thermister(int RawADC) {
double Temp1;
Temp1 = log(((2252800/RawADC) - 2200));
Temp1 = 1 / (0.001129148 + (0.000234125 * Temp1) + (0.0000000876741 * Temp1 * Temp1 * Temp1));
Temp1 = Temp1 - 273.15; // Convert Kelvin to Celcius
//Temp1 = (Temp1 * 9.0)/ 5.0 + 32.0; // Convert Celcius to Fahrenheit
return Temp1;
}
//TMP36 Pin Variables
int sensorPin = 1;
int ThermPin = 4;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop() {
//getting the voltage reading from the LM35 temperature sensor
int reading = analogRead(sensorPin);
// converting that reading to voltage, for 3.3v arduino use 3.3
float voltage = reading * 4.93;
voltage /= 1024.0;
int thermreading = analogRead(ThermPin) ; //read the thermister
float thermvoltage = thermreading * 4.93;
thermvoltage /= 1024.0;
// print out the voltage
Serial.print(thermvoltage); Serial.println(" Therm Volts");
Serial.print(voltage); Serial.println(" LM35 volts");
// now print out the temperature
float temperatureC = (voltage) * 100 ; //converting from 10 mv per degree wit 500 mV offset
//to degrees ((volatge - 500mV) times 100)
lcd.setCursor(0, 0);
lcd.print(int(Thermister(analogRead(ThermPin))));lcd.print(" Therm deg");
Serial.print(int(Thermister(analogRead(ThermPin)))); Serial.println(" therm degs ");
lcd.setCursor(0, 1);
lcd.print(temperatureC);lcd.print(" LM35 deg");
Serial.print(temperatureC); Serial.println(" LM35 degs ");
delay(1000); //waiting a second
}
Are you sure that is a Thermistor in your picture? Why does it have what looks like an adjustment shaft? Are you sure you don't have a thermostat that opens and closes a contact when above or below an adjusted setpoint? Most thermistor I've seen look like a small diode or resistor or tantalum cap.
It probably is a thermistor, but in an automotive/industrial packaging. Designed to screw into a vessel/pipe holding liquid. I'd hazard a guess at old school engine temperature sensor. What looks like a shaft is where the thermistor lives so its well out in the liquid.
It probably is a thermistor, but in an automotive/industrial packaging. Designed to screw into a vessel/pipe holding liquid. I'd hazard a guess at old school engine temperature sensor. What looks like a shaft is where the thermistor lives so its well out in the liquid.