Design of a low-power portable thermometer based on MSP430
2026-04-06 05:44:50··#1
0. Introduction The portable thermometer uses a 16-bit ultra-low-power microcontroller, the MSP430F435, and a platinum-1000 resistance temperature detector (RTD) sensor to process and acquire temperature signals. A major advantage of using the MSP430 series microcontroller is its low power consumption and high integration, making it ideal for battery-powered and space-constrained environments, as well as portable applications. As a portable application system, power consumption refers to the power consumption of the entire system, not just the processor. For example, the leakage current at the processor's input port has a significant impact on the system's power consumption. The maximum leakage current at the MSP430 microcontroller's input port is 50 nA, far lower than other series of microcontrollers (typically 1 μA to 10 μA). This thermometer is suitable for measuring the water temperature under blast furnace heat load, or for applications requiring continuous measurement of multiple temperatures and temperature differences. 1. System Hardware Design The portable thermometer mainly consists of a processor, sensor interface, keyboard, LCD (liquid crystal display), data storage, printing, and power supply modules. The system hardware block diagram is shown in Figure 1. 1.1 The processor module, MSP430F435, is the control center of the temperature measuring instrument, handling sensor data processing, keyboard recognition, and serial communication management. The MSP430F435 microcontroller from Texas Instruments (TI) is a Flash-type microcontroller with 16 kB of embedded Flash program memory and 512 B of data memory. Its main features include ultra-low power consumption, 16-bit instruction set, built-in A/D converter, serial communication interface, hardware multiplier, LCD driver, and high anti-interference capability. Therefore, the MSP430 microcontroller is particularly suitable for applications in smart meters, anti-theft systems, smart home appliances, and battery-powered portable devices. The chip's performance characteristics are as follows: low operating voltage (1.8 V to 3.6 V); ultra-low power consumption (only 0.1 μA in operating mode 4); 16-bit RISC (Reduced Instruction Set Computing) architecture; 150 ns instruction cycle. 1.2 The power module is powered by a single AA battery, with the processor and peripheral circuits receiving power through a voltage conversion chip. To ensure the normal operation of the thermometer, the power supply circuit is also equipped with a battery power detection device. This device will promptly alarm and remind the user to replace the battery when the battery power is low and may affect the normal operation of the thermometer. The MSP430F435's built-in comparator module eliminates the need for an external battery detection chip; only two resistors are required to perform this function. 1.3 Sensor Interface Module The sensor interface module circuit is shown in Figure 2. The sensor outputs a millivolt-level strain signal, which is transformed by a high-stability bridge circuit, then amplified by a subtraction circuit composed of operational amplifiers MAX492. After zeroing and filtering, the signal is sent to the NSP430F435's A/D conversion interface ADC0 to detect the temperature signal. The microcontroller uses a lookup table based on the processed value and range to achieve piecewise linearization, mapping the sensor signal to temperature. [align=center] Figure 1 System Hardware Composition[/align] [align=center] Figure 2 Sensor Interface Module Circuit[/align] The sensor used in the system is a platinum-1000 resistance temperature detector (RTD). Platinum resistance thermometers (PTTs) are widely used temperature sensing elements known for their high accuracy, stability, and reliability. However, PRT temperature sensors also have drawbacks, such as nonlinear output signals, weak signals, different resolutions for positive and negative temperatures, and the inability to directly connect analog outputs to microcontrollers. Due to the nonlinearity of PRTs, nonlinearity correction must be considered in applications. Since the instrument operates in a small-signal state, anti-interference measures and proper circuit design significantly impact the overall accuracy. During design, strictly separating digital and analog grounds, selecting a common ground point, and appropriately adding digital filtering can improve anti-interference capabilities. 1.4 Display and Keyboard Module LCD and keyboard display are crucial for human-computer interaction. The MSP430 has an internal LCD driver module capable of driving up to 160 segments of LCD. A 4-digit, 8-segment low-power module is used, making this LCD ideal for instruments requiring low power consumption (such as electronic water meters, electricity meters, and gas meters) and portable systems. The thermometer panel has two manual keys, one function key, and one confirmation key for real-time display, saving measurement values, and printing. While pressing the function key, the LCD displays the corresponding value, allowing the user to read the relevant information or press the confirmation key to execute the corresponding function. 1.5 Data Storage Module: The MSP430F435 is externally expanded with a 2 kB E2PROM. The E2PROM is connected to the microcontroller via an I2C bus to store the collected temperature values for printing. 1.6 Printer Module: The printer selected is a Chinese character miniature printer from Beijing Weihuang Technology, directly connected to the microcontroller's serial port. The interface circuit is relatively simple, and software is used to print temperature values in a specified format. 1.7 Keyboard Module: The portable thermometer panel has two keys for real-time display of measured values and printing. The keys are directly connected to the microcontroller's I/O lines, and the key values are obtained through a polling method. 2. System Software Design The entire system software design mainly consists of five parts: temperature acquisition, low-power design, LCD display, E2PROM reading/writing, and printing processing. The system's workflow diagram is shown in Figure 3. [align=center]Figure 3 Main Program Flow[/align] After hardware initialization, the current temperature value is collected, and the system checks if any buttons are pressed. If a button is pressed, the corresponding function is executed, and the LCD display program shows the information corresponding to each function. If no button is pressed, the current measured temperature value is displayed, awaiting the user's next operation. If the measured data needs to be printed, the printing process is initiated. 2.1 Temperature Acquisition Temperature data acquisition uses the built-in A/D converter of the MSP430F435 microcontroller, with an A/D conversion accuracy of up to 12 bits. The MSP430 microcontroller provides convenient A/D converter initialization registers; initialization of the A/D converter can be completed by simply setting a few A/D converter control registers. The software design focuses on the linearization scaling algorithm for the nonlinear relationship between temperature and thermoelectric potential and the filtering algorithm for noise interference in the sensor temperature data. The scaling transformation uses a piecewise (segmented in 10°C segments) linearization method, which improves the temperature measurement accuracy of the system; while the filtering uses a median filtering algorithm. The specific implementation process of the algorithm is as follows: First, 15 temperature data points are collected consecutively. Then, the 15 temperature data points are arranged in ascending order, and the median value is taken as the current sample value. Median filtering can effectively overcome fluctuation interference caused by accidental factors. For slowly changing measured parameters such as temperature and liquid level, this method can achieve good filtering results. Practical use has proven that this filtering algorithm can ensure that the data after one decimal place remains stable. 2.2 Low Power Consumption For portable devices, power consumption should be minimized during design to keep the system in a low-power state for as long as possible. Therefore, automatic shutdown of the device at appropriate times is considered. A timer is used here. When the timer is greater than 0, the system is in the power-on state; when the timer counts down to 0, the system enters the sleep state and turns off the LCD module and A/D module. When the processor is in the sleep state, the keyboard program is not working, and the processor will not actively scan the keyboard. The keyboard is connected to port P1, which has the function of external interrupt. When the processor enters the sleep state, the key interrupt is enabled. When a key is pressed, the CPU responds to the external interrupt, the system is woken up, and returns to the normal working mode. The specific operation is as follows: upon power-on, the timer is initialized to a value greater than 0, and this value is re-initialized each time a valid key is pressed. Therefore, when no valid key is pressed, the system will automatically shut down after 3 minutes, thereby reducing power consumption. 2.3 LCD Display The implementation of the LCD display section needs to cooperate with the keyboard processing program to display different information according to different functions. To achieve normal LCD display, at least the following important steps are required: selecting the LCD driving mode, defining the BCD code display memory table for the LCD under the corresponding driving mode, setting the LCD clock, setting the general I/O port attributes, and updating the LCD display buffer. This instrument selects the static LCD driving mode, defines the BCD code display memory table from 0 to F, uses a clock frequency of 1024 Hz, sets the general I/O port attributes to output, and updates the contents of the LCD display buffer in real time according to different functions. 2.4 Other Parts The E2PROM module is used to store the measured temperature value and measurement point. The serial communication module is used to connect the thermometer to the printer and print the measured temperature value. These two parts of the program are relatively simple and will not be described here. 3. Functions and Main Technical Performance of the Thermometer The functions of the thermometer are shown in Table 1. When function number 0 or 1, it is used to confirm and save the current measurement point temperature value, and then automatically switch to the next measurement point location; when function number 2, it is used to display and save the recorded measurement point location; when function number 3, it is used to display the measured measurement point location and clear the previous measurement record; when function number 4, it is used to confirm printing. [align=center] Table 1 Thermometer Function Table[/align] The instrument resolution can reach 0.1℃, and the measurement error is less than ±0.1℃. The MSP430 series microcontrollers are all industrial-grade devices, with stable operation and high reliability in an operating environment temperature of -40℃~85℃. The designed products are suitable for various civil and industrial environments. Therefore, this thermometer can be used to measure the temperature difference of blast furnace heat load water, or in situations requiring continuous multi-point temperature measurement. 4. Conclusion The portable, low-power temperature measurement system developed in this paper overcomes the shortcomings of traditional measurement systems, possessing advantages such as simple structure, stable and reliable operation, high measurement accuracy, low power consumption, good portability, comprehensive functions, and wide applicability. A key difference from other temperature measuring instruments is that this system uses the new low-power 16-bit microcontroller MSP430 F435 as the control core of the entire system. Due to the use of the powerful MSP430 microcontroller, the hardware circuit design of this system differs significantly from previous systems. The MSP430 F435 has abundant peripheral modules, making it relatively easy to realize the acquisition, processing, display, storage, and printing of temperature signals, thus greatly simplifying the entire hardware circuit. Practical use has proven that this temperature measuring instrument fully meets the needs of factory applications, exhibiting stable performance, high reliability, and simple and convenient operation.