Go Down

Topic: Arduino Thermistor (Read 1 time) previous topic - next topic

wildbill

As Si suspected, you're using code that's looking for characters sent from the serial monitor to tell it what to do. At this point you need (as he says) something more minimalist to check your wiring. Such as this:
Code: [Select]
#define analogPin 0
#define beta 4090 // from your thermistors datasheet
#define resistance 33

void setup()
{
Serial.begin(9600);
Serial.println("Ready");
}

void loop()
{
long a = analogRead(analogPin);
float temp = beta / (log(((1025.0 * resistance / a) - 33.0) / 33.0) + (beta / 298.0)) - 273.0;
Serial.println(temp);
delay(1000);
}


It wouldn't hurt to print out the value of 'a' too.

uink

I used wildbill's code, and now it is printing numbers!
It is printing 29.89; however i don't know what this number represents.  Where i am, it is currently 68F.   
Thank you!

Si

The calculation is for deg C. But its not that hot :)

Does the number go up when you put your finger on the Thermistor?
--
My New Arduino Book: http://www.arduinobook.com

uink

Yes, the numbers increase when i touch the thermistor. 

Si

Quote
Yes, the numbers increase when i touch the thermistor.


Excellent.

Your thermistor is 10k yes? and your series resistor 10k?

Do you have the data sheet for your thermistor, can you look up its 'Beta' value.

Change everywhere in the equation where is says 33 (my thermistor was 33k) to 10 and plug in your value of Beta at the top of the sketch and you should be there!

I.e.
Code: [Select]

float temp = beta / (log(((1025.0 * resistance / a) - 10.0) / 10.0) + (beta / 298.0)) - 273.0;


If you want to convert to deg F, F = C * 9 / 5 + 32
--
My New Arduino Book: http://www.arduinobook.com

Go Up