In this article building of a simple thermometer for PC will be described. The unit is extremely simple and cheap to build. You will only need one NTC resistor, one diode and capacitor and serial port connector.
Let’s say DTR and TXD are zero at the beginning. Nothing is going on. Then we set DTR to 1 and start counting time. Capacitor is being charged through NTC resistor. The higher the temperature, the lower the resistance and capacitor is charged more rapidly and vice versa. We use DSR pin to monitor the voltage of capacitor. When it is charged enough, DSR goes to 1, we stop counting time. From elapsed time of charging we can calculate resistance of NTC, from resistance the temperature. After each measurement we set DTR to 0 to empty the capacitor through diode. NTC thermistor resistance
The resistance of NTC thermistor can be approximated by exponential curve R (T) = R25 * exp(B*(1/T-1/298K)) (R resistance in ohms, R25 resistance at 25°C, B typical constant dependant on NTC value [unit is kelvin K]). Do not worry about those constants, we will not need them. Calibration of device
You need another calibrated thermometer for calibration of newly built one. The best is good ole’ mercury thermometer with 0-100°C range. Measure temperature and write down capacitor charging time (you can get this data in program). Change temperature and repeat process. Be patient! Thermometer need some time to reach external temperature.
Visit Here for more.