This project aims to estimate the human body temperature with a thermal camera connected to a Raspberry Pi computer. Packaged with a battery and small screen, you can create a portable, handheld device to have a quick measure if someone has fever or not.
animation | device |
---|---|
For this prototype, the following hardware has been used:
- Raspberry Pi 2, 3 or 4
- MLX90640 Thermal Sensor, 32x24 px
- Waveshare 4.3inch HDMI LCD (B), 800x480, IPS
- 5V 2.4A power adapter (2x)
- microSD card 8Gb or larger
The MLX90640 is a thermal camera made by Melexis N.V. It has a I2C interface, which is perfect for the Raspberry Pi and other embedded devices. You can find the C++ API, driver and documentation on their Github page. The company Pimoroni has made a breakout board around this sensor, for easy integration with a Raspberry Pi.
Setting | Value | Reference |
---|---|---|
Emisitivity of human skin | 0.99 | [1] |
Average human facial skin temperature | 32-34 degrees Celsius | [2] |
Average human skin temperature | 32-34 degrees Celsius | [3] |
The software is made and tested on Raspbian (Buster). Open /boot/config.txt
and make the following changes:
## Display settings
max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
# Rotate the screen to portrait mode
display_rotate=3
## Settings for the thermal sensor
dtparam=i2c_arm=on
dtparam=spi=on
# Add support for FPS > 16
dtparam=i2c1_baudrate=1000000
If you don't want to make these settings by hand, you can also copy the resources/boot/config.txt
from this project:
cp ./resources/boot/config.txt /boot/config.txt
Reboot the computer after changing the config.txt file.
In the bin
directory is a script, called install_dependencies.sh
.
Download the latest release and unpack the application in your preferred location:
tar zxvf ThermalCamera_1.0.1_raspbian_buster_armv7l.tar.gz
cd ThermalCamera/bin
./install_dependencies.sh
Check the settings in /boot/config.txt
like described above. There is an example file in resources/boot/config.txt
in
this bundle. After changing the config.txt file, reboot the Raspberry Pi.
To run the application:
cd ThermalCamera/bin
./ThermalCamera
Instead of downloading the precompiled binary, you can download the source files and compile it yourself by following the steps below:
git clone https://github.com/gilbertfrancois/skin-temperature-scanner.git
cd skin-temperature-scanner
./bin/install_dependencies.sh
mkdir build
cd build
cmake ..
make
./ThermalCamera
balenaOS is a simple, stable Linux operating system tailored for reliably running Docker containers.
Deploying an app to a balena powered device is easy. Take a look at this guide for a detailed step by step on how to deploy this project.
If you are having trouble drop by our forums and let us know!
After deploying your application, you'll need to add the following:
- Device variable:
RESIN_HOST_CONFIG_display_rotate = 3
- DT parameter:
"i2c1_baudrate=1000000"
[1] Table of emissivity values in the Infrared
[2] Measurement of facial skin temperature
[3] Temperature of a Healthy Human (Skin Temperature)
[4] Infrared thermography in the evaluation of skin temperature, Roope Lasanen