Low Cost Thermal Sensor Array For Wide Area Monitoring

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Low cost thermal sensor array for wide area

monitoring
Valeriu Manuel Ionescu Florentina Magda Enescu
Department of Electronics, Communications and Computers, Department of Electronics, Communications and Computers,
University of Pitesti, Romania University of Pitesti, Romania
manuelcore@yahoo.com enescu_flor@yahoo.com

Abstract—Thermal sensors have come into light with the development directions are presented in the final chapter of
rise of the COVID-19 global pandemic as one of the tools used this paper.
for screening. There are multiple sensors available on the
market ranging from low cost to very high cost. This paper II. LITERATURE REVIEW
presents how smaller and cheaper sensors can be combined in Person detection, tracking and face recognition have
a larger array of sensors that give better coverage and can be
come to news media focus in recent months with the protests
used for shape detection and object tracking. The sensors used
in Honk Kong and many novel techniques have appeared in
are AMG8833 FeatherWing and the platform is Raspberry Pi.
order to fool face detection and recognition algorithms
Keywords— AMG8833, sensor array, thermal camera, object (besides the obvious full face masks) like special sunglasses
detection, Raspberry Pi or make-up. There are many cases where certain types of
clothes can fool face detection algorithms [6] [7].
I. INTRODUCTION
In the case of COVID-19 thermal cameras were used as a
Thermal sensors are tools used in many domains as they screening solution to detect infections at business entries and
indicate the presence of a heat level different from the in many factories that have remained active during the global
environment temperature. A thermal sensor uses include pandemic [8].
health, domestic use, and system control [1] [2] to access
Against thermal surveillance some solutions have also
security [3].
appeared [9] but in general person presence detection is still
One of their uses is the detection of shapes used in possible, while recognition is harder to perform. It can be
person recognition. The advantages of this technique are argued that having a full body thermal camouflage is rarely
that the thermal signature can be detected even in pitch seen in public spaces and is beyond the scope of this paper.
black conditions and the thermal emissions in general are
hard to cover completely. These characteristics make object With respect to health data privacy, some authors have
tracking easy to perform. In a worst case scenario, proposed novel systems for monitoring human temperature
temperature sensors can be used as additional tools in the for indoor elderly patients [17] by using thermal sensors. The
process of motion detection and shape recognition, giving thermal sensors were the low cost AMG8833. Others [18]
have evaluated the usage of low cost sensors in medical
an indication of the object shape and the area where the
facilities instead of expensive thermal monitoring solutions
shape recognition can be performed with different tools.
and found them to be good enough for the intended purpose.
Another important use of thermal sensors is in the detection In [21] a multi low resolution thermal sensor setup is used in
of human temperature, especially during the period of the the monitoring of patients that respects the patient’s privacy.
SAR-COV-2 (Coronavirus 19) pandemic. As fever has
been detected as one of the signs of this infection [4], many In [19] thermal sensors were used for lecturer tracking
governments have imposed or recommended access during video courses in order to prevent losing focus of the
restrictions for persons that show signs of fever [5], with the subject.
detection being made by thermal sensors in order to respect Finally in [20] the usability of thermal sensors is
the social distancing measures. Finally with many concerns investigated for human detection in automotive industry in
related to person tracking, thermal sensors offer data that is the worst case scenario where full body cover (hijab) is used,
hard to link to a specific person without additional detection for different body weights and different distances.
means.
All the above papers outline the object tracking
This paper presents the implementation of a multi sensor
capabilities of thermal cameras with respect to user privacy
system that is used for shape detection for a wider area and good results for even low cost thermal cameras.
when compared to a single sensor. The sensor used is the
Panasonic AMG8833 8x8 GridEYE sensor on an Adafruit III. SYSTEM DESIGN AND IMPLEMENTATION
Feather board. The data acquisitions and processing is done There are many thermal sensors, the main characteristics
on a Raspberry Pi 3 board. being: price, resolution, accuracy and field of view [18].
The reminder of this paper will present an overview of Some examples are:
the current literature of the uses of thermal sensors in
Chapter II followed by the proposed system architecture and -MLX90640 sensor, an 32x24 array with 55° FoV or
implementation, in Chapter III. Finally the application is 110° FoV at $69.95, with a best case accuracy of ±1.5°C and
presented in Chapter IV, while conclusions and a temperature range of -40°C-300°C, current consumption
future less than 23mA;

