Low-Cost Digital Thermometer Uses Single-Chip Microcontroller

Feb. 18, 2002
In many applications, the ability to read and display temperature is either desirable or an absolute requirement. Some of these applications include temperature probes, thermostats, CPU monitors, and process-control equipment. The ...

In many applications, the ability to read and display temperature is either desirable or an absolute requirement. Some of these applications include temperature probes, thermostats, CPU monitors, and process-control equipment. The figure illustrates a simple system for reading and displaying the temperature. This circuit requires only one microcontroller (MCU), as opposed to other solutions that need separate power management and analog converter chips. Moreover, the circuit doesn't require any special treatment of the reset pin because the MCU used incorporates brown-out detection.

The MSP430F412 MCU from Texas Instruments executes the code from flash memory while being clocked from a high-speed internal oscillator. First, the code reads the resistive sensor using the single-slope analog conversion technique. Then, the reading is converted to a BCD value and displayed on the LCD. The LCD doesn't re-quire a separate driver chip; it's directly driven by the MCU. Also, the LCD displays a flashing "F" to indicate that the reading is in degrees Fahrenheit, and that the circuit is actively reading the temperature.

Once the display is updated, the MCU enters low-power standby mode. During this time, only an internal timer is active and being incremented by the 32-kHz crystal. This timer controls the framing frequency of the LCD so that it remains on, displaying the last temperature reading. After a software selectable time delay, the same timer generates an interrupt. The interrupt then restarts the CPU and internal high-speed oscillator, and the whole process repeats. Each cycle of the interrupt either clears or writes the "F" to the display, causing it to flash.

The MSP430F412 is specifically designed for low-power battery-based applications. As a result, while the MCU is in standby mode with the LCD on, the entire circuit only draws about 1.5 µA. Because the MCU has extremely fast startup and shutdown times, it can spend more than 97% of its time in standby mode. When the circuit is in active mode or measuring the sensor, it draws only an average current of 110 µA. Combining the long standby time and the short active time results in an overall average current of under 5 µA for the circuit. If the circuit were powered from a 220-mAh, 2032-type coin cell, it could operate continuously for up to five years between battery changes.

The digital thermometer task re-quires only a small fraction of the MCU's resources. The program uses less than 17% of the flash memory. There are 21 I/O lines available for other uses, and the CPU is off at most times. With these facts in mind, it's easy to see how the digital thermometer could be just a small part of a more complex application implemented on the same MCU. The thermometer could be a subfunction of a circuit that controls production equipment, changing the speed and power based on the temperature reading.

Or instead, it could be the heart of a digital thermostat that also reacts to the time of day, as the 32-kHz input directly divides down to provide a real-time clock. The thermometer could even be part of a datalogging system that uses the MCU to store the data and run the code. This is possible because the MSP430F412 can write to its own flash memory.

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!