MLX90640 IR Thermal Camera Working With Raspberry Pi 4
Intro: MLX90640 IR Thermal Camera Working With Raspberry Pi 4
Want to detect something that can emit heat and figure out their temperatures? The MLX90640 IR thermal camera can display the relative temperature and shape of the objects as long as you put them in front of the IR thermal camera. IR thermal camera connects with Raspberry Pi 4 var I2C interface, after reading the data from the camera, raspberry pi 4 would process these data and convert them to numbers of pixels and finally displayed as a thermal image on the Raspberry Pi display.
STEP 1: Hardware
Here is the 40 pin schematic of the Raspberry Pi, you can easily find I2C interface SCL and SDA. The IR thermal camera has an I2C Grove interface, so a transform wire is needed from Grove to jump wire. At last, The IR thermal camera is correctly connected with the corresponding pins of the Raspberry Pi.
The next step is simple, a 5’’ Raspberry Pi display needs to be connected with Raspberry Pi 4 var mini HDMI wire. And Raspberry Pi 4 needs to be powered by a 5V/3A power adapter by the USB Type-C interface. Keyboard and mouse are optional depending on your requirements. From now on, an IR thermal camera project’s hardware has already been set up.
STEP 2: Software
The software contains two parts, one for data reading and the other for data processing. So here come two python codes to realize both of the functions. The detail operation steps are as follows.
Step1Install grove.py by the commend
curl -sL <a href="https://github.com/Seeed-Studio/grove.py/raw/master/install.sh"> https://github.com/Seeed-Studio/grove.py/raw/mast...> | sudo bash -s -Step2
Install the MLX90640 driver with the following commend.
pip3 install seeed-python-mlx90640
or (If you have the authority of your Raspberry Pi):
sudo pip3 install seeed-python-mlx90640
if you want to update the driver locally from PyPI. you can use:
pip3 install --upgrade seeed-python-mlx90640Step3
Check if the i2c device works properly, 0x33 is the MLX90640 i2c address.
i2cdetect -y -r 1
If your Raspberry Pi connects well with MLX90640 IR thermal camera, you will get the result below.
0 1 2 3 4 5 6 7 8 9 a b c d e fStep4
00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- 33 -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
Install the upper computer code from Github.
sudo git clone https://github.com/gobuyun/seeed_ircamera.gitStep5
Operate the python file and you will get the thermal image.
Cd seeed_ircamera
Sudo python3 seeed_python_ircamera.py
19 Comments
smellsofbikes 2 years ago
john88fb 2 years ago
I am connecting MLX90640 with a RPi 3b+ following your step 2-1: Install grove.py based on the command you wrote. However, it appeared "syntax error" in several attempts.
Could you please rewrite a correct command?
Thank you in advance for your help.
smellsofbikes 2 years ago
Remove the hyperlink section. All you want is the URL.
chocolaska.2905 3 years ago
cattaco75 2 years ago
Badfrog 2 years ago
aldude_jon 3 years ago
Error:Please check if the I2C device insert in I2C of Base Hat
QObject::~QObject: Timers cannot be stopped from another thread
ah224jr 4 years ago
I am trying to implement the project and have got some issues.
In step 3, I did not get 33 in the line 30. And in step 5, I got this "Traceback (most recent call last):
File "seeed_python_ircamera.py", line 3, in <module>
import seeed_mlx90640
ModuleNotFoundError: No module named 'seeed_mlx90640'.
Any help please
Steven XU 4 years ago
ah224jr 4 years ago
elesey.r 3 years ago
ChristopherN72 4 years ago
robhard 4 years ago
fajriantynurul99 4 years ago
ah224jr 4 years ago
R-A 4 years ago
robhard 4 years ago
firdoshdiakus26 4 years ago
firdoshdiakus26 4 years ago