© IEEE 2020. This article is free to access and download, along with rights
for full text and data mining, re-use and analysis
Authorized licensed use limited to: IEEE Xplore. Downloaded on September 30,2021 at 21:53:41 UTC from IEEE Xplore. Restrictions apply.
-AMG8833, an 8x8 sensor with 60° FoV, with a best
case accurancy of ±2.5°C and a temperature range of 0°C to
80°C, current consumption less than 4.5mA;
- Flir Lepton, an 160x120 or 80x60 array with 25°, 50°,
56° FoV at prices ranging from $150-$200, with an accuracy
of ±5°C and a temperature range of -10°C to 450°C, with
consumption of 650mW during shutter event (approximately
200mA current consumption).
As seen, Panasonic AMG8833 8x8 GridEYE sensor [11]
is one of the cheapest offering an 8x8 array of IR thermal
sensors that will measure temperatures ranging from 0°C to
Fig. 1. Image of a hand taken by a single 8x8 AMG8833 sensor processed
80°C with an accuracy of +- 2.5°C, a Field of View (FoV) of with Gaussian interpolation algorithm
60°[12], up to 7 meters with a frame rate of 10Hz. The 8833
value indicates 8x8 pixels, 3.3 voltage, and Amplification
factor high performance type High gain. Raspberry Pi

AMG8833 comes installed in two boards: AMG8833 IR


Thermal Camera FeatherWing with only the chip and Raspberry Pi
connectors, and AMG8833 Grid-EYE Breakout that has the NoIR
chip itself, connectors, a 3.3V regulator and level shifting. In
this paper we will be using the FeatherWing version because
60° 60°
we will connect directly to a 3.3V power supply. The current
consumption is very low, of only 4.5mA in normal operation AMG8833 AMG8833
mode, therefore is easily offered by Raspberry Pi or
Arduino) power ports.
Two of the most popular platforms for developing
projects that give easy access to multiple I/O ports are
Arduino and Raspberry. The challenges for Arduino come
from the limited memory, parallel processing power and
speed. The programming in made in C but there are
alternatives available such as Python [13]. Optimizations are
very important and can improve speed dramatically as seen
from the original version to updated version of the code here Fig. 2. Hardware system structure and AMG8833 sensor positioning
[14]. Raspberry Pi is closer to a real PC in terms of
processing power than Arduino, but this creates a different
set of challenges: as programmers have more processing
power and processing options (languages, etc) are able to use
more advanced processing functions that cannot be
processed close to real time.
For the project presented in this paper, Rasperry Pi 3 was
used. The CPU was used at 16% on average during data
collection, processing and display; therefore further
processing can be done in parallel such as face recognition
using the Raspberry Pi camera.
One important aspect for a thermal sensor is calibration.
If the sensor is used uncalibrated, it may show temperatures
with a couple of degrees higher and lower when compared to A B
normal. For a human body the temperatures range from 36°C
to 38°C. Anything higher often indicates fever. Fig. 3. A. Good positioning of the two cameras with flawless inter sensor
transition; B. Bad positioning of the two cameras with an overlap of the
Using a single camera gives a 60° FoV but the limited sensor coverage area in the middle, signaled by the dim area in the middle
number of sensors means that in order to detect a person it
needs to be at a distance sufficient to “fit” inside the sensor The separation of the viewing angles of the two sensors
detection zone. Increasing the coverage area by doubling the should be respected as it is easily detectable when the two
number of sensors allows the person to come much closer to thermal camera FoVs overlap, as seen in Fig. 3 B, or when
the camera and still fit fully inside the field of view. This in the cameras have a gap in the two fields of view (in this case
turn allows better taking temperature values (sensor data is the subject disappears or the heatmap intensity dims when
more accurate as the person comes closer to the thermal transitioning the space between the two cameras. The sensors
camera). were placed at 60° in order to offer a wider coverage of the
area, making easier to track objects in the vicinity of the
platform. The camera connected to the Raspberry Pi platform
is Raspberry Pi NoIR that allows taking images in areas with
infrared lights. The FoV for this camera is 62.2 degrees
Horizontal and 48.8 degrees Vertical) [15]. The camera was

Authorized licensed use limited to: IEEE Xplore. Downloaded on September 30,2021 at 21:53:41 UTC from IEEE Xplore. Restrictions apply.
used to compare the images with the thermal sensor Fig. 5. Hardware system picture (with central Raspberry Pi camera and the
information and to assess the usability of thermal tracking as tow AMG8833 sensors) before sensor positioning, that gave sensor overlap
a help for person and face location (that could be used for
face recognition). The results of taking images with thermal
sensors, Pi NoIR and a normal webcam during the day in a
room with dark covers are shown in Fig. 4. While the
webcam image is barely visible, in the thermal image (wide,
Fig. 4 B) the person is clearly detected and in the Pi NoIR
image (Fig. 4 C, daylight with black curtains) even face Fig. 6. Connected bridge for 0x68 I2C address
recognition can be performed.
The application was written in Python and uses the
Adafruit_AMG88xx class written by Dean Miller for
Adafruit Industries [11]. The libraries used were installed
with pip3 (sudo apt install python3-pip): opencv (pip3 install
opencv-contrib-python==4.1.0.25) and matplotlib (pip3
install matplotlib). The two sensors were connected to the Fig. 7. Output of the Connected bridge for 0x68 I2C address
system along with the Pi NoIR camera (placed in the middle,
Fig. 5). The sensors offer a connector that can be closed to
change the I2C address (0x69 when open, 0x68 when closed)
and it was closed for one of them as seen in Fig. 6. For more
than 2 sensors, an I2C address multiplexer would have to be
implemented. The sensor detection in Linux is seen in Fig. 7.
The sensors output temperature data but they need a few
seconds for the data to stabilize. The sensor 8x8 array is seen
in Fig. 8.
Fig. 8. Sensor AMG88338x8 data array

