Technical Articles
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
Use-case
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
- Raspberry Pi Camera v2
- Raspberry 3B or 4
- MLX90640 IR Thermal Camera
- SAP Leonardo IoT
Setting up the Prototype
- 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).
- 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:
- Make sure CMake is installed or you can execute:
sudo apt-get install cmake
- 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
- Execute:
sudo pip3 --no-cache-dir install face_recognition
- Make sure CMake is installed or you can execute:
- 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.
- 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
- Register a device in SAP Cloud Platform Internet of Things Service Cockpit and get the device Certificate.
- You can take a reference for the Python code to send the data using the HTTP protocol.
- 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.
- 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.
great project ! Well done !
Good One 🙂
Can you update the AMAZON or EBAY URLs where you procured these, so it can help to prototype similar one.
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
Thanks, Niladri. This blog is a very good one to rehash to test our capabilities. Much appreciated.
Nice blog post.
Thanks Reshma
Great sir how you do that i wanna buy it can you buy it