• sales

    +86-0755-88291180

Thermal Camera HAT (B) User Guide

Overview

Introduction

This product is a far-infrared thermal imaging sensor that uses a hybrid technology of microbolometer and thermopile pixels. It has an 80 × 62 pixel focal array and can detect the infrared radiation energy distribution of objects in the lens field of view. After quantization processing, the surface temperature distribution of objects in this field of view can be obtained, and a thermal imaging map can be generated, which is convenient for integration into various industrial or intelligent control applications. Compared to Thermal Camera HAT, this product has optimized internal filter and image processing algorithm, reduced the lens size to 9mm × 9mm, and changed the connector wiring method to FPC wire. Both 45° and 90° field of view models are available for selection.

Feature

  • Adopt the hybrid technology of microbolometer and thermopile, 80(H)×62(V) array pixels
  • Continuous operation and thermal imaging video stream due to shutterless design
  • Noise Equivalent Temperature Difference (NETD) 125mK RMS@1Hz refresh rate, with good noise performance
  • Up to 25FPS (Max) frame rate thermal imaging video stream output
  • Online resources and manuals. (Python demo for Raspberry Pi, Android/Windows host computer and user manual, etc.)

Parameter

  • Power Supply: 5V
  • Operating Current: 20mA@5V
  • Wavelength Range: 8~14μm
  • FOV:
    • 56°(D) × 45°(H) × 34°(V) (Regular version)
    • 122°(D) × 90°(H) × 67°(V) (Wide angle version)
  • Operation Temperature: -40℃~85℃
  • Target Temperature: -40℃~400℃
  • Measure Accuracy: ±2℃
  • Refresh Rate: 25 FPS(Max)
  • Dimensions:
    • Thermal Camera HAT (B): 65.0mm × 30.5mm
    • Thermal USB Camera: NC
  • Noise Equivalent Temperature Difference: 125mK

Hardware Description

  • Thermal Camera HAT (B) connects to Raspberry Pi series 40 GPIO Pin.
    • Thermal Camera HAT (B) uses I2C to configure camera registers and SPI to send temperature data.
    • Thermal Camera HAT (B) has a RESET button on the board, which can be pressed for hardware reset in case of an exception.
  • Thermal USB Camera (B) connects to a Windows PC or Android phone and uses the USB interface to send temperature data.
    • Thermal USB Camera (B) encounters an abnormal situation, you can unplug and plug in the hardware again to reset it.

Hardware Connection

  • Thermal Camera HAT (B) connects to Raspberry Pi:
    • When you need to stack additional HAT modules on the Raspberry Pi 4B, you can use a 40-pin GPIO header to connect Raspberry Pi and HAT modules.


Pin Definition

Configure the camera registers on Thermal Camera HAT via I2C and send temperature data using SPI.

PI-4BThermal Camera HAT
5V5V
GNDGND
D2(BCM)SDA
D3(BCM)SCL
D10(BCM)MOSI
D9(BCM)MISO
D11(BCM)CLK
D23(BCM)nRESET
D24(BCM)D_READY
D7(BCM)SS


I2C Bus




  • On the Thermal Camera HAT (B), you can use a 0-ohm resistor to select the I2C address. The default address is 0x40, but you can optionally use 0x41. For more details, please refer to Thermal Camera HAT Schematics.
  • When the Raspberry Pi 4B acts as the master device, it pulls down the SDA and SCL pins in sequence to initiate the START condition on the I2C bus. It then writes the device address (7 bits) and the write command (1 bit) for a total of 8 bits of data. If the pin connections are correct, the Thermal Camera HAT, acting as the Slave device, responds with an ACK.
  • The Raspberry Pi 4B continues by separately writing the register address (RA) and the register value (DATA) and waits for an ACK response. After completing the write operation, the controller pulls up the SCL and SDA pins in sequence to send the STOP condition.
  • If the Raspberry Pi 4B wants to read data from the register (RA), it waits for an ACK response after writing RA and then initiates another START condition. It writes the device address (7 bits) and the read command (1 bit) for a total of 8 bits and waits for an ACK response. After receiving the ACK response, the Thermal Camera HAT returns the DATA. Once the Raspberry Pi 4B receives the DATA, it can maintain the SDA pin at a high level.
  • For continuous writing of register values, please refer to Burst Read/Write Sequence in the diagram.
  • For the register Map, please refer to MI48x3-Datasheet-v3.1.3.

