2020 Shenzhen University Electronic Design Competition Final Report
Senior/Junior Grade Group: Senior Group Topic Name: Automatic Human Body Temperature Detection Display Circuit Design Based on ATMega328P Team Name: Brown Sugar Ginger Tea Team Members: Guo Taolue, School of Electronics and Information Engineering, Zeng Hailin, School of Electronics and Information Engineering, Wang Haocheng
【Abstract】This article proposes a solution for contactless automatic tracking and measurement of human body temperature within one meter. In the plan, the HC-SR501 distance sensor is used to detect human body proximity within two meters, and the AMG8833 infrared array sensor is used as a temperature measurement sensor to achieve head detection, tracking and temperature measurement within a 60-degree field of view within one meter. AMG8833 transmits the array temperature information to the ATmega328pb processor through I2C. The pre-programmed algorithm analyzes and processes the temperature information and outputs the results to the corresponding ports, such as stepper motors, buzzers, temperature display circuits, etc. High-precision human body temperature measuring imagers on the market are expensive and are suitable for large-scale people movement. For common people with dispersed and narrow entrances, it is not practical to configure the above-mentioned temperature measuring imager. The output temperature accuracy of the cheap and compact AMG8833 used in this article is 2.5 degrees within 5m. As the distance increases, the accuracy will increase, and we use an algorithm inside the processor to correct the temperature. It is expected that it will eventually be accurate to one meter. The accuracy of temperature measurement of the human head can reach 1 degree.
【Key words】Head tracking; Infrared array sensor; Non-contact body temperature measurement
1. demand analysis
Brown Sugar Ginger Tea Team of Electronic Science and Technology Major of School of Electronics and Information Engineering
Traditional heat transfer temperature measurement methods, such as using thermometers, are time-consuming and require high personnel, and are not conducive to rapid temperature measurement of large groups of people. Since the epidemic, the demand for rapid temperature measurement has become very large. An automatic and rapid human body temperature measurement solution needs to be proposed to effectively detect suspected patients with fever symptoms and achieve the effect of controlling the epidemic. Forehead thermometers and ear thermometers on the market can quickly measure personal body temperature, but due to their high requirements for detection distance (generally required to be within 15cm to ensure accuracy), automatic measurement by machine cannot be achieved, so the measurement is Wen personnel bring certain risks. Moreover, the walking person being tested needs to stop for testing, which also causes unnecessary time loss. In order to achieve fully automatic, long-distance, and rapid temperature measurement of large-scale people to be measured, a variety of human body temperature measurement thermal imaging cameras already exist on the market [1]. They use high-resolution infrared imaging sensors, black bodies, face tracking algorithms, etc. to achieve high-precision (0.3°C) human body temperature measurement. However, the disadvantage is that it is expensive and difficult to deploy on a large scale. For common long and narrow passages (such as subway station ticket gates) and areas where the flow of people is not very dense, deploying such thermal imaging cameras is too wasteful. To this end, we have designed a fully automatic fast-tracking temperature measurement circuit that takes both cost and accuracy into account. Its main performance and features follow the following requirements: The circuit is mainly integrated on a PCB board and is small in size; When a person passes the test, the test is started. Temperature; Move the temperature sensor synchronously to track the head of the human body being measured; Continuously measure the temperature for more than one second, and the entire detection process should be as short as possible; If the temperature of the human body being measured is higher than 37.8°C, an alarm will be activated. This solution is suitable for passages where the flow of people is relatively easy. It can allow the persons being tested to pass through the temperature measurement passage without stopping, saving time and further reducing the risk of cross-infection. Compared with large-scale human body temperature measurement thermal imaging cameras, the sensor used in this solution is much cheaper, the overall circuit and logic calculations are simple, the power consumption is small, and the accuracy within the detection range can also achieve satisfactory results.
Selection of temperature measurement sensors: Mainstream non-contact temperature measurement solutions use thermopiles as temperature measurement sensors. The thermocouples inside detect the surface temperature of the object being measured by receiving the intensity of external infrared radiation. Through this principle, we can design two temperature measurement schemes. These two schemes will be introduced and compared below.
This type of sensor has a small number of thermocouples in the thermopile and can generally only measure the temperature of a small number of measured points. In the case of close-range temperature measurement, since there is no interference from other non-target objects within the field of view, the measurement accuracy is generally relatively high and can reach 0.1°C. When the distance is slightly further, the temperature of non-target objects in the field of view will cause great interference to the accuracy of the entire measurement, and it is not suitable for temperature measurement of small objects at long distances. The circuit structure of the thermopile sensor is relatively simple and the price is relatively cheap. Its appearance and field of view are shown in Figure 1. Its four pins can respectively obtain two voltage values of the thermal resistor and thermopile. Figure 1: Schematic diagram of a simple thermopile sensor
The infrared array sensor [2] uses n×n pixels, and the field of view of each pixel is relatively small. It can independently measure the temperature of a certain area within the overall field of view of the sensor, thus forming a picture. n×n thermal image. When measuring temperature at close range, the closer the target is to the sensor, the higher the measured temperature is and the more accurate it is [3]. The temperature measured at each pixel point is the temperature of the target object, and the average temperature of the measured object can be calculated. The measurement accuracy is higher. As the distance between the temperature measurement target and the sensor becomes farther, the sensor's field of view becomes larger, but within a certain range, a small number of pixels are still not interfered by non-measured objects. It can be calculated by calculating the maximum value of the pixel temperature in the n×n range. Estimating the temperature of the object being measured, the error will not be too large. The price of infrared array thermopile sensors is many times more expensive than ordinary thermopile sensors, but due to the excellent integration process, they are almost the same in size. Its appearance and field of view are shown in Figure 2. Its appearance is very similar to a traditional thermopile sensor, but each thermopile detects only one pixel in the infrared array. Its internal circuit is highly integrated, the voltage data has been processed, and the pins can directly obtain the temperature through I2C communication. Figure 2: Schematic diagram of infrared array electric heating pile sensor
The requirement of this experiment is to detect people passing by before starting the temperature measurement. For option one, because the accuracy of long-distance temperature measurement is too low, we cannot judge the approach of people (for example, if a person passes by, It may also be misjudged and start temperature measurement), so an additional rangefinder must be added to determine whether someone is approaching. When the temperature measurement circuit is turned on, since close-range temperature measurement is required to ensure accuracy, a fixed sensor cannot meet the requirements for continuous temperature measurement time within a certain distance, so a method of identifying and tracking the head must be adopted. Solution 1 cannot identify the head of the person being measured, and the temperature measurement object is uncertain and cannot be tracked. Other sensors (such as cameras) need to be added to assist the identification, which increases the cost and requires a powerful processor to process the image. The sensor output of option 2 is an n×n thermal image, which can not only measure temperature, but also has simple image features, which is very suitable for identifying and tracking the measured target within the field of view. In summary, although the price of the infrared array thermopile sensor is not low, its functions are very suitable for the requirements of this experiment, so we chose it as our temperature sensor. Selection of tracking method: In order to meet the requirements for continuous measurement time, we need to design a tracking circuit to achieve accurate tracking of the target object, that is, to ensure that the speed of the sensor movement is almost equal to the speed of the object.
This solution achieves the tracking function by measuring the distance between the sensor and the target object and keeping the distance between them within a certain range. The specific plan is to install a sensor to measure the distance of the target object and install a motor so that the sensor always maintains the same horizontal speed as the object being measured until the temperature measurement of one object is completed and the temperature of the next object is measured. The advantage of this solution is that a small number of target objects can enter the channel front and back at the same time, and the sensors identify and track them one by one, achieving more accurate body temperature measurement of all measured objects in turn. The difficulty is that the distance between the sensor and the measured object needs to be kept close, and the same speed needs to be maintained for a period of time, and a ranging module needs to be installed. The overall algorithm is relatively complex. Since the sensor is in motion, its power consumption must be very high.
In this solution, the temperature sensor is fixed at the end of the channel, and the sensor is facing the direction of the object being measured. As the measured object gets closer, the temperature measured by the sensor increases. When the temperature rise reaches a certain threshold, formal body temperature measurement and recording begins. At the same time, the tracking circuit is started to identify the object to be measured and rotate the sensor so that it is always aimed at the object to be measured until it cannot rotate or the object to be measured cannot be detected. Once the temperature measurement is completed, it immediately returns to the initial angle and starts the second detection. The temperature sensor is in a semi-active state in this solution, which means that the object to be measured must enter a certain range before the tracking circuit will start. The advantages of this solution are that the circuit power consumption is low, the algorithm is relatively simple, and the sensor's large field of view also allows greater error tolerance during tracking, which does not necessarily have to be very accurate. However, since the distance between the sensor and the measured object is constantly changing, the accuracy of temperature measurement will decrease, and the detection time may not be well controlled. After weighing the advantages and disadvantages of the two solutions, we decided to sacrifice accuracy and choose the second solution with a relatively simple algorithm and low power consumption. Because it is difficult to ensure the speed of the sensor and the object being measured, and the risk of failure caused by moving the sensor is also great, it is difficult to ensure effective continuous temperature measurement. To sum up, we choose the infrared array thermopile sensor as the core sensor of the entire temperature measurement circuit, and use the semi-active angle tracking method to ensure that the sensor continuously measures the body temperature of the object being measured.
We chose the AMG8833 module as our infrared array thermopile sensor module. This module integrates an 8×8 infrared array thermopile sensor Grid-Eye from Panasonic. The viewing angle is 60 degrees. Panasonic’s MEMS technology is used internally. Integrating a complete signal processing circuit, the thermal image can be output at the fastest 10 frames per second, and the output can communicate with the microprocessor through the I2C interface. The microprocessor uses ATmega328, which has 32KB programmable flash memory, 32×8bit general-purpose registers, and a maximum clock of 20MHz.
人体温度显著高于环境温度(室内环境下通常是这样),且额头部分的温度是人体温度最高的部分(正常人类通常是这样);
测温入口为长度大于三米、宽一米的通道,被测人员不会从其他位置突然出现在测温区间内。现实生活中很多单向,较长的通道,所以此假设符合实际;
测温通道只能单人通行,即被测人甲通过后,被测人乙才能进入通道。在后续的改进中,此假设可以放宽松;
被测人速度在正常的范围内(1~1.5m/s),移动速度过快的行人无法保证检测时间大于1s;
测温区间内无其他热源,如正在工作的微波炉,热水壶等。在后续的算法改进中,此假设可放宽松。
Figure 3: Temperature measurement flow chart
After turning on the power, the connected human body sensor (the sensor model used here is HC-SR501) detects whether there is movement of the infrared heat source (human body) within 2m at an angle of 100 degrees in the opposite direction. If there is no movement of the human body, the AMG8833 does not detect the movement of the human body. Start to save power consumption and computing power. If there is human movement, AMG8833 is started to detect the temperature. The result obtained after data processing of the detected temperature is the person's forehead temperature. The result is compared with the set threshold (37.8°C). If the threshold is exceeded, the buzzer starts and alarms.
Any object emits infrared radiation, and the radiation power increases as the surface temperature of the object increases. Based on this relationship, the thermopile can accurately determine the temperature of an object by measuring the infrared radiation it receives. The core of a thermopile is a plurality of thermocouples, and their operation is based on the Seebeck effect. After the thermocouple receives infrared radiation, the temperature of the infrared absorption film rises, forming a temperature difference with the cold end. Multiple electric thermocouples in series can output a thermoelectromotive force related to the temperature of the object being measured. This thermal electromotive force is compared with the voltage of a high-precision thermistor (usually NTC or Nickel RTD) used to measure ambient temperature, and the temperature of the target object can be calculated. Thermopile The thermopile outputs a small voltage, and its voltage value VTP is determined by the following factors: Target object temperature T¬obj Target object radiation rate ε¬obj Sensor temperature Tsen (sensor temperature is not equal to air or PCB board temperature) Instrument reliability factor s Filter correction factor δ The relationship between the output voltage of the thermopile and the target temperature [4]: As the temperature changes, the resistance of the thermistor changes and is used to detect the temperature inside the sensor. Usually, we can think of it as the ambient temperature. NTC thermistor is the most commonly used temperature measuring thermistor. The resistance value changes exponentially with temperature (Figure 1). Its nonlinearity reduces its accuracy when measuring a wide range of temperatures. The most commonly used temperature measurement range is 0-50. The expression of the resistance and temperature of the thermistor [5] is: where Rth(T) is the resistance of the thermistor when the temperature is T, B is the sensitivity of the thermistor, and R25 is the resistance at a temperature of 25°C. value. Figure 4: RT curve of NTC thermal resistance When calibrating the temperature sensor, first calculate the resistance value of the thermistor, then check the RT table to get the ambient temperature Ta at this time, and find the ambient temperature Ta in the VT table The temperature value Tobj corresponding to the VTP voltage is the temperature of the target object. However, since the response voltage of the sensor and the resistance of the NTC will all have deviations, using the above temperature measurement method will inevitably lead to inaccurate actual measurement values and a certain deviation. Therefore, the sensor needs to be calibrated to eliminate this deviation. The simple method of calibration [5] is as follows: Place the sensor in a 25°C constant-temperature water tank and let it sit for 20 minutes, so that the sensor itself reaches 25°C. Note that the sensor must be isolated from water. Read the resistance value of the NTC resistor, compare it with the corresponding reference resistance value at 25°C, generate a correction coefficient α, and eliminate the thermistor deviation through the calibration of the thermistor. Aim the sensor at a 37°C blackbody target for temperature measurement, and obtain the thermoelectromotive force caused by the temperature difference of the thermopile. Compare it with the VT table to generate a correction coefficient β, and eliminate the deviation of the thermopile through calibration of the thermopile. After the correction coefficient is introduced, the actual temperature of the measured object can be obtained directly through the RT meter and VT meter. Since we are using the AMG8833 integrated board, the internal functional module diagram is shown in Figure 2. Its thermopile sensor, external amplification circuit, ADC, etc. are all integrated on the Grid-EYE, and the calibration and correction work have been completed. Figure 5: Internal function diagram of “Grid-EYE”
When the 8×8 temperature lattice is input into the MCU, the corresponding instructions process the measured temperature. The simple process is shown in Figure 6. Figure 6: Temperature processing flow chart. When the human body is detected and the AMG8833 is started, it will return an 8x8 two-dimensional array at a speed of 10 frames per second. Here, first perform a size comparison of the arrays in each column, and compare the maximum size of each column. Select the value to get a one-dimensional array with 8 elements. Then compare the size of the one-dimensional array and select the position of the largest number. This point is the position where the left end of the sensor should be aligned next time. Start The stepper motor rotates the sensor to the corresponding position to start the next temperature measurement. After repeating 10 times (1 second), average the highest temperature taken for each temperature measurement, which is the actual forehead temperature of the person being measured. The specific algorithm implementation is shown in Figures 7 and 8. The last j is the number of columns where the highest temperature is located. Figure 7: Code for the first size comparison Figure 8: Code for the second size comparison
The schematic diagram of the main circuit is shown in Figure 9. The corresponding functions of each module have been marked on the schematic diagram. The PCB board of the main circuit is shown in Figure 10. Figure 9: Main circuit schematic diagram Figure 10: Main circuit PCB The schematic diagram and PCB of the temperature measurement module are shown in Figures 11 and 12. Figure 11: Schematic diagram of temperature measurement sensor Figure 12: Temperature measurement circuit PCB
In the program used in this test, in order to avoid process blocking caused by calling the stepper motor, the program to control the stepper motor is handed over to the slave computer (Arduino Nano), and the output pins are SDA and SCL on the board. The input pins are: SDA>>PD4, SCL>>PD5
Due to the shortage of temperature measurement components, I borrowed a friend's MLX90640. Because the communication baud rate of the sensor was too high and could not be adapted, I decided to use a computer to simulate the output of the serial port data. According to the information book: Because the amount of data is too large, Manual input is too troublesome. Here, the serial port signal is reduced to an 8x8 grid, with a total of 136 bytes per frame. This is the data table of the analog serial port output. For the convenience of debugging, the background noise is changed to 30℃. Debugging process: First, send the frame header and data amount <5A5A-8800> through the serial port. The module returns Ready, indicating that the frame header is recognized and a temperature recognition scan is started. After sending data eight times, the maximum temperature value is calculated: 34.30 degrees. If the measured temperature is less than the set ambient temperature, the temperature will not be displayed. When the human body moves within the field of view of the sensor, the sensor will follow the movement of the human body. When the human body walks out of the sensor After reaching the range, the sensor automatically returns to its original position. When the temperature in the data exceeds 37.8 degrees, an alarm signal will be output through the serial port, and the corresponding buzzer will sound the alarm.
本次比赛为线上形式,尽管队员之间的配合存在很大的问题,我们尽力克服种种困难,细致分工,最终能在截止前完成比赛的基本任务。我们的选题:自动测温系统,比较新颖,收到的要求比较严格,在与市面上已经存在的红外人体测温成像仪加黑体相比,我们做出来的小型系统在性能上几乎无法与之相比。为了保证任务能顺利完成,我们最终选择牺牲测温精度,采用AMG8833这个小巧廉价的热成像仪对2m以内的人体进行测温再通过修正算法,尽力将误差降低。
【references】
[1] Arrow Electronics fully automatic infrared human body temperature measurement system. http://www.iraytek.com/products/tk/Xmini/ [2] M. Kimata, Trends in small-format infrared array sensors, Sensors IEEE (2013 ) 1–4 [3]A. Hayashida, V. Moshnyaga and K. Hashimoto, "The use of thermal ir array sensor for indoor fall detection," 2017 IEEE International Conference on Systems, Man, and Cybernetics (SMC), Banff, AB, 2017, pp. 594-599, doi: 10.1109/SMC.2017.8122671. [4] THERMOPILE SENSOR FOR CONTACTLESS TEMPERATURE. TE connectivity. https://www.te.com/content/dam/te-com/documents/ sensors/global/analog-digital-thermopile-application-note.pdf . [5] HY16F3981 Infrared Temperature Measurement Application Note. Hycontek Technology. http://www.hycontek.com/hy_mcu/APD-HY16F025_TC.pdf
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet