I seem to be stumped a bit on a seemingly simple problem ... my thermistors are reading backwards. For example, if I add heat, the printed value decreases ....
anyone out there have this happen to them?
any suggestions?
thanks in advance!
I've been working with a couple pieces of code .. one real simple for debugging the sensor .. the other I found online and is a bit too long to post but both have the same problem...
int T1 = 0;
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
val = analogRead(T1);
digitalWrite(ledPin, HIGH);
delay(val);
digitalWrite(ledPin,LOW);
Serial.println(val,DEC);
}
A Negative Temperature Coefficient (NTC) Thermistor will decrease in resistance as temperature increases.
A Positive Temperature Coefficient (PTC) Thermistor will increase in resistance as temperature increases.
Also, how do you have this wired up? If it is hooked up like so:
v+
|
thermistor
|
analog pin
|
10K resistor
|
GND
And you have an NTC Thermistor, as the temperature increases, the resistance of the Thermistor will decrease and the voltage will increase.
If in this case you have a PTC Thermistor, the resistance will increase as the temperature does and the voltage will drop.
If the circuit is wired as follows
V+
|
10K resistor
|
analog pin
|
Thermistor
|
GND
The circuit will behave as follows:
NTC: the resistance will drop as temp rises, the voltage will decrease
PTC: the resistance will increase as temp rises, the voltage will increase
From your description, I'm assuming you are using something similar to circuit 1 and a PTC Thermistor
or
a circuit similar to circuit 2 and an NTC Thermistor.