Quickly Design a System to Reliably Sense Human Presence

作者:Bill Giovino

資料提供者:DigiKey 北美編輯群

Designers of embedded systems, particularly those for Internet of Things (IoT) applications, are increasingly being tasked with detecting the presence of people in a target area. The applications vary to include security, lighting, and general building automation, but they all share the challenge of cost-effective, reliable detection.

This article will discuss the importance of reliable human presence detection and why popular presence sensors such as cameras and plain thermal sensors are often not the optimal sensing modality. It will then introduce smart thermal sensors and how they can be used with a microcontroller to cost-effectively and simply address the problem of reliable presence sensing.

Sensor failure can be costly

The consequences of a failed or false detection in a presence sensing system range from the inconvenient to the expensive. For example, with lighting, a failure to detect simply means someone has to manually turn on the lights. A false positive can lead to an expensive lighting bill. The same applies to building automation where HVACs are now often optimized remotely around human presence using the IoT. For security, a false positive can result in a false alarm, which can be costly if the local police have to be called. A failure to detect can result in property loss or personal injury.

In each of these situations, one or more persons must be detected with a high degree of reliability. Cameras are good when used with intelligent software. However, if a live or stored video feed is unnecessary, this can be overkill, as well as being completely dependent upon the reliability of the associated software. Video also assumes that persons are easily recognizable as humans on video, and are in plain view of the cameras and not obscured by boxes or cubicle walls.

Plain thermal sensors can detect the presence of human body heat but lack any intelligence to detect movement or identify the number of persons.

Reliability through smart simplicity

The solution to achieving the right balance of reliability and cost lies in the D6T series of smart thermal sensors from Omron Electronics Components. Designed specifically to detect human presence within the sensors’ thermal detection ranges, each D6T has either 1, 8, or 16 thermopile sensor chips behind a silicon lens, with a custom ASIC to process the output (Figure 1).

Image of Omron D6T series thermal sensor

Figure 1: The Omron D6T series of thermal sensors are smaller than a postage stamp and automatically convert infrared light into a matrix of Celsius (°C)  temperatures. (Image source: Omron)

The lens gathers infrared radiation within the detection range of the device and focuses it on the thermopile sensors. The intensity of the infrared radiation corresponds to the surface temperature of the objects in that range. The thermopiles measure the intensity of the infrared radiation as a resistance, which is fed to a custom ASIC on board. The ASIC converts the resistance to temperature (°C), which is available to a microcontroller over an I2C serial interface. The detectable temperature range is from -40°C to +85°C.

Simple detection

The simplest sensor in the D6T product line is the D6T-1A-01. It has a single thermopile sensor behind the lens so it outputs a single temperature. The silicon lens has a field of view (FOV) of 58.0 degrees in both X and Y directions. The FOV is important for identifying persons within its scope. For the D6T-1A-01, if a person completely fills its 58.0 degree X and Y FOVs, then the reading for the single thermopile sensor will be the radiated surface temperature of the person. However, if the person does not completely fill the FOV, then the temperature reading for a single thermopile sensor will be a combination of the person’s infrared radiation plus the background radiation (Figure 2).

Image of FOV of a single D6T thermopile sensor

Figure 2: Within the FOV of a single D6T thermopile sensor, the closer a person is, the more accurate the thermal detection because a person will fill more of the FOV. (Image source: Omron)

For a more focused detection area, the Omron D6T-1A-02 also has a single thermopile sensor, but the silicon lens has a narrower FOV of 26.5 degrees.

Sophisticated detection in a room

For more sophisticated presence detection requirements, the D6T-44L-06 microelectromechanical systems (MEMS) thermal sensor has 16 thermopile sensors in a 4x4 matrix. This allows the D6T to not only detect human presence, but also detect location and movement for more than one person (Figure 3). This sensor’s FOV is 44.2 degrees X, 45.7 degrees Y, and it’s worth noting that it’s AEC-Q100 qualified for automotive applications.

Image of Omron D6T-44L-06 thermal sensor

Figure 3: The Omron D6T-44L-06 thermal sensor can detect multiple people in a room with its 4x4 thermal sensor matrix. For this example, the temperature distribution detection result represents surface temperature as colors with red for the hottest detection, to orange, yellow, dark green, green, cyan, and blue representing the coldest. (Image source: Omron)

