Two-Chip Digital Thermometer Delivers 0.4°C Accuracy

July 8, 2002
°An LED digital thermometer with an operating range between 0°C and 150°C, 1°C resolution, and ±0.4°C accuracy is presented in the figure. This design is based on the PIC16F872...

An LED digital thermometer with an operating range between 0°C and 150°C, 1°C resolution, and ±0.4°C accuracy is presented in the figure. This design is based on the PIC16F872 microcontroller. Because a software routine handles all tasks, an external ADC and decoders aren't required. A National Semiconductor LM35 temperature sensor gives the circuit a high linearity and low percentage error of the sensed temperature.

Output from the LM35 is connected to an LM6134 op amp, which is configured as a noninverting amplifier with a gain of 2. This gain serves to adjust the sensor's resolution (V/°C) to the microcontroller's ADC. Because only 8 bits of the ADC are used, the resolution is 20 mV.

The ADC's reference voltages, V+ and V-, are VDD and ground, respectively. Software in the microcontroller performs several functions, such as ADC operation, conversion from BCD to seven segments, overflow, and out-of-range detection. Register ADCON1 configures the reference voltages and the ADC's analog input.

Five typical temperature measurements are described in the table. Notice that the 8-bit reading from the ADC is converted to a BCD format that corresponds to the real sensed temperature. A software subroutine then converts the BCD reading to a seven-segment format to directly drive the LED display. Port RB drives the units digit, while Port RC drives the tens digit. The microcontroller's output lines, RC7 and RB7, control the hundreds digit.

The following description is based on the software listing, found at www.elecdesign.com:

The temperature reading from the microcontroller's ADC goes to the register, ADRESH. A subroutine called OP_TAB translates this result to BCD, then adds it to the program counter, PCL. This creates an unconditional jump to get the BCD value using the RETLW-type instruction, which contains the two BCD digits of the measured temperature. Next, the BCD reading is converted to a seven-segment format by calling the subroutine OP_TAB2. Subroutine OP_TAB3 controls the hundreds digit.

To download the listings, click Download the Code.

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!