Share this

Design of an infrared thermometer

2026-04-06 07:22:02 · · #1
1. Introduction Last year, the early symptoms of SARS, which was prevalent in some parts of China, included a high fever above 38°C (except for a few patients with chronic illnesses). Infrared thermometers provided a rapid, non-contact measurement method to prevent the spread of SARS and could be widely and effectively used for screening body temperature in the population. Infrared thermometry quickly became popular in China. This article introduces a method for infrared temperature measurement using the SPCE061A and TN series sensors. 2. Chip Features The SPCE061A is a high-performance 16-bit microcontroller manufactured by Sunplus Technology Co., Ltd. in Taiwan. It can be used to easily implement control and voice broadcasting systems. This chip has eight 10-bit precision AD channels, one of which is an audio conversion channel, and it has a built-in automatic gain control circuit. This provides convenient hardware conditions for voice input. The two 10-bit precision DA channels only require two external power amplifiers (LM386) to complete voice playback. In addition, Sunplus 16-bit microcontrollers have an easy-to-learn and easy-to-use, highly efficient instruction set and integrated development environment. In this environment, standard C language is supported, enabling mutual calls between C language and Lingyang assembly language. Furthermore, it provides library functions for voice recording and playback; understanding these functions makes voice broadcasting easy, facilitating software development. [b]3 System Overall Scheme Introduction[/b] The system structure diagram is as follows: This system consists of three parts: a button section, an audio output section, and a TN infrared temperature sensor access section. Button Section: Pressing the button starts temperature measurement; holding it down until a sound is heard indicates measurement completion. Audio Output Section: Primarily, the two audio outputs of the SPCE061A are amplified via an LM386 and played through a speaker. TN Infrared Temperature Sensor Access Section: The measured temperature is received and processed by the SPCE061A through the SPCE061A IO port control. System Functionality: Pressing and holding the button produces a sound, at which point the measured ambient temperature and target temperature are announced. [b]4 System Hardware Design[/b] The infrared temperature sensor is shown in Figure 4.1. The interface between the infrared temperature measurement module and SPCE061A is as follows: V-->3.3v D-->IOA15 C-->IOB8 G-->GND A-->Button-->GND The detailed circuit diagram of the audio output section is shown in Figure 4.2. [b]5 System Software Design[/b] The software design flow of this system is as follows: Among them, SPCE061A reads the measurement results of the infrared sensor using the SPI interface, and the data format is as follows: SPI timing diagram: A frame of data includes 5 bytes, and each byte represents the following meaning: Item “L” (4CH): Represents the target temperature of this frame “f” (66H): Represents the ambient temperature of this frame MSB 8 bit Data Msb LSB 8 bit Data Lsb Sum Item+MSB+LSB=SUM CR 0DH, the end code data reading flow diagram is shown in Figure 5.3: The software system design is simple. The main reason for choosing Sunplus's 16-bit microcontroller development environment is its ease of use, support for interoperability between C and assembly languages, and rich Sunplus speech function library. Once we understand how to use these functions, we can easily implement speech playback. This system uses the S480 compression format, which has a high compression ratio of 80:3, large storage capacity, and sound quality between A2000 and S240, making it suitable for speech playback. For example, the playback code is as follows: Its related API functions are as follows: int SACM_S480_Initial(int Init_Index) // Initialize void SACM_S480_ServiceLoop(void) // Get voice data and fill it into the decoding queue void SACM_S480_Play(int Speech_Index, int Channel, int Ramp_Set) // Play void SACM_S480_Stop(void) // Stop playback void SACM_S480_Pause(void) // Pause playback void SACM_S480_Resume(void) // Resume after pause void SACM_S480_Volume(Volume_Index) // Volume control unsigned int SACM_S480_Status(void) // Get the module status Call F_FIQ_Service_SACM_S480 // Interrupt service function The specific contents of each function are as follows: 1) [API Format] C: int SACM_S480_Initial(int Init_Index) ASM: R1 = [Init_Index] Call F_SACM_S480_Initial 【Function Description】Initializes SACM_S480 voice playback before it begins. 【Parameters】Init_Index = 0 indicates manual mode; Init_Index = 1 indicates automatic mode. 【Return Value】 0: Voice module initialization failed; 1: Initialization succeeded. 【Remarks】This function is used for initializing timers, interrupts, and DACs. 2) 【API Format】 C: void SACM_S480_ServiceLoop(void) ASM: Call F_SACM_S480_ServiceLoop 【Function Description】Retrieves SACM_S480 voice data from resources and fills it into the decoding queue. 【Parameters】None. 【Return Value】None. 【Remarks】Plays data from the voice file; playback stops when FF FF FFH data appears. 3) 【API Format】 C: int SACM_S480_Play(int Speech_Index, int Channel, int Ramp_Set); ASM: R1=[Speech_Index] R2=[Channel] R3=[Ramp_Set] Call SACM_S480_Play 【Function Description】Plays SACM_S480 audio from the resource. 【Parameters】Speech_Index represents the audio index number. Channel: 1. Play through DAC1 channel; 2. Play through DAC2 channel; 3. Play through both DAC1 and DAC2 channels. Ramp_Set: 0. Disable volume increase/decrease adjustment; 1. Allow only volume increase adjustment; 2. Allow only volume decrease adjustment; 3. Allow both volume increase and decrease adjustment. 【Return Value】None. 【Remarks】 ① SACM_S480 has three data rates: 4.8Kbps and 7.2Kbps, which can be automatically selected from several algorithms in the same module. ②Speech_Index is the offset address of the resource table (T_SACM_S480_SpeechTable) defined in the resource.inc file. ③ In the interrupt service routine, F_FIQ_Service_SACM_S480 must be placed on the TMA_FIQ interrupt vector (see SPCE interrupt system). ④The function allows TimerA to interrupt at the selected data sampling rate (count overflow). The main program flow for SACM_S480 automatic mode is shown in: 6 Conclusion The structural features of Sunplus Technology's SPCE061A and its related development platforms provide extremely convenient conditions for our control and playback. Of course, the SPCE061A also has many functions similar to other microcontrollers, making it equally convenient to use. With increasing market competition, developers are increasingly limiting their investment of funds and time in product development. It is believed that Sunplus Technology can meet the needs of developers. Editor: He Shiping
Read next

CATDOLL Miho Soft Silicone Head

You can choose the skin tone, eye color, and wig, or upgrade to implanted hair. Soft silicone heads come with a functio...

Articles 2026-02-22