In a typical scenario with the D6T-44L-06 detecting two people in a room, the first picture in Figure 3 shows no one in a room, which is represented by cool blue-green colors. The second picture shows two people in the room, side by side. Close examination shows that the surface temperature detected by the individual sensors, roughly represented by colors in the bottom, are proportional to how much the person’s body fills the area of the sensor. The radiated heat of the people heats the floor, represented by yellow.

The third picture shows the temperature after the people have stood up and walked to the right, out of the room. Notice that there is still some residual surface temperature as a result of their previous positions, and also as a result of their movement from left-to-right of the frame.

For all three situations, and especially for the last picture, as the two people move from the room, it is up to the firmware developer to distinguish position, location, and movement based on present and past surface temperature readings. Consider that if no one was initially in the room, as in the first picture, and one person entered the room from the right as represented in the third picture, the temperature distribution detection result for the third picture would be much different.

Narrowing the detection field

For a much narrower detection field, the D6T-8L-09 uses a 1x8 MEMS thermal sensor matrix (Figure 4). This sensor has a wide X FOV of 54.5 degrees, with a narrow Y FOV of 5.5 degrees.

Diagram of Omron D6T-8L-09 uses a 1x8 thermal sensor matrix

Figure 4: The Omron D6T-8L-09 uses a 1x8 thermal sensor matrix with a narrow Y FOV of 5.5 degrees that makes it suited to scanning applications. (Image source: Omron)

With the D6T-8L-09, a system can be developed to scan for people as they move through a hallway. This can be especially useful if positioned just before the entrance to a door at the end of a corridor. Motion can be detected in any horizontal direction. This device can also be used to detect vertical motion on a ladder or angled to detect movement on a stairway.

For designers using the D6T series, it’s reassuring to note that all D6T devices share the same connector interface, as shown in the middle drawing of Figure 4. They also use an I2C interface to communicate with any compatible microcontroller. For ease of development, Omron offers the D6T-HARNESS-02 cable which securely connects to any D6T MEMS sensor.

To get the most out of the sensors, it’s important that any cover put over the silicon lens will not decrease the sensitivity of the sensor to infrared emissions. If a cover is necessary, the cover material must allow radiant heat to penetrate. While materials such as high-density polyethylene (HDPE) allow for this, the material should still be as thin as possible.

Using the D6T in a microcontroller system

For a self-contained embedded application, a D6T system should interface to a microcontroller dedicated to the task, especially if the application is for security. The STM32L073VZ microcontroller from STMicroelectronics should be sufficiently powerful to perform the number crunching for a D6T application (Figure 5). It is based on the Arm® Cortex®-M0+ core with a memory protection unit (MPU). The core can be clocked anywhere between 32 kilohertz (kHz) and 32 megahertz (MHz), and is supported by 192 Kbytes of flash, 20 Kbytes of SRAM, and 6 Kbytes of EEPROM. The microcontroller runs off a voltage rail between 1.65 and 3.6 volts and consumes 0.29 microamps (µA). It has multiple serial interfaces, including an I2C interface with a dedicated DMA channel, as well as USB 2.0 and an LCD driver.

Diagram of Arm Cortex-M0-based STM32L073VZ microcontroller

Figure 5: The Arm Cortex-M0-based STM32L073VZ microcontroller is well matched to the D6T smart thermal sensors when developing a self-contained embedded presence sensing system. (Image source: STMicroelectronics)

Many of the STM32L073VZ’s features compliment the D6T in a presence sensing application. For example, the 6 Kbytes of internal EEPROM can be used to store custom room identifying information that might change based on the location of the D6T system. The USB 2.0 interface can be used to download information to a PC on past intrusions such as timestamps of logged detection events and the number of people identified. This information can be stored in the 20 Kbytes of RAM or the EEPROM, while 192 Kbytes of flash memory is enough to store identifying algorithms.

The LCD driver peripheral can interface to an external LCD display that can show a running count of detection events. The microcontroller’s 24-channel capacitive sensing peripheral can detect the presence of a finger on a capacitive keypad for configuring the system, or can interface to a capacitive touch sensor in a security system. Two 12-bit digital-to-analog converters (DACs) are available that can interface to a speaker to provide a synthesized voice or an audible alarm. The processor’s 12-bit analog-to-digital converter (ADC) can interface to a temperature sensor to detect ambient temperatures that might affect the sensitivity of the D6T. For a lighting automation application, the ADC can connect to a light sensor to detect if the lights were successfully turned on.

