Hello Pengyou,
A cheap programmable PDA with a serial port is the hardware hacker's dream. All you need to turn it into a data collector is a device that takes in an 8-bit binary word, and send it to your serial port.
In the specific example of a thermal monitoring application, you can use a regular thermistor, a device that acts as a temperature controlled variable resistor. They cost about $0.50 each.
Now you have to turn the changing resistance value into serial data. You can use a 555 timer IC with the R/C tank hooked up to your thermistor. This will produce a variable frequency oscillator, with the frequency determined by the temperature.
Now you use an 8-bit binary counter
(74HC590A
), that is clocked by this oscillator. You connect the output to a 16 bit parallel to serial shift register and pad the lead and tail bits with resistors tied to either ground or source. This formats the serial 'word'. You can use a 74HC676 for this function. You will also need another oscillator acting as the master clock.
Lastly, you need to convert the levels from TTL/CMOS to RS232. This can be done with a 1488 RS-232 Driver.
It goes like this: The 555 timer will be acting as a variable frequency clock, with the number of ticks per sample period changing depending on the temperature. The master clock determines this sampling period, probably through a frequency divider, and you can adjust it for best results. You use the counter to count the number of 'ticks' the 555 generates in this sample period. At every tick of the master clock, the counter dumps it's data to the parallel to serial shift register, which then resets and starts counting again. The shift register is hooked up to the master clock as well. The serialized data stream is then fed through the level converter and off it goes to your serial port as an 8-bit word.
Then all you need is a simple program to monitor the comm port and translate these frequency counts to temperature readings. The conversion factor of course needs to be calibrated first with the use of a regular thermometer. It could even be analog.
You can immediately see that this is not limited to just temperature. Change the thermistor into a photoresistor and you can measure light. Or you can couple an acoustic transducer directly into the frequency input and count decibels. Or a photodiode and count light/dark transitions
(like the number of people breaking an IR barrier beam
). Or stick a slotted disk in front of the light beam and you can count engine RPM.
Or interpose a tristate data buffer in front of the shift register and you suddenly gain the ability to read digital inputs. Like door and window intrusion switches.
Build the simple frequency-to-RS232 board just once and the whole world of data collection opens up to you.
Total cost in parts, less than $20.
Have fun!