void loop()
{
Vout=1023-analogRead(5); // Invert the number because of setup
Vout=(Vout/1024.0)5;
f=1000exp(-3500/298.15); // 298.15K = 25C, 3500 seems to be the B value for a standard 1kOhm NTC
tmp=(R1*Vin)/Vout-R1;
value=(3500/log(tmp/f))-273.15;
sprintf(text,"%d ",value);
lcd.cursorTo(1,0);
lcd.printIn(text);
delay(1000);
}
A little messy but it was just a test...
Using a 1kOhm resistor and NTC in a voltage divider on analogport 5. Seems to be working quite nicely.
The inverting of Vout was done because I was too lazy to flip my voltage divider around.
The equations were taken from wiki and the numbers (B value) were just googled, so no warranty on them being correct.
I wasn't allowed to post links in my first post, but here are the links I used for it and the topic for this should have said Arduino NTC Thermistor test.
I'm working on something like this and I'm trying to calculate the B value. With a 1k resistor and an NTC probe that has a different B than your sample here, I'm getting a reading on my analog input of 1014 at 0 degrees C and 649 at 100 (i put the probe in ice and boiling water) - that's the raw value, not inverted.
How do I take that 1014 and 649 reading and convert that the resistence so I can plug it into b = Ln(R t1/ Rt2) / (1/T1 – 1/T2) ?
Thanks a lot, i'll post back to this thread if i figure it out
It will teach you about the equations, coefficients, and has some code to calculate the coefficients. I did this with my 2 salvaged thermistors and it works very well so long as I use the full Steinhart-Hart equation.