The board demonstrates the use of 12-bit ADC, writing c program with digital filtering and interface the LED display. The reading provides 0.1C sensitivity. The optional input of the ADC is available for exercise with other input signals or sensors.
Figure 1: The prototype of Thermistor Thermometer. The hardware block diagram is shown in Fig. 2. The sensor is epoxy molded thermistor. The circuit for signal conditioning is simple voltage divider. The ADC is 12-bit SPI interface LTC1298 analog-to-digital converter. The microcontroller is ATMEL 89S52. The display has four digits 0.5 inches 7-segment LED. The segment driver provides 32-bit CMOS output.
The complete hardware schematic is shown in Fig 3. The ADC is 12-bit SPI interface LTC1298 or MC3202. There are two channels, CH0 and CH1. The input signal from thermistor for ADC channel 0 is simple voltage divider. Channel1 is available for other sensor. The sample shown in schematic is HIH-3160 Honeywell Relative Humidity Sensor. The ADC chip is interfaced with MCU, 89S52 with P1.1, P1.2 and P1.3. The display has 4-digit LED. The 4094 CMOS shift register drives the LED directly.
Figure 3: Hardware schematic. Software
The main function is time triggered by 10ms timer0 running. The ADC is updated on LED every 10 ticks.
The function that reads 12-bit data from ADC is read_ADC(char n). The function has two loops. First loop is to send 4-bit command. And the second loop is 12-bit to shift the data from ADC.
To provide smooth reading, I added the 5-point moving average to the raw data. The function low_pass_filte1( ) is used to filter the high frequency noise. The reading is calibrated to degree Celsius with Platinum 100 standard thermometer. We found the equation y=0.0323x-15.122.
Download

Figure 1: The prototype of Thermistor Thermometer.

Figure 2: Hardware block diagram.
Hardware Schematic The complete hardware schematic is shown in Fig 3. The ADC is 12-bit SPI interface LTC1298 or MC3202. There are two channels, CH0 and CH1. The input signal from thermistor for ADC channel 0 is simple voltage divider. Channel1 is available for other sensor. The sample shown in schematic is HIH-3160 Honeywell Relative Humidity Sensor. The ADC chip is interfaced with MCU, 89S52 with P1.1, P1.2 and P1.3. The display has 4-digit LED. The 4094 CMOS shift register drives the LED directly.
Figure 3: Hardware schematic.
The main function is time triggered by 10ms timer0 running. The ADC is updated on LED every 10 ticks.
while(1) { while(!cputick) continue; cputick=0; print_ADC(); } |
sbit Data = P1^1; for(i=0;i<4;i++) for(i=0;i<12;i++) |
int low_pass_filter1(void) float read_temp1_filter(void) |
Schematic | schematic.pdf |
C source code | thermistor.c |
Orcad Schematic File | Uss.dsn |
Intel-Hex file | thermistor.hex |
HIH-3160 Humidity Sensor Datasheet | hih3160.pdf |