Design of a device for accurately measuring body temperature data acquisition
2026-04-06 06:20:25··#1
1. Introduction With the vigorous development of modern society and the continuous improvement of science and technology, the modernization and informatization of medical institutions are an inevitable trend. In traditional hospital temperature measurement, mercury thermometers are inconvenient to operate, time-consuming, and cannot achieve automatic data detection and communication. With the rapid development of electronic science, the emergence of new temperature sensors, and the continuous introduction of new high-performance microcontrollers, automatic temperature detection and data communication have become possible. 2. Overview Some people are in a state of "sub-health." According to traditional Chinese medicine, sub-health refers to an imbalance in the body's yin and yang, qi and blood, and the balance of internal organs and defenses. According to Western medicine, these imbalances manifest as abnormal changes in physiological signals such as body temperature, weight, heart rate, blood pressure, and urine composition over a period of time. Analyzing these signal changes over a period of time allows for a relatively objective assessment of a person's health status. Body temperature data has become one of the important indicators for judging "sub-health." To ensure objective and accurate temperature checks, medical researchers have conducted extensive studies on the selection of examination sites and methods. Common sites and methods include oral temperature measurement, axillary temperature measurement, rectal temperature measurement, and tympanic membrane temperature measurement. Besides these methods, temperature can also be measured on the back between the shoulders and feet, abdomen, groin, elbow, and hands, but these are less common. Mercury thermometers and infrared ear thermometers are commonly used in clinical temperature measurement, but their measurement times differ significantly; the former takes several minutes to stabilize, while the latter takes only a few seconds. Infrared ear thermometers provide fast and accurate measurements, capturing the temperature of the central nervous system, which is the body's core temperature. Ear temperature readings can reflect the actual temperature under normal body temperature and mild hypothermia conditions. However, commercially available infrared ear thermometers lack serial communication capabilities, preventing data communication, automatic data saving, and temperature curve plotting, significantly limiting the automation of temperature detection. The body temperature data acquisition device designed in this paper adopts the infrared ear temperature measurement method. Furthermore, to achieve automatic recording and storage of body temperature data and observation of temperature curves over a period of time, communication between the infrared ear thermometer and the PC, as well as host computer software, were designed. During body temperature checks, the user removes the infrared ear thermometer from the platform's tray, presses the thermometer switch, inserts the infrared probe into the ear canal and presses it down to ensure a complete fit, and presses the "start" button. The ear thermometer's display shows the corresponding test result. When the user puts the ear thermometer back on the tray, the weight of the ear thermometer presses a limit switch installed on the tray, and the microcontroller system transmits the detection result to the PC via serial port. The PC automatically saves the data, storing the temperature data in a database. After a period of body temperature monitoring, the PC automatically plots a temperature data curve, reflecting changes in body temperature over a period of time, which can be used as one of the standards for assessing "sub-health." The body temperature data acquisition device designed using this method has been applied in a "smart toilet system," demonstrating advantages such as ease of use, high detection accuracy, good stability, and a high degree of automation. 3. Infrared Thermometry Principle and Infrared Temperature Sensor Infrared thermometry measures the temperature of an object by measuring the radiant energy it emits. Its theoretical basis is the Stefan-Boltzmann law: the higher the temperature of an object, the more energy it radiates. When the temperature is T, the total radiative intensity W of an object across all wavelengths (the radiation of an object includes almost all wavelengths) is: Where wλ is the spectral radiative intensity of an object at temperature T (K) at wavelength λ, in units of (W/cm²·μm); c1 is the first radiation constant; c1 = 3.7415 × 10⁻¹² (W/cm²); c2 is the second radiation constant; c2 = 1.4388 (cm²·K); ελ is the spectral emissivity, which depends on the material, surface condition, and wavelength of the object; σ is the Stefan-Boltzmann constant, σ = 5.6697 × 10⁻¹² [(W/cm²·T⁴]; T is the absolute temperature of the object, in K; ε is the normal emissivity of the object's surface, for an absolute blackbody ε = 1.0. For non-absolute blackbodies, 0 < ε < 1.0; λ is the wavelength of the electromagnetic wave emitted by thermal radiation. The peak radiation wavelength λm is inversely proportional to the absolute temperature T of the object itself, i.e., λm = 2897 / T (μm) (2). This formula is called Wien's displacement law. It shows that the higher the temperature, the shorter the peak radiation wavelength shifts to the short-wave direction (i.e., the shorter the wavelength). From formula (2), it can be seen that the higher the temperature of the object, the greater the radiation power radiated. Obviously, when the normal emissivity of the object surface is known, according to formula (1), as long as the radiation power radiated by the object can be measured, the temperature of the object can be determined. The infrared temperature sensor consists of an optical system, a photodetector, a signal amplifier, and signal processing and display output, etc. The structural block diagram is shown in Figure 1. The optical system focuses the infrared radiation energy of the target within its field of view. The size of the field of view is determined by the optical components of the thermometer and their positions. The infrared energy is focused on the photodetector and converted into a corresponding electrical signal. This signal is amplified and processed by the signal processing circuit, and after being corrected according to the internal algorithm of the instrument and the target emissivity, it is converted into the temperature value of the target being measured. The optical system in Figure 1 has two functions: (1) to concentrate the infrared rays at the measured location onto the detection element; (2) to limit the infrared emitting surface entering the instrument to a fixed range. The detection element converts the infrared energy into an electrical signal. The signal processing unit processes the signal output by the detection element using electronic and computer technologies, transforming it into various analog and digital information that people need. The communication unit transmits the results to the microcontroller. 4 System Hardware Design The overall structure of the body temperature data acquisition system is shown in Figure 2. The system hardware design includes the TN infrared temperature sensor access, microcontroller, buttons, LED/LCD display, and communication between the PC and the microcontroller. The microcontroller is the 16-bit SPCE061A series microcontroller launched by Lingyang Company. The LED display uses a 7-segment LED digital tube, and the LCD uses the SPLC501 LCD module from Lingyang Company. Two display modes are designed: LED display and LCD display. The TN infrared temperature sensor access part uses SPI programming. Through the control of the SPCE061A I/O port, the measured temperature is received into the SPCE061A for processing. Its measurement range is -33℃ to 220℃, with an accuracy of ±0.3℃ and a response time of 0.5 s. The button section connects to PIA8 and GND. Pressing the button activates temperature measurement, and the LED/LCD displays the data. The temperature data is continuously displayed until the measurement is restarted and the data is updated. The LED/LCD display uses the SP-LC501's IOAO-8 to output segment selection codes and IOBO-3 to output 4-bit bit selection codes. The LCD display outputs 8-bit data via IOAO-8, with IOB9 connected to the microcontroller's CS1, IOB4 to A0, IOB5 to R/W, and IOB6 to EP. Communication between the PC and the microcontroller uses a MAX232 level conversion circuit. IOB7 is connected to MAX232's ROUT2, and IOB10 is connected to DIN2. The temperature acquisition device uses a three-wire communication method (transmit, receive, and ground), and operates in a master-slave mode. The PC is the master, and the ear thermometer is the slave. The lower-level machine uses interrupt mode to receive and send data frames. The lower-level machine communicates with the PC through the COM1 port. The communication rules are as follows: (1) The master sends down the data and the slave responds to send it up. The slave must respond to any command issued by the master within a certain time. (2) Four bytes are sent at a time. Each byte represents a certain function and each byte is a hexadecimal value. (3) The master sends down the operation command and the slave sends up the execution command issued by the master. It means that the slave has received the execution command from the master. The master sends down the read and write data command and the slave uploads it according to the returned data format. (4) If the slave receives the command or data and the checksum is wrong, it will not send the upload command or data. The communication protocol is listed in Table 1. 6 System Software Design The application uses modular programming, which is convenient for debugging and porting. Keyboard scanning uses polling mode and serial communication uses interrupt mode. The lower-level machine system software flowchart is shown in Figure 3. The body temperature detection data is transmitted to the computer through serial port communication. The computer collects and processes the data. This system uses virtual instrument technology to design software based on the PC platform. The host computer software uses LabVIEW software from NI. LabVIEW is a graphical integrated programming environment that realizes the concept of virtual instruments. It is a graphical programming software designed specifically for data acquisition and instrument control, data analysis, and data representation, enhancing users' ability to build their own instrument systems on standard computers with efficient and economical hardware. This system uses the serial port submodule for programming. In LabVIEW, serial communication can be implemented by calling the VISA and Serial submodules in the Instrument I/O module. The host computer receives data frames, decomposes the data frames to obtain temperature data, and automatically saves the data. The host computer sends control commands to start the slave computer and simultaneously receives 4-byte data frames transmitted by the slave computer, as well as 4-byte data frames transmitted after the slave computer starts the keyboard detection. For data frames generated according to the communication protocol, the tens digit, units digit, and decimal place of the temperature data can be extracted from the data frame format using GDI programming in LabVIEW, and the data is automatically recorded as text for easy viewing. The front panel debugging interface designed in LabVIEW is shown in Figure 4. The infrared temperature detection system designed in this paper is small in size, simple and reliable in structure, and very convenient to use. The infrared sensor is fabricated as a handheld ear thermometer, which, via an extension cable (up to 2 m), allows for convenient and extensive body temperature monitoring. Data can be saved and analyzed on a PC to plot body temperature change curves over a period of time. Experiments on a verification machine show that the system operates stably, measures temperature accurately, and has a high degree of automation. This system is particularly suitable for use in hospitals and large public places, and can also be applied in homes.