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.



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.



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.



  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
    curl -sL | 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​

    Append the code with 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 egg_info” failed with error code 1 in /tmp/pip-build-8gnol4sx/PyQt5/” and re-run the python script.

SAP Cloud Platform IoT


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.



Assigned Tags

      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


      Pi Camera v2:

      Raspberry Pi 3 B+ :

      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