IV. APPLICATION IMPLEMENTATION


The implemented application takes the sensor data,
processes it, detects the region with the highest temperature
and displays it on the screen. Application structure:
Step 1: wait for the output to stabilize [12].
Step 2: determine a baseline temperature value against a
known environment temperature that allows us to
compensate for any measurement errors and differences in
individual sensor reported values. In this case a plastic cover
A B at room temperature placed over the sensors was used.
Step 3: sensor data is read from the two sensors and
concatenated in a single vector to create the wide thermal
image;
Step 4: on the resulted data. the interpolation algorithm is
applied. Different interpolation algorithms were used:
“nearest”, “bicubic”, “gaussian”, “lanzcos”, etc. Excepting
“nearest” all algorithms produced shapes that could
successfully be used for object detection and tracking.
Step 5: In order to determine the location of the person in
C D the resulted image, a simple blob detection algorithm was
used [16], on an inverted binary image
Fig. 4. A. Image taken with a single thermal camera, B Image taken with 2
thermal cameras; C Image taken with Raspberry Pi Camera; D Image taken
(THRESH_BINARY_INV) with filtering by area and
with a normal webcam selection of the largest blob found. The algorithm in
OpenCV assumes dark blobs on a white background (this
error was easily detected as a large white blob on a black
background was not being detected); this is why the color
inversion was necessary. The transformation sequence is
seen in Fig. 9.
Step 6: combine the thermal image with the blob
detection by placing a circle over the largest zone with the
highest temperature using the drawKeypoints function, as
seen in Fig. 9 D.
Step 7: the final the image is updated on the screen and
the algorithm resumes at step 3.