For building security applications, code memory on the STM32L073VZ can be protected with the microcontroller’s internal firewall. The firewall protects internal memory from being read by an external interface, even if a debugger is connected.

Using the STM32L073VZ to read the values inside a D6T requires reading the registers over the I2C interface. The D6T-1A devices have one register (P0) to read the single thermal sensor, the D6T-8L devices have eight registers (P0-P7), and the D6T-44L have sixteen registers (P0-P15).

Reading data from a D6T

Reading temperature data from a D6T with the I2C interface is a relatively simple task. Every time the microcontroller reads data from a D6T, the output format is the same. First, the value of the internal reference temperature is sent, followed by the values of all the temperature sensors, and last is the CRC-8 packet checksum. There is nothing to configure or write on the D6T sensors. The D6T ASIC is hard-wired to take new sensor readings every 250 milliseconds (ms), allowing for sensor readings over the I2C bus four times a second. The I2C interface supports a maximum speed of 100 kHz.

Temperatures are read as 16-bit signed data, with the value representing ten times the temperature in °C, so if the temperature reading is 0x01D7, that translates to 471 which is 47.1°C.  If the registers show 0xFF06, that translates to -250 which is -25.0°C.

Omron supplies I2C library functions to read temperature values from the D6T sensor family. Note that the D6T-1A-01, D6T-1A-02, and the D6T-8L-09 do not support I2C clock stretching, so they are not able to slow down the I2C master clock if they can’t keep up. If this is required, the microcontroller firmware may have to provide for this.

Practical detection techniques

When detecting people in an area, the developer should first take sample readings with the area empty to determine surface temperatures for the ambient conditions, and then take readings with people present in that area. Connecting the ADC in the STM32L073VZ to a temperature sensor allows the ambient temperature to be factored into any detection algorithm.

It’s difficult to give a general guideline for presence detection, as each room situation will be different. However, one detection method is to look for a sudden rise in temperature in one or more thermopile sensors. As seen in the example in Figure 3, when a person leaves an area, higher residual surface temperatures may linger on floors or furniture. Detection of two or more people is more complicated than detecting one person, but it is not difficult when the basic detection technique is sorting for a rise in temperature.

When calibrating the system during development, the sensitivity of the system can be tweaked by making the rise in temperature to be detected a variable in firmware that is eventually stored in the EEPROM in the STM32L073VZ. Calibration should be done at various room temperatures, with various settings of the air conditioning and heat, and with people wearing T-shirts or winter jackets.

Conclusion

Presence detection is an increasingly important function for embedded and IoT systems, and it needs to be done effectively, with the appropriate balance of cost, simplicity, and effectiveness. The Omron D6T series of smart surface temperature sensors address this balance and allow designers to quickly prototype and develop a system to detect the presence of multiple persons in an area. Paired with the STM32L073V microcontroller which has a flexible set of peripherals, a detection system can be developed that is simple, reliable, and readily customized.

 
DigiKey logo

聲明:各作者及/或論壇參與者於本網站所發表之意見、理念和觀點,概不反映 DigiKey 的意見、理念和觀點,亦非 DigiKey 的正式原則。

關於作者

Image of Bill Giovino

Bill Giovino

Bill Giovino 是電子工程師,擁有美國雪城大學的電機工程學士學位,也是少數從設計工程師跨足現場應用工程師,再到技術行銷領域的成功典範之一。

Bill 過去 25 年來熱衷於向科技和非科技業的對象推廣新技術,包括 STMicroelectronics、Intel 和 Maxim Integrated 等多家企業。Bill 在 STMicroelectronics 任職期間,曾協助領導該公司順利進軍微控制器領域。在 Infineon 任職時,則策劃出該公司首款在美國汽車業大受歡迎的微控制器設計。Bill 目前是他個人公司 CPU Technologies 的行銷顧問,曾協助諸多企業讓表現不佳的產品重獲市場青睞。

Bill 更是採用物聯網的先驅,包括在微控制器中首次納入完整的 TCP/IP 堆疊。Bill 致力於推廣「用教育促成銷售」的理念,也認可在線上推銷產品時有清楚完整文字說明的重要性。他在 LikedIn 熱門的半導體銷售和行銷群組中擔任管理員,也擁有深厚的 B2E 知識。

關於出版者

DigiKey 北美編輯群