Skip to Content
Technical Articles

Log temperature data of a person suspected to have COVID-19 infection into SAP Leonardo IoT

Introduction

As the novel Coronavirus pandemic continues to evolve, 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 which 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. Using SAP Leonardo IoT we can further build custom rules and can trigger commands from the cloud. 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 due to COVID-19 infection.

Reference

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

2 Comments
You must be Logged on to comment or reply to a post.