Authorized licensed use limited to: IEEE Xplore. Downloaded on September 30,2021 at 21:53:41 UTC from IEEE Xplore. Restrictions apply.
A problem was encountered when a smaller blob was [1] Song, Eungyeol & Lee, Hyeongmin & Choi, Jaesung & Lee,
selected by the algorithm instead of the (apparently) larger Sangyoun. (2018). AHD: Thermal-Image Based Adaptive Hand
Detection for Enhanced Tracking System. IEEE Access. PP. 1-1.
one. After listing the blobs found, the cause was found to be 10.1109/ACCESS.2018.2810951.
the structure of the larger blob that gave the impression of a [2] Vandersteegen, Maarten & Reusen, Wouter & Van Beeck, Kristof.
single one but was instead formed from many smaller blobs. (2020). Low-latency hand gesture recognition with a low resolution
The solution was to apply a Gaussian blur over the image thermal imager.
before the blob detection in order to merge the smaller blobs [3] Petar Andraši, Tomislav Radišić, Mario Muštra, Jurica Ivošević,
in a single larger one as seen in Fig, 9 B. The detection Night-time Detection of UAVs using Thermal Infrared Camera,
algorithm works well for body detection even when the Transportation Research Procedia, Volume 28, 2017, Pages 183-190,
ISSN 2352-1465, https://doi.org/10.1016/j.trpro.2017.12.184
person is further away (3-4m) from the sensor and the
[4] Lisa Lockerd Maragakis, Coronavirus Symptoms: Frequently Asked
thermal footprint is less visible (Fig. 10). Questions, Web, https://www.hopkinsmedicine.org/health/conditions-
and-diseases/coronavirus/coronavirus-symptoms-frequently-asked-
questions, accessed 20.05.2020
[5] MINISTERUL AFACERILOR INTERNE. “Informare COVID-19,
Grupul de Comunicare Strategică, 14 mai 2020, ora 13.00”, Web,
https://www.mai.gov.ro/guvernul-a-aprobat-in-sedinta-de-astazi-14-
mai-2020-ordonanta-de-urgenta-pentru-modificarea-si-completarea-
unor-acte-normative-cu-incidenta-in-domeniul-managementului-
situatiilor-de-urgenta-si-al-pr/, accessed 20.05.2020
[6] Bruce MacDonald. Fooling Facial Detection with Fashion, , Jun 4,
2019, web, https://towardsdatascience.com/fooling-facial-detection-
A B C D with-fashion-d668ed919eb, accessed 20.05.2020
[7] Alexey Kurakin and Ian Goodfellow and Samy Bengio. Adversarial
Fig. 9. Processing stages of the sensor data: A. initial image. B. blurred examples in the physical world, 2016, arXiv:1607.02533
image to merge smaller blobs, C detected blob, D combine detection zone
with initial image [8] Kathy Pretz, Thermal Cameras Are Being Outfitted to Detect Fever
and Conduct Contact Tracing for COVID-19, IEEE Spectrum,
04.05.2020
[9] Adam Harvey, Stealth Wear, web, https://ahprojects.com/stealth-
wear/, accessed 20.05.2020
[10] Kowalski, Christian & Blohm, Kolja & Weiss, Sebastian &
Pfingsthorn, Max & Gliesche, Pascal & Hein, Andreas. (2019). Multi
Low-resolution Infrared Sensor Setup for Privacy-preserving
Unobtrusive Indoor Localization. 183-188.
10.5220/0007694601830188.
A B C D
[11] Adafruit. Adafruit AMG8833 8x8 Thermal Camera Sensor, 2018-08-
Fig. 10. More cases of blob detecation in easy (A,B) and difficult 22, web, https://cdn-learn.adafruit.com/downloads/pdf/adafruit-
conditions (C,D) amg8833-8x8-thermal-camera-sensor.pdf, accessed 20.05.2020
[12] Panasonic, Infrared Array Sensor Grid-EYE, Datasheet, 02 Apr.
V. CONCLUSIONS 2017, web, https://cdn.sparkfun.com/assets/4/1/c/0/1/Grid-
EYE_Datasheet.pdf, accessed 20.05.2020
Thermal cameras can help detect objects that are hard or [13] Renato Candido , Arduino With Python: How to Get Started, Oct 21,
impossible to identify using traditional cameras. This paper 2019, web, https://realpython.com/arduino-python/#hello-world-with-
presented the results of implementing a low cost sensor array arduino-and-python
of two sensors for person tracking. The results show that [14] James Villeneuve. thermalcam, web,
even if the resolution of the system did not improve, the https://github.com/jamesdanielv/thermalcam, accessed 20.05.2020
wider monitored area was significantly extended and [15] Raspberry Pi Foundation, “Camera Module”, web,
continuous person tracking in from of the sensor was https://www.raspberrypi.org/documentation/hardware/camera/,
possible. Hardware implementation problems were only accessed 20.05.2020
related to placing the sensors in the correct position [16] OpenCV, “SimpleBlobDetector Class Reference”, web,
https://docs.opencv.org/3.4/d0/d7a/classcv_1_1SimpleBlobDetector.h
(respecting the angle between sensors). The software tml, accessed 20.05.2020
implementation has tested various interpolation methods in [17] M. Gochoo, T. Tan, T. Batjargal, O. Seredin and S. Huang, "Device-
order to give a meaningful image to the person viewing the Free Non-Privacy Invasive Indoor Human Posture Recognition Using
images. Problems were encountered with OpenCV install via Low-Resolution Infrared Sensor-Based Wireless Sensor Networks
pip3, the detection algorithm in the case where the and DCNN," 2018 IEEE International Conference on Systems, Man,
temperature difference was not significant to make the object and Cybernetics (SMC), Miyazaki, Japan, 2018, pp. 2311-2316, doi:
10.1109/SMC.2018.00397.
stand out, but also with the operation of the blob detection
[18] Villa E, Arteaga-Marrero N, Ruiz-Alzola J. Performance Assessment
code in matplotlib library that was targeting dark blobs on of Low-Cost Thermal Cameras for Medical Applications. Sensors
white background. The subject of this paper will be (Basel). 2020 Feb 28;20(5):1321. doi: 10.3390/s20051321. PMID:
continued with object tracking, gesture detection, more 32121299; PMCID: PMC7085792.
sensors (6) added to the system in order to allow 360° [19] Tan-Hsu Tan, Tien-Ying Kuo and Huibin Liu. Intelligent Lecturer
tracking. Finally a web server will be added in order to Tracking and Capturing System Based on Face Detection and
access the monitoring data available from a different device Wireless Sensing Technology, Sensors 2019, 19, 4193;
doi:10.3390/s19194193
without the use of remote connectivity tools such as VNC.
[20] O'Malley, Ronan & Glavin, Martin & Jones, Edward. (2008). A
REFERENCES review of automotive infrared pedestrian detection techniques. 168 -
173. 10.1049/cp:20080657.

Authorized licensed use limited to: IEEE Xplore. Downloaded on September 30,2021 at 21:53:41 UTC from IEEE Xplore. Restrictions apply.

You might also like