Skip to Content
Technical Articles
Author's profile photo Niladri Podder

Log temperature data of a person using thermal scanner into SAP Leonardo IoT

Note: This blog post is a concept idea of recording temperature data using a thermal scanner setup and not intended to be used as a final product.

 

Introduction

Nowadays we can see thermal scanners are deployed in multiple locations to identify the temperature of people suspected to have an unusual fever. Various entry points like Airport, Halls, Government buildings, and hospitals have installed the thermal scanner that can identify the body temperature from a distance.

 

Use-case

In this blog post, I have tried to overcome the manual checking of temperature level and built a prototype that can automatically identify a person using facial-recognition and log the temperature data to the SAP Leonardo IoT platform for analytics. In place of facial recognition, we can also capture a face that can be useful to track the concerned person if any anomaly gets detected.

Block Diagram

The Pi Camera and MLX90640 IR Thermal Camera are connected to the Raspberry Pi. Image processing is done parallelly from both the feeds. A Python script that is running on Raspberry Pi sends the processed data to SAP Cloud Platform IoT using HTTPS.

 

Components

  1. Raspberry Pi Camera v2
  2. Raspberry 3B or 4
  3. MLX90640 IR Thermal Camera
  4. SAP Leonardo IoT

 

 

Setting up the Prototype

  1. Pi Camera Setup: Install the Raspberry Pi Camera module by inserting the cable into the Raspberry Pi. For detailed steps, you can check the link. If you are using OpenCV to access Pi Camera then execute:
    sudo modprobe bcm2835-v4l2

    which will “enable” the camera for OpenCV automatically and you can use the command cv2.VideoCapture(0).

  2. Facial Recognition: You can follow my GitHub link to set up facial recognition or can use the face-recognition python library. Follow the installation steps for the face_recognition library setup:
    1. Make sure CMake is installed or you can execute:
      sudo apt-get install cmake
    2. Clean archives path to have extra memory and to avoid OOM issue:
      cd /var/cache/apt/archives
      sudo du -sh 
      sudo apt-get clean
      free -h
    3. Execute:
      sudo pip3 --no-cache-dir install face_recognition
  3. Thermal Camera: Connect the specified pins of MLX90640 to Raspberry Pi GPIO.MLX90640 IR thermal camera can display the relative temperature and shape of the objects while keeping it in front of the IR Camera.
  4. Installation steps:
    1. Install grove.py:
    curl -sL https://github.com/Seeed-Studio/grove.py/raw/master/install.sh | sudo bash -s -
    
    2. Install MLX90640 driver 
    sudo pip3 install seeed-python-mlx90640
    
    3. Check if the i2c device works properly, 0x33 is the MLX90640 i2c address.
    i2cdetect -y -r 1
    ​

  5. Register a device in SAP Cloud Platform Internet of Things Service Cockpit and get the device Certificate.
  6. You can take a reference for the Python code to send the data using the HTTP protocol.
  7. Execute
    sudo git clone https://github.com/gobuyun/seeed_ircamera.git​

    Append the code with seeed_python_ircamera.py to send the values to the SAP IoT Cockpit.

  8. Execute
    sudo apt-get install qt5-default pyqt5-dev pyqt5-dev-tools​

    if you get any error “Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-8gnol4sx/PyQt5/” and re-run the python script.

SAP Cloud Platform IoT

Conclusion

This prototype can be easily extended into other projects and can monitor several other parameters. This DIY setup is an easy way to auto-register temp values to the cloud and can alert individuals if any irregularities are observed in temperature readings.

Reference

MLX90640: https://www.seeedstudio.com/blog/2019/11/25/mlx90640-thermal-imaging-cameras-for-your-microcontroller/

Assigned Tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Luca Toldo
      Luca Toldo

      great project ! Well done !

      Author's profile photo MS J
      MS J

      Good One 🙂

      Author's profile photo Selvakumar Mohan
      Selvakumar Mohan

      Can you update the AMAZON or EBAY URLs where you procured these, so it can help to prototype similar one.

      Author's profile photo Niladri Podder
      Niladri Podder
      Blog Post Author

      MLX90640: https://www.evelta.com/mlx90640-thermal-far-infrared-camera-breakout-wide-angle/

      Pi Camera v2: https://www.amazon.in/Raspberry-5MP-Camera-Board-Module/dp/B00E1GGE40/ref=sr_1_1?crid=HX6EED96V2JG&dchild=1&keywords=pi+camera+v2.1&qid=1585812234&sprefix=pi+camera%2Caps%2C291&sr=8-1

      Raspberry Pi 3 B+ : https://www.amazon.in/Raspberry-Pi-3B-plus-Motherboard/dp/B07BDR5PDW/ref=sr_1_2?dchild=1&keywords=raspberry+pi+3+b%2B&qid=1585812356&sr=8-2

      Author's profile photo Selvakumar Mohan
      Selvakumar Mohan

      Thanks, Niladri. This blog is a very good one to rehash to test our capabilities. Much appreciated.

      Author's profile photo Reshma Srivastava
      Reshma Srivastava

      Nice blog post.

      Author's profile photo Niladri Podder
      Niladri Podder
      Blog Post Author

      Thanks Reshma

      Author's profile photo Kamran khan
      Kamran khan

      Great sir how you do that i wanna buy it can you buy it