SPI Bus

  • The SPI timing diagram of Thermal Camera HAT (B) is shown below, please refer to MI48x3-Datasheet-v3.1.3 for more details.


  • The SPI interface of Raspberry Pi 4B must work in mode 0, MSB is valid, using 16-bit data width.
  • When reading data, 0x0000 must be sent to generate a clock signal, it supports full-frame temperature data readout mode.
  • When DATA_READY (D24 pin, abbreviated as D_READY) is high, the camera full-frame temperature data is valid.
  • DATA_READY will be lowered only after reading full frame data, Frame Header and Temperature data in the above figure represent full frame data.

Dimension


Temperature Measurement Principle

What is infrared temperature measurement? (Quoted from OPTRIS)
In the field of measurement, "temperature" is one of the commonly used physical parameters, second only to "time". Based on the principles of Planck's and Boltzmann's radiation laws, infrared thermometers determine the temperature of objects by absorbing the infrared radiation emitted by the object being measured. So, how is non-contact temperature measurement achieved?

Any object with a temperature above absolute zero (0 K or -273.15°C) emits electromagnetic radiation from its surface, and this radiation is proportional to the object's intrinsic temperature. In this radiation, there is infrared radiation used for temperature measurement. After this radiation passes through the atmosphere, it can be focused on a detector using a specialized lens. The detector then generates an electrical signal proportional to this radiation. This signal is amplified and converted into an output signal proportional to the temperature of the object through continuous digital signal processing. As a result, the measured temperature value is displayed on the monitor or output in signal form.

In the use of radiation for temperature measurement, emissivity ε (Epsilon) plays a crucial role. It indicates the relationship between the actual object and the radiation of a black body. The emissivity of a black body is 1 (the maximum value). However, there are not many objects that can meet this ideal condition of a black body. When calibrating sensors, the emissivity of the radiation surface is typically considered (including the recommended wavelength: 0.99).

In terms of wavelength, many objects usually have constant emissivity, but their radiation ability is far from that of a black body, and they are referred to as gray bodies. If an object's emissivity depends on its temperature and wavelength (such as metals), it is called a selective emitter. In both of these cases, the missing radiation portion is compensated for by the emissivity. When using selective emitters, it is important to consider the wavelength being measured (for metals, a short wavelength is chosen).

In addition to radiation emitted from the surface of an object, infrared sensors can also receive reflected radiation from the surrounding environment, and sometimes there may be infrared radiation penetrating the object being measured.

Measurement Distance

  • Taking the 175cm human body as a standard, at a test distance of about 12m, the outline of the human body will be indistinguishable.

Measurement Accuracy

  • When the target object exceeds 25% or more of the module FOV, the relative humidity should be less than 95%, and there should be no condensed water vapor or moisture on the lens.
Using Temperature (℃)Target Temperature (℃)Maximum Deviation (℃)
Full Frame Accuracy30.032.0-40.0±1.0 (center 32x24),±1.2 (entire)
30.010-32.0,40.0-70.0±1.5 (entire)
30.0<10.0,>70.0±2.0 (entire FPA),or 5%
Single Pixel30.032.0-40.0±0.5 (center 32x24),±0.7 (entire)
30.010-32.0,40.0-70.0±1.0 (entire)
30.032.0-40.0±2.5 (entire),or 5%
Temperature Stability30.032.0-40.0-0.21℃/℃
Power Stability30.0-±1.0 ℃ / 100 mA

Main Usage

  • Long-term non-contact object temperature online monitoring program
  • Infrared camera and infrared thermometer
  • Smart Home, Smart Building, Smart Lighting
  • Industrial temperature control, security, intrusion/motion detection
  • Micro-target thermal analysis, thermal trend analysis points and solutions

How to Use

Raspberry Pi 4B (buster&bullseys)

Note: The new version of the demo has been updated to have less noise and a clearer picture in infrared imaging.

  • It is recommended to use a pre-configured image with libraries already installed for testing purposes. When using such an image, you can skip the following environment setup and installation procedures.
  • Raspberry Pi Image-Google Drive
  • If users download and install the library by themselves, please install the library by prompts.
    • Enable the SPI and I2C serial bus of Raspberry Pi 4B.
    • Open the terminal and type "sudo raspi-config", select Interface Options, enable the following SPI and I2C interfaces, select "Yes" for both, and finally reboot the device.
    • Download Thermal_camera_code Demoand unzip it. Please install the library according to the prompted information, the installation process takes a long time, the following information is for reference.
 wget https://files.waveshare.com/wiki/Thermal-Camera-HAT/Thermal_camera_code.zip
 unzip Thermal_camera_code.zip
 cd pysenxor-master/
 sudo apt update
 sudo pip uninstall numpy(If you are prompted that there is no library, proceed to the next step, and if there is one, uninstall the library: pip uninstall numpy)
 sudo pip install numpy
 sudo pip install smbus
 sudo pip install crcmod
 sudo pip install matplotlib
 sudo pip install imutils
 wget https://www.piwheels.org/simple/opencv-python/opencv_python-4.6.0.66-cp39-cp39-linux_armv7l.whl#sha256=c1360e46e5ebd47a92e00c1f75c7d293d6ffd00d7f9ff06666f9af05eff2094f
 pip install opencv_python-4.6.0.66-cp39-cp39-linux_armv7l.whl
 pip install cmapy 
 sudo python setup.py install 
    • If the library is successfully installed, running the demo will start a window displaying a hot image, as shown in the following figure.
 cd pysenxor-master/example
 sudo python stream_spi.py


Raspberry Pi Bookworm Usage

Demo download

Pysenxor-master Demo

wget https://files.waveshare.com/wiki/Thermal-Camera-HAT/Pysenxor-master.zip

Installation setup

sudo apt install python3-numpy   
sudo apt install python3-smbus
sudo apt install python3-crcmod
sudo apt install python3-matplotlib
sudo apt install python3-opencv
wget https://files.pythonhosted.org/packages/25/47/f1d2c686253bea1454cc7db687a09ae912fbe4648a86ef7fcd9765f7639f/cmapy-0.6.6.tar.gz
tar -xzf cmapy-0.6.6.tar.gz
cd cmapy-0.6.6/
sudo python3 setup.py install

Unzip/install demo

unzip Pysenxor-master.zip
cd pysenxor-master/
sudo python setup.py install 

After the installation is complete, you will be prompted with the following:

Thermal Camera HAT

Execute the command to enable SPI

sudo raspi-config

Select Interface Options, then SPI, click Yes and press Enter key

Then select Interface Options, then I2C, click Yes and press Enter key, press Enter again and click Finish

sudo nano /boot/firmware/config.txt

Add dtoverlay=spi0-0cs statement below the dtparam=spi=on statement, save and exit

cd example 
sudo python stream_spi.py

Thermal USB Camera (B)

cd example 
sudo python stream_usb.py

Support

Monday-Friday (9:30-6:30) Saturday (9:30-5:30)

Mobile: +86  13434470212

Email: services01@spotpear.com

TAG: Programmable Magnetic Encoder PC USB Monitor Screen Raspberry Pi Mini Raspberry Pi 5 inch DSI Display MIPI LCD (C) Capacitive TouchScreen 1024x600 Jetson Nano Development Board RM520N GL 5G/4G/3G M.2 Moudle IoT EMBB For LTE-A/NSA/SA And GNSS For DFOTA /VoLTE For Quectel 1.69inch LCD TouchScreen Display 240&times;280 ST7789 Arduino Raspberry Pi ESP32S3 Pico STM32 Raspberry Pi RP2040 Keyboard 2.13Inch E-Ink Retail electronic Labe ESP32-S3 1.28inch Round LCD LuckFox Pico pro ESP32-S3 LCD Raspberry Pi IR Thermal Imaging Camera ESP32-S3 1.69inch LCD Display With QST Attitude Gyro Sensor QMI8658C For Arduino Python Raspberry Pi 5 / 4B UPS With PD Trigger Activation Uninterruptible Power Bank Supply 9600mAh 5V/5A 25W Also For Phone/Mini Computer PC Raspberry Pi IR Array Thermal Imaging Camera Far infrared 80&times;62 Pixels 45/90 Degree FOV RM520N GL 5G/4G/3G M.2 Moudle IoT EMBB For LTE-A/NSA/SA And GNSS For DFOTA /VoLTE For Quectel Raspberry Pi MLX90641 USB CAN Analyzer