# Raspberry Pi Thermal Camera

## Overview

https://youtu.be/rG0JHzKA_fA

![Raspberry Pi Thermal Imaging Camera](https://cdn-learn.adafruit.com/assets/assets/000/138/221/medium800/raspberry_pi_hero-coffee-B.jpg?1751989556 )

Build a thermal imaging camera using a Raspberry Pi, MLX90640 IR camera breakout, and the Raspberry Pi camera module. This project fuses the Raspberry Pi's camera feed with a thermal graphic overlay. A Python script features a graphical interface that allows you to control the overlay's opacity and temperature range, and even take screenshots.

![Raspberry Pi Thermal Imaging Camera](https://cdn-learn.adafruit.com/assets/assets/000/138/222/medium640/raspberry_pi_hero-coffe-C.jpg?1751990141)

The electronics are housed in a custom designed 3D printed snap fit enclosure. A 1/4-20" mount lets you secure it to just about any tripod compatible mounting system.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/241/medium640/temperature___humidity_hero-case.jpg?1751997203)

This project was inspired by&nbsp; the [PitFusion thermal imager](https://github.com/ivmech/pitfusion) for the Raspberry Pi.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/240/medium640/temperature___humidity_pitfusion-image.jpg?1751997137)

## Parts
### Adafruit MLX90640 24x32 IR Thermal Camera Breakout

[Adafruit MLX90640 24x32 IR Thermal Camera Breakout](https://www.adafruit.com/product/4469)
You can now add affordable heat-vision to your project and with an Adafruit MLX90640 Thermal Camera Breakout. This sensor contains a 24x32 array of IR thermal sensors. When connected to your microcontroller (or Raspberry Pi) it will return an array of 768 individual infrared temperature...

In Stock
[Buy Now](https://www.adafruit.com/product/4469)
[Related Guides to the Product](https://learn.adafruit.com/products/4469/guides)
![White hand holding and moving around a MLX90640 24x32 IR Thermal Camera Breakout over a Raspberry Pi. The pybadge showing a checker board image of what the camera is seeing. ](https://cdn-shop.adafruit.com/product-videos/640x480/4469-05.jpg)

### Raspberry Pi Camera Module 3 Standard

[Raspberry Pi Camera Module 3 Standard](https://www.adafruit.com/product/5657)
Raspberry Pi Camera Module 3 is a compact camera from Raspberry Pi. Featuring autofocus and a 12-megapixel sensor, and supported by Raspberry Pi's Picamera2 Python library, Camera Module 3 gives you excellent image quality with precise control.

**Camera Module 3 Standard...**

In Stock
[Buy Now](https://www.adafruit.com/product/5657)
[Related Guides to the Product](https://learn.adafruit.com/products/5657/guides)
![Angled shot of camera module assembled onto a Raspberry Pi 4 computer.](https://cdn-shop.adafruit.com/640x480/5657-04.jpg)

### Raspberry Pi 4 Model B - 4 GB RAM

[Raspberry Pi 4 Model B - 4 GB RAM](https://www.adafruit.com/product/4296)
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 4 better than the 3? How about a&nbsp;_faster_ processor, USB 3.0 ports, and updated Gigabit Ethernet chip with...

In Stock
[Buy Now](https://www.adafruit.com/product/4296)
[Related Guides to the Product](https://learn.adafruit.com/products/4296/guides)
![Angled shot of Raspberry Pi 4](https://cdn-shop.adafruit.com/640x480/4296-11.jpg)

### Adafruit EYESPI Pi Beret - Buttons, EYESPI and STEMMA QT

[Adafruit EYESPI Pi Beret - Buttons, EYESPI and STEMMA QT](https://www.adafruit.com/product/5783)
Raspberry Pi's make for handy lil computers, but they're really wonderful when you can connect all sorts of nifty hardware to them: color TFT or E-Ink displays, and sensors are our go-to favorites. Even better is when we make it fast and effortless to wire these up. With this new...

In Stock
[Buy Now](https://www.adafruit.com/product/5783)
[Related Guides to the Product](https://learn.adafruit.com/products/5783/guides)
![Overhead shot of long, black, slim add-on board installed on a Raspberry Pi computer and cabled to a sensor board and an electronic ink display.](https://cdn-shop.adafruit.com/640x480/5783-04.jpg)

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

### Official Raspberry Pi Micro HDMI to HDMI Cable

[Official Raspberry Pi Micro HDMI to HDMI Cable](https://www.adafruit.com/product/4302)
We're now stocking a very fancy Official Raspberry Pi Micro HDMI to HDMI cable with overmolding and&nbsp;Pi logo!&nbsp;It has nice molded grips for easy installation, and is 1&nbsp;meter long.&nbsp;[Perfect for use with your new Raspberry Pi 4...](https://www.adafruit.com/product/4297)

In Stock
[Buy Now](https://www.adafruit.com/product/4302)
[Related Guides to the Product](https://learn.adafruit.com/products/4302/guides)
![Angled shot of a Official Raspberry Pi Micro HDMI to HDMI Cable - 1 meter long.](https://cdn-shop.adafruit.com/640x480/4302-02.jpg)

### Part: Official Raspberry Pi Power Supply
quantity: 1
.1V 3A with USB C - 1.5 meter long
[Official Raspberry Pi Power Supply](https://www.adafruit.com/product/4298)

### Part: Camera and Tripod 3/8" to 1/4" Adapter Screw
quantity: 1
Tripod Screw Insert
[Camera and Tripod 3/8" to 1/4" Adapter Screw](https://www.adafruit.com/product/2392)

### Part: Tripod Screw D-Ring
quantity: 1
Pack of 5 - Stainless Steel D Shaft D-Ring 1/4" Tripod Screw
[Tripod Screw D-Ring](https://www.amazon.com/Fotasy-QRS-Release-Premier-Cleaning/dp/B00KI3J7G2/)

### Part: Mini Ball Head
quantity: 1
Tripod Low Profile Ballhead
[Mini Ball Head](https://www.amazon.com/Head-INNOREL-C19-Head-CNC-Ballhead-Ballheads/dp/B0CHB63882/)

## Hardware

- 3x M3 x 4mm long machine screws
- 4x M2.5 x 6mm long machine screws
- 2x M2 x 6mm long machine screws

# Raspberry Pi Thermal Camera

## Circuit Diagram

The diagram below provides a general visual reference for wiring of the components once you get to the **Assembly** page. This diagram was created using the software package [Fritzing](http://fritzing.org/download/).

## Adafruit Library for Fritzing

Adafruit uses the Adafruit Fritzing parts library to create circuit diagrams for projects. You can download the library or just grab individual parts. Get the library and parts from [GitHub - Adafruit Fritzing Parts](https://github.com/adafruit/Fritzing-Library/tree/master/parts).

![Circuit diagram](https://cdn-learn.adafruit.com/assets/assets/000/138/223/medium800/raspberry_pi_circuit-diagram.png?1751992407 )

## Wired Connections

- **Camera Module to Camera Pi via ribbon cable**
- **EYESPI Beret to Pi GPIO Header&nbsp;**
- **STEMMA QT** on **EYESPIBeret** to **MLX90640**

The **Raspberry Pi 4 Model B** is powered via 5V 2A USB power supply.

# Raspberry Pi Thermal Camera

## CAD Files

## CAD Assembly

The main assembly is available in Fusion 360 and STEP file formats. This includes all of the 3D printed parts and electronic components used in the project. Use the main assembly to create any edits, updates, or modifications.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/138/208/medium640/raspberry_pi_3d-parts.jpg?1751977821)

[Download 3MF Files](https://cdn-learn.adafruit.com/assets/assets/000/138/231/original/3MF.zip?1751994018)
[Download STEP and F360 Source Files](https://cdn-learn.adafruit.com/assets/assets/000/138/230/original/CAD.zip?1751993983)
## Multicolor Part (Optional)

The top cover can optionally be printed in multiple colors using a multicolor capable 3D printer. The 3MF file contains four objects that can be assigned different colors.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/138/209/medium640/raspberry_pi_3d-multicolor.jpg?1751978312)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/210/medium640/raspberry_pi_3d-object-colors.jpg?1751978460)

## Design Source Files

The project assembly was designed in Fusion 360. Once opened in Fusion 360, It can be exported in different formats like STEP, STL and more.

Electronic components like Adafruit's boards, displays, connectors and more can be downloaded from the&nbsp;[Adafruit CAD parts GitHub Repo](https://github.com/adafruit/Adafruit_CAD_Parts/).

![](https://cdn-learn.adafruit.com/assets/assets/000/138/211/medium640/raspberry_pi_3d-models.jpg?1751978733)

# Raspberry Pi Thermal Camera

## Python Virtual Environment Prep

As Carter writes in his [Python Virtual Environment Usage on Raspberry Pi guide](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/overview):

> Starting with the October 10, 2023&nbsp;[Bookworm release](https://www.raspberrypi.com/news/bookworm-the-new-version-of-raspberry-pi-os/)&nbsp;of the&nbsp;[Raspberry Pi OS](https://www.raspberrypi.com/software/), the use of&nbsp;[Python Virtual Environments](https://docs.python.org/3/tutorial/venv.html)&nbsp;(venv) when pip installing packages is required.&nbsp; **No more sudo pip**. This will break things and require learning new things. Yeah.

You will need to setup a Python virtual environment (venv) on your Raspberry Pi 5 for this project. Don't worry though! If you follow along with the guide step by step, you'll be just fine.

### Python Virtual Environment Usage on Raspberry Pi - Basic Venv Usage

[Python Virtual Environment Usage on Raspberry Pi](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi)
[Basic Venv Usage](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/basic-venv-usage)
## Always venv

On the [Other Ideas page](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/other-ideas) in the venv guide, there is a tip for having the virtual environment enabled automatically at boot by editing the `.bashrc` file (`sudo nano .bashrc`) and adding this line to the bottom:

```python
source home/user/venv/bin/activate
```

Where `venv` is the name of your virtual environment. You can take this a step further by [adding the alias](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi/usage-with-sudo#option-1-invoke-with-sudo-passing-environment-3157502) for running Python scripts as `sudo` to your `.bashrc` file as well:

```python
alias gogo='sudo -E env PATH=$PATH python'
```

You can change `gogo` to any command you want. This way, every time you boot up your Pi, you'll have your Python venv enabled and you'll be able to use your alias for running Python scripts.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/648/medium800/raspberry_pi_20250228_15h44m50s_grim.png?1741103373)

# Raspberry Pi Thermal Camera

## Installing Blinka on Raspberry Pi

Info: 

Warning: 

# Prerequisite Pi Setup!

In this page we'll assume you've already gotten your Raspberry Pi up and running and can log into the command line

Here's the quick-start for people with some experience:

1. Download the&nbsp;[latest Raspberry Pi OS or Raspberry Pi OS Lite](https://www.raspberrypi.org/software/operating-systems/)&nbsp;to your computer
2. [Burn the OS image to your MicroSD card](https://learn.adafruit.com/adafruit-raspberry-pi-lesson-1-preparing-and-sd-card-for-your-raspberry-pi)&nbsp;using your computer
3. [Re-plug the SD card into your computer (don't use your Pi yet!) and set up your wifi connection by editing supplicant.conf](https://learn.adafruit.com/raspberry-pi-zero-creation/text-file-editing)
4. [Activate SSH support](https://learn.adafruit.com/raspberry-pi-zero-creation/text-file-editing)
5. Plug the SD card into the Pi
6. If you have an HDMI monitor we recommend connecting it so you can see that the Pi is booting OK
7. Plug in power to the Pi - you will see the green LED flicker a little. The Pi will reboot while it sets up so wait a good 10 minutes
8. [If you are running Windows on your computer, install Bonjour support so you can use&nbsp; **.local** &nbsp;names, you'll need to reboot Windows after installation](https://learn.adafruit.com/bonjour-zeroconf-networking-for-windows-and-linux#microsoft-windows)
9. [You can then&nbsp; **ssh** &nbsp;into&nbsp; **raspberrypi.local**](https://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-ssh)

[The Pi Foundation has tons of guides as well](https://projects.raspberrypi.org/en/projects/raspberry-pi-getting-started)

Danger: 

# Update Your Pi and Python

Run the standard updates:

```terminal
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install -y python3-pip
```

and upgrade setuptools:

```terminal
sudo apt install --upgrade python3-setuptools
```

Info: 

Warning: 

# Setup Virtual Environment

If you are installing on the Bookworm (released in 2023) or later version of Raspberry Pi OS, you will need to install your python modules in a virtual environment. You can find more information in the&nbsp;[Python Virtual Environment Usage on Raspberry Pi](https://learn.adafruit.com/python-virtual-environment-usage-on-raspberry-pi) guide. To Install and activate the virtual environment, use the following commands:

```terminal
cd ~
sudo apt install python3-venv
python3 -m venv env --system-site-packages
```

You will need to activate the virtual environment every time the Pi is rebooted. To activate it:

```terminal
source env/bin/activate
```

To deactivate, you can use `deactivate`, but leave it active for now.

# Automated Install

We put together a script to easily make sure your Pi is correctly configured and install Blinka. It requires just a few commands to run. Most of it is installing the dependencies.

```terminal
cd ~
pip3 install --upgrade adafruit-python-shell
wget https://raw.githubusercontent.com/adafruit/Raspberry-Pi-Installer-Scripts/master/raspi-blinka.py
sudo -E env PATH=$PATH python3 raspi-blinka.py
```

If you are installing on an earlier version such as Bullseye of Raspberry Pi OS and not using a Virtual Environment, you can call the script like:

`sudo python3 raspi-blinka.py`

If you are installing an older version of Raspberry Pi OS, your system default Python is likely Python 2. If so, it will ask to confirm that you want to proceed. Choose&nbsp; **yes**.

![sensors_Python_Sys_Default.png](https://cdn-learn.adafruit.com/assets/assets/000/098/682/medium640/sensors_Python_Sys_Default.png?1610754382)

It may take a few minutes to run. When it finishes, it will ask you if you would like to reboot. Choose&nbsp; **yes**.

![sensors_Reboot_Now.png](https://cdn-learn.adafruit.com/assets/assets/000/098/683/medium640/sensors_Reboot_Now.png?1610754482)

Once it reboots, the connection will close. After a couple of minutes, you can reconnect.

![sensors_Connection_Closed.png](https://cdn-learn.adafruit.com/assets/assets/000/098/684/medium640/sensors_Connection_Closed.png?1610754544)

# Manual Install

If you are having trouble running the automated installation script, you can follow these steps to manually install Blinka.

### Enable Interfaces

Run these commands to enable the various interfaces such as I2C and SPI:

```terminal
sudo raspi-config nonint do_i2c 0
sudo raspi-config nonint do_spi 0
sudo raspi-config nonint do_serial_hw 0
sudo raspi-config nonint do_ssh 0
sudo raspi-config nonint do_camera 0
sudo raspi-config nonint disable_raspi_config_at_boot 0
```

### Install Blinka and Dependencies

Blinka needs a few dependencies installed:

```terminal
sudo apt-get install -y i2c-tools libgpiod-dev python3-libgpiod
pip3 install --upgrade adafruit-blinka
```

### Raspberry Pi 5 Adjustments

At the moment, RPi.GPIO is installed, which causes issues. Just remove it with the following command:

```terminal
pip3 uninstall -y RPi.GPIO
```

# Check I2C and SPI

The script will automatically enable I2C and SPI. You can run the following command to verify:

```terminal
ls /dev/i2c* /dev/spi*
```

You should see the response

`/dev/i2c-1 /dev/spidev0.0 /dev/spidev0.1`

![](https://cdn-learn.adafruit.com/assets/assets/000/056/782/medium800/sensors_ls.png?1530380749)

## Fixing CE0 and CE1 Device or Resource Busy Issue

In order to use the CE0 and CE1 pins in Python, you will need to disable them from OS usage. To do so, check out the [Reassigning or Disabling the SPI Chip Enable Lines](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/spi-sensors-devices#reassigning-or-disabling-the-spi-chip-enable-lines-3097985) section of this guide.

## Enabling Second SPI

If you are using the main SPI port for a display or something and need another hardware SPI port, you can enable it by adding the line

`dtoverlay=spi1-3cs`

to the bottom of **/boot/config.txt** and rebooting. You'll then see the addition of some /dev/spidev1.x devices:

![](https://cdn-learn.adafruit.com/assets/assets/000/059/554/medium800/sensors_image.png?1534951162)

## Pi 5 : Cannot determine SOC peripheral base address
comment out this line :

```auto
#dtparam=spi=on
```

# Blinka Test
Warning: 

Create a new file called **blinkatest.py** with **nano** or your favorite text editor and put the following in:

```auto
import board
import digitalio
import busio

print("Hello, blinka!")

# Try to create a Digital input
pin = digitalio.DigitalInOut(board.D4)
print("Digital IO ok!")

# Try to create an I2C device
i2c = busio.I2C(board.SCL, board.SDA)
print("I2C ok!")

# Try to create an SPI device
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
print("SPI ok!")

print("done!")
```

Save it, make sure your virtual environment is activated, and run at the command line with:

```terminal
python3 blinkatest.py
```

You should see the following, indicating digital i/o, I2C and SPI all worked.

![](https://cdn-learn.adafruit.com/assets/assets/000/056/785/medium800/sensors_test.png?1530381767)

# Raspberry Pi Thermal Camera

## Thermal Camera Software

## Install the Required Libraries

You will need to install a few libraries to run the thermal camera Python script. In the terminal, enter:

```terminal
pip install opencv-python adafruit-circuitpython-mlx90640
```

This installs OpenCV and the Adafruit CircuitPython MLX90640 driver, which is compatible with Blinka.

## Download the Project Bundle

Once you've finished setting up your Raspberry Pi with Blinka and the library dependencies, you can access the Python code file by downloading the Project Bundle.

To do this, click on the **&nbsp;Download Project Bundle** &nbsp;button in the window below. It will download as a zipped folder.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Raspberry_Pi_Thermal_Camera_Overlay/code.py

## Run the Script

After downloading the Project Bundle, move the folder to your **/home/user** directory. Then, unzip the folder by **right-clicking** on the folder in the File Manager and selecting **Extract** or with your preferred command line tool. Keep the following file in the **/home/user** directory:

- **code.py**

To run **code.py** from the terminal in your Python virtual environment, you'll use this line in the terminal:

```terminal
sudo -E env PATH=$PATH python code.py
```

If you created an alias for running Python scripts within your virtual environment, as described in this section of the [virtual environment setup page](https://learn.adafruit.com/admin/guides/4285/editor/30554#always-venv-3194282), you can use your alias to run the script instead:

```terminal
gogo code.py
```

## How the Code Works

The code sets up a camera preview from the Raspberry Pi Camera. The data from the MLX90640 is formed into an array of colors that are overlayed on top of the camera preview. These two feeds are piped to an OpenCV window, which has built-in support for zooming and saving images. You can use keyboard keys to affect different parameters:

- Maximum temperature in overlay: up and down arrow keys
- Minimum temperature in overlay: left and right arrow keys
- Temperature overlay opacity: + and - keys
- Exit program: Q key

# Raspberry Pi Thermal Camera

## Assembly

## Connect Camera to Pi

Use the included ribbon cable to connect the camera module to the Raspberry Pi.&nbsp;

Reference the assembly photo for connecting the ribbon cable in the correct orientation.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/182/medium640/raspberry_pi_picam-cable.jpg?1751917928)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/184/medium640/raspberry_pi_pi-cam-cable-install.jpg?1751917948)

## Connect STEMMA QT

Use the STEMMA QT cable to connect the MLX90604 to the EYESPI Beret.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/185/medium640/raspberry_pi_mlx-beret-stemma.jpg?1751917960)

## Tripod Screw Insert (Optional)

Insert the 3/8" to 1/4" adapter to the tripod mount if you'd like to secure the 3D printed case to a tripod or the 3D printed base.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/186/medium640/raspberry_pi_tripod-mount-screw-install.jpg?1751917990)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/187/medium640/raspberry_pi_tripod-mount-screw-installed.jpg?1751917999)

## Install Tripod Mount&nbsp;

Orient the tripod mount with the bottom half of the case with the three mounting holes lined up.

Insert and fasten three M3 x 4mm machine screws to secure the parts together.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/188/medium640/raspberry_pi_tripod-mount-bot-installing.jpg?1751918017)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/189/medium640/raspberry_pi_tripod-mount-bot-fasten.jpg?1751918027)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/190/medium640/raspberry_pi_tripod-mount-bot-installed.jpg?1751918053)

Danger: Make sure the micro SD card is NOT in the Pi's card slot before fitting into it the case.

## Install Raspberry Pi

Make sure the micro SD card is NOT in the Pi's card slot before fitting into it the case.

Orient the Raspberry Pi with the bottom half of the 3D printed case so the various connectors are lined up with the port holes.

Insert the Raspberry Pi into the half with the mounting holes lined up.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/191/medium640/raspberry_pi_pi-bot-install.jpg?1751918087)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/192/medium640/raspberry_pi_pi-bot-installed.jpg?1751918146)

## Secure Raspberry Pi

Use a minimum of two M2.5 x 6mm long machine screws to secure the Raspberry Pi to the bottom half of the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/193/medium640/raspberry_pi_pi-bot-fasten.jpg?1751918206)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/194/medium640/raspberry_pi_pi-bot-secured.jpg?1751918614)

## Secure Raspberry Pi Camera

Place the camera module onto the matching set of stand offs on the top half of the 3D printed case.

Use two M2 x 6mm long screws to secure the camera module to the top half of the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/195/medium640/raspberry_pi_pi-cam-top-fit.jpg?1751918344)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/196/medium640/raspberry_pi_pi-cam-top-fasten.jpg?1751918375)

## Secure MLX90604

Place the MLX90604 breakout onto the matching set of standoffs on the top half of the case.

Use two M2.5 x 6mm long machine screws to secure the PCB to the top half of the case.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/197/medium640/raspberry_pi_mlx-top-fasten.jpg?1751918383)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/198/medium640/raspberry_pi_mlx-top-secured.jpg?1751918392)

## Install EYESPI Beret

Orient the EYESPI Beret with the 2x20 GPIO header on the Raspberry Pi.&nbsp;

Carefully seat the Beret onto the GPIO header with all of the going into the socket header pins.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/199/medium640/raspberry_pi_pi-beret-install.jpg?1751918621)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/213/medium640/raspberry_pi_pi-beret-orient.jpg?1751982760)

## Case Closed

Orient the two halves of the case so they're matching correctly.

Carefully adjust the camera's cables so they're neatly fitted inside the case.

Firmly press the two halves together so they snap fit closed.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/200/medium640/raspberry_pi_top-bot-case.jpg?1751918414)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/201/medium640/raspberry_pi_top-bot-case-installed.jpg?1751918430)

## Install SD Card

Insert the SD card into the micro SD card slot.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/202/medium640/raspberry_pi_sd-install.jpg?1751918572)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/203/medium640/raspberry_pi_pi-case.jpg?1751918583)

## Install Base (Optional)

Line up the hole in the 3D printed base with the tripod screw insert.

Use a 1/4"-20 tripod screw to secure the two parts together.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/204/medium640/raspberry_pi_pi-tripod-install.jpg?1751918592)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/205/medium640/raspberry_pi_pi-tripod-fasten.jpg?1751918606)

## Final Build

Congratulation on your build! Reference the software page to run the Python script.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/206/medium800/raspberry_pi_hero-case.jpg?1751918613 )

# Raspberry Pi Thermal Camera

## Usage

![](https://cdn-learn.adafruit.com/assets/assets/000/138/238/medium800thumb/raspberry_pi_thermal-overlay.jpg?1751996332 )

## Thermal Overlay

The overlay window features on-screen text on the bottom of the image that displays settings including temperature range, overlay opacity, and average temperature being read by the sensor.

## Tool Bar

We're using OpenCV for this project because it has a built-in toolbar at the top of the app window. This toolbar has buttons for zooming in and out and saving images with the overlay. When you save an image, it is stored in the same directory where the script is saved.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/237/medium800/raspberry_pi_toolbar-icons.png?1751995752 )

## Keyboard Controls

The following keyboard keys can be used to quickly adjust settings.&nbsp;

- **Up** Arrow - Increases the maximum temperature range
- **Down** Arrow - Decreases the maximum temperature range
- **Left** Arrow - Decreases the minimum temperature range
- **Right** Arrow - Increases the minimum temperature range
- **=** Key - Increase the overlay opacity
- **-** Key - Decrease the overlay opacity
- **Q** Key - Stops and exits the script


## Featured Products

### Raspberry Pi 4 Model B - 4 GB RAM

[Raspberry Pi 4 Model B - 4 GB RAM](https://www.adafruit.com/product/4296)
The Raspberry Pi 4 Model B is the newest Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing _better_! And what could make the Pi 4 better than the 3? How about a&nbsp;_faster_ processor, USB 3.0 ports, and updated Gigabit Ethernet chip with...

In Stock
[Buy Now](https://www.adafruit.com/product/4296)
[Related Guides to the Product](https://learn.adafruit.com/products/4296/guides)
### Raspberry Pi Camera Module 3 Standard

[Raspberry Pi Camera Module 3 Standard](https://www.adafruit.com/product/5657)
Raspberry Pi Camera Module 3 is a compact camera from Raspberry Pi. Featuring autofocus and a 12-megapixel sensor, and supported by Raspberry Pi's Picamera2 Python library, Camera Module 3 gives you excellent image quality with precise control.

**Camera Module 3 Standard...**

In Stock
[Buy Now](https://www.adafruit.com/product/5657)
[Related Guides to the Product](https://learn.adafruit.com/products/5657/guides)
### Adafruit MLX90640 24x32 IR Thermal Camera Breakout

[Adafruit MLX90640 24x32 IR Thermal Camera Breakout](https://www.adafruit.com/product/4469)
You can now add affordable heat-vision to your project and with an Adafruit MLX90640 Thermal Camera Breakout. This sensor contains a 24x32 array of IR thermal sensors. When connected to your microcontroller (or Raspberry Pi) it will return an array of 768 individual infrared temperature...

In Stock
[Buy Now](https://www.adafruit.com/product/4469)
[Related Guides to the Product](https://learn.adafruit.com/products/4469/guides)
### Adafruit EYESPI Pi Beret - Buttons, EYESPI and STEMMA QT

[Adafruit EYESPI Pi Beret - Buttons, EYESPI and STEMMA QT](https://www.adafruit.com/product/5783)
Raspberry Pi's make for handy lil computers, but they're really wonderful when you can connect all sorts of nifty hardware to them: color TFT or E-Ink displays, and sensors are our go-to favorites. Even better is when we make it fast and effortless to wire these up. With this new...

In Stock
[Buy Now](https://www.adafruit.com/product/5783)
[Related Guides to the Product](https://learn.adafruit.com/products/5783/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### Official Raspberry Pi Micro HDMI to HDMI Cable

[Official Raspberry Pi Micro HDMI to HDMI Cable](https://www.adafruit.com/product/4302)
We're now stocking a very fancy Official Raspberry Pi Micro HDMI to HDMI cable with overmolding and&nbsp;Pi logo!&nbsp;It has nice molded grips for easy installation, and is 1&nbsp;meter long.&nbsp;[Perfect for use with your new Raspberry Pi 4...](https://www.adafruit.com/product/4297)

In Stock
[Buy Now](https://www.adafruit.com/product/4302)
[Related Guides to the Product](https://learn.adafruit.com/products/4302/guides)
### Camera and Tripod 3/8" to 1/4" Adapter Screw

[Camera and Tripod 3/8" to 1/4" Adapter Screw](https://www.adafruit.com/product/2392)
_Whaddya got a screw loose or something?_

This **3/8" to 1/4"**  **Adapter Screw** is super handy if you're building projects that connect to a tripod or a camera. It's a simple fix for getting a tripod with a 1/4" machine screw...

In Stock
[Buy Now](https://www.adafruit.com/product/2392)
[Related Guides to the Product](https://learn.adafruit.com/products/2392/guides)
### Official Raspberry Pi Power Supply 5.1V 3A with USB C

[Official Raspberry Pi Power Supply 5.1V 3A with USB C](https://www.adafruit.com/product/4298)
The official Raspberry Pi USB-C power supply is here! And of course, we have 'em in classic Adafruit black! Superfast with just the right amount of cable length to get your Pi 4 projects up and running!

Best for use with Pi 4 series, [Pi...](https://www.adafruit.com/product/5814)

In Stock
[Buy Now](https://www.adafruit.com/product/4298)
[Related Guides to the Product](https://learn.adafruit.com/products/4298/guides)

## Related Guides

- [Raspberry Pi Care and Troubleshooting](https://learn.adafruit.com/raspberry-pi-care-and-troubleshooting.md)
- [Adafruit EYESPI Pi Beret](https://learn.adafruit.com/eyespi-pi-beret.md)
- [Adafruit MLX90640 IR Thermal Camera](https://learn.adafruit.com/adafruit-mlx90640-ir-thermal-camera.md)
- [Adafruit 2.13" 250x122 Quad-Color eInk](https://learn.adafruit.com/adafruit-2-13-250x122-quad-color-eink.md)
- [MLX90640 Thermal Camera with Image Recording](https://learn.adafruit.com/mlx90640-thermal-image-recording.md)
- [What is this "Linux", anyhow?](https://learn.adafruit.com/what-is-linux.md)
- [LSM6DSOX, ISM330DHC, & LSM6DSO32 6 DoF IMUs](https://learn.adafruit.com/lsm6dsox-and-ism330dhc-6-dof-imu.md)
- [Sound Reactive LED Top Hat](https://learn.adafruit.com/sound-reactive-led-top-hat.md)
- [Adafruit TMP117 High Accuracy I2C Temperature Monitor](https://learn.adafruit.com/adafruit-tmp117-high-accuracy-i2c-temperature-monitor.md)
- [Rack and Pinion Bot](https://learn.adafruit.com/rack-and-pinion-bot.md)
- [Coffee Rater](https://learn.adafruit.com/coffee-rater.md)
- [3D Printed Google Glass Adapter](https://learn.adafruit.com/3d-printed-google-glass-adapter.md)
- [2014 Halloween 3D Printed Projects Roundup](https://learn.adafruit.com/2014-halloween-3d-printed-projects-roundup.md)
- [Pocket PiGRRL](https://learn.adafruit.com/pocket-pigrrl.md)
- [Piranha Pi Camera](https://learn.adafruit.com/piranha-pi-cam.md)
- [Sensor-Locked Secrets with CircuitPython](https://learn.adafruit.com/sensor-locked-secrets-with-circuitpython.md)
