Thermistor code help
Mike2545
Posts: 433
Hi guys, I am building a greenhouse and a vent control system to automatically control the vents. I want to use a thermistor because of the rugged nature of the probes. I got this one HONEYWELL 535-59DV26-303 THERMISTOR ( http://www.mouser.com/ds/2/187/009035-1-EN-20984.pdf ). I am having trouble with the RCTIME portion of the code to get a temperature reading. This system does not have to be pin point accurate but should be +- 2°F
Any help would be appreciated.
Any help would be appreciated.
Comments
I get what look like reasonable values for a wide temperature range (10C to 40C) with a parallel resistor of 50K and a capacitor of 1uF. Next step would be to make up a test circuit and determine the raw RCTIME values for specific temperatures, then try to fit an equation to the data values (TC = f(RCTIME)). If you get enough data points, you could use table lookup with linear interpolation or, if you get a good fit, you can just use the equation you find to convert the raw RCTIME values to temperature.
I'd prefer to use an ADC, because then the accuracy is better controlled by a stable reference resistor, Rref.
I'm attaching a spreadsheet that computes the values for Stamp DATA statements given the above circuit, given values for Rref, Vref, and points of the curve of Rt vs temperature. The Vref would drop out if you use a ratiometric converter. This is for a Davis 7818 soil temperature probe and covers quite a wide temperature range at 9 °F increments. Also a Stamp program that uses the DATA statements, and it interpolates for values within each 9°F interval.
The test with the blow-dryer yielded small variations in the readings when directed at the capacitor (40° C) and nothing when directed at the Basic Stamp (aka PIC 18F1320).
I'll work out the code and post it along with the circuit diagram when I get it all going....