Adafruit Amg8833 8x8 Thermal Camera Sensor
Adafruit Amg8833 8x8 Thermal Camera Sensor
Guide Contents 2
Overview 3
Pinouts 7
Power Pins: 7
Logic pins: 8
Assembly 9
Prepare the header strips: 9
Add the breakout board: 9
And Solder! 10
Arduino Wiring & Test 12
I2C Wiring 12
Download Adafruit_AMG88xx library 12
Load Thermistor Test 13
Pixel Array Output 14
Library Reference 14
Arduino Library Docs 16
Arduino Thermal Camera 17
Python & CircuitPython 19
CircuitPython Microcontroller Wiring 19
Python Computer Wiring 20
CircuitPython Installation of AMG88xx Library 21
Python Installation of AMG88xx Library 22
CircuitPython & Python Usage 22
Full Example Code 23
Python Docs 24
Raspberry Pi Thermal Camera 25
Setup PiTFT 27
Install Python Software 27
Wiring Up Sensor 28
Run example code 29
Downloads 32
Documents 32
Schematic and Fab Print STEMMA QT Version 32
Schematic Original Version 33
Dimensions Original Version 33
Add heat-vision to your project and with an Adafruit AMG8833 Grid-EYE Breakout! This sensor from
Panasonic is an 8x8 array of IR thermal sensors. When connected to your microcontroller (or raspberry Pi)
it will return an array of 64 individual infrared temperature readings over I2C. It's like those fancy thermal
cameras, but compact and simple enough for easy integration.
This part will measure temperatures ranging from 0°C to 80°C (32°F to 176°F) with an accuracy of +- 2.5°C
(4.5°F). It can detect a human from a distance of up to 7 meters (23) feet. With a maximum frame rate of
10Hz, It's perfect for creating your own human detector or mini thermal camera. We have code for using
The AMG8833 is the next generation of 8x8 thermal IR sensors from Panasonic, and offers higher
performance than it's predecessor the AMG8831. The sensor only supports I2C, and has a configurable
interrupt pin that can fire when any individual pixel goes above or below a thresholds that you set.
To make it easy to use, we pick & placed it on a breakout board with a 3.3V regulator and level shifting.
So you can use it with any 3V or 5V microcontroller or computer.
Even better - We've done all the hard work here, with example code and supporting software libraries to
get you up in running in just a few lines of code!
There are two versions of this board - the STEMMA QT version shown above, and the original
header-only version shown below. Code works the same on both!
This camera has 4 mounting holes, and two header strips. Only the bottom strip is connected to the
sensor. The top set of breakouts is there for mechanical stability only!
Power Pins:
Vin - this is the power pin. Since the sensor uses 3.3V, we have included an onboard voltage
regulator that will take 3-5VDC and safely convert it down. To power the board, give it the same
power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V
3Vo - this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you
Logic pins:
SCL - this is the I2C clock pin, connect to your microcontrollers I2C clock line. There is a 10K pullup
on this pin and it is level shifted so you can use 3 - 5VDC.
SDA - this is the I2C data pin, connect to your microcontrollers I2C data line. There is a 10K pullup on
this pin and it is level shifted so you can use 3 - 5VDC.
INT - this is the interrupt-output pin. It is 3V logic and you can use it to detect when something moves
or changes in the sensor vision path.
STEMMA QT (https://adafru.it/Ft4) - These connectors allow you to connectors to dev boards
with STEMMA QT connectors or to other things with various associated
accessories (https://adafru.it/Ft6)
The 6 holes at the top of the board are provided for stability and are not connected to anything. Use these
if you want your sensor to sit nice and flat on a breadboard or Perma-Proto.
I2C Wiring
Once uploaded to your Arduino, open up the serial console at 9600 baud speed to see the internal
thermistor reading. If you get a reading of ~26° degrees (room temperature) then everything is wired and
working correctly!
Upload the code, and open the serial console at 9600 baud rate. You should see a printout of the array of
readings every second. Each number is the detected temperature in Celsius, and in the 8x8 grid order
that comes from the sensor
The numbers should increase if you put your hand or face above the sensor. They'll decrease if you hold
up something cold in front of the sensor eye
Library Reference
To create the object, use
Adafruit_AMG88xx amg;
status = amg.begin();
if (!status) {
Serial.println("Could not find a valid AMG88xx sensor, check wiring!");
while (1);
}
to read the pixels you will need an array to place the readings into. Once you have one, you can call
readPixels. Make sure the array you create is big enough by using the pre-defined
AMG88xx_PIXEL_ARRAY_SIZE macro.
float pixels[AMG88xx_PIXEL_ARRAY_SIZE];
amg.readPixels(pixels);
In this example we use an Adafruit 1.44" Color TFT. With some code changes, you can use other size
displays but a color display is best of course.
Adafruit 1.44" Color TFT LCD Display with MicroSD Card breakout
This lovely little display breakout is the best way to add a small, colorful and bright display to any project.
Since the display uses 4-wire SPI to communicate and has its own...
$14.95
In Stock
Add to Cart
Keep your AMG8833 breakout wired as you already have it from the Wiring & Test section above, and
add your TFT like this
James DV has also sent over a version that is optimized if you want a faster display-update
rate (https://adafru.it/BPj)
You can use this sensor with any CircuitPython microcontroller board or with a computer that has GPIO
and Python thanks to Adafruit_Blinka, our CircuitPython-for-Python compatibility
library (https://adafru.it/BSN).
First make sure you are running the latest version of Adafruit CircuitPython (https://adafru.it/Amd) for your
board.
Next you'll need to install the necessary libraries to use the hardware--carefully follow the steps to find
For non-express boards like the Trinket M0 or Gemma M0, you'll need to manually install the necessary
libraries from the bundle:
adafruit_amg88xx.mpy
adafruit_bus_device
Before continuing make sure your board's lib folder or root filesystem has the adafruit_amg88xx.mpy,
and adafruit_bus_device files and folders copied over.
Next connect to the board's serial REPL (https://adafru.it/Awz) so you are at the CircuitPython >>> prompt.
Once that's done, from your command line run the following command:
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to
use CircuitPython on Python 2.x, it isn't supported!
If you're using an I2C connection run the following code to import the necessary modules and initialize the
I2C connection with the sensor:
import time
import busio
import board
import adafruit_amg88xx
i2c = busio.I2C(board.SCL, board.SDA)
amg = adafruit_amg88xx.AMG88XX(i2c)
Now you're ready to read values from the sensor using any of these properties:
For example, to print the pixel temp once every second until you tell it to stop:
The Raspberry Pi also has an i2c interface, and even better has processing capability to interpolate and
filter the sensor output. By adding processing power, you can 'turn' the 8x8 output into what appears to
be a higher-resolution display.
We're using a PiTFT 2.8" and a Pi Cobbler but the code can be adapted to output to the HDMI display -
we're using pygame to draw to the framebuffer.
You can use any Raspberry Pi computer, from Pi A+ to Pi 3 or even a Pi Zero, but we happen to have a Pi
3 on our desk set up already so we're using that.
Setup PiTFT
If you have not done so already, the first thing you will need to do is setup your PiTFT. Instructions on how
to do so can be found in this guide (https://adafru.it/sha).
Finally, install both pygame and scipy. Pygame lets us draw easily to a screen using python, we'll use that
to make the display work. Scipy is a powerful scientific/data processing library that we can use to
magically turn the 8x8 = 64 pixel array into something that looks more like a 32x32 = 1024 pixel array.
Wow, isn't digital signal processing cool?
Wiring Up Sensor
With the Pi powered off, we can wire up the sensor to the Pi Cobbler like this:
You can also use direct wires, we happen to have a Cobbler ready. remember you can plug the cobbler
into the bottom of the PiTFT to get access to all the pins!
Now you should be able to verify that the sensor is wired up correctly by asking the Pi to detect what
addresses it can see on the I2C bus:
sudo i2cdetect -y 1
import os
import math
import time
import busio
import board
import numpy as np
import pygame
from scipy.interpolate import griddata
import adafruit_amg88xx
os.putenv('SDL_FBDEV', '/dev/fb1')
pygame.init()
# pylint: disable=invalid-slice-index
points = [(math.floor(ix / 8), (ix % 8)) for ix in range(0, 64)]
displayPixelWidth = width / 30
displayPixelHeight = height / 30
lcd.fill((255, 0, 0))
pygame.display.update()
pygame.mouse.set_visible(False)
lcd.fill((0, 0, 0))
pygame.display.update()
while True:
#perform interpolation
bicubic = griddata(points, pixels, (grid_x, grid_y), method='cubic')
#draw everything
for ix, row in enumerate(bicubic):
for jx, pixel in enumerate(row):
pygame.draw.rect(lcd, colors[constrain(int(pixel), 0, COLORDEPTH- 1)],
(displayPixelHeight * ix, displayPixelWidth * jx,
displayPixelHeight, displayPixelWidth))
pygame.display.update()
If you have everything installed and wired up correctly, you should see a nice thermal camera image. Cool
tones (blue and purple) are cooler temperatures, and warmer tones (yellow, red) are warmer
temperatures.
If you're interested int he details, and want to know more about how we made 64 pixels look like many
more, it's called bicubic interpolation (https://adafru.it/xgA) (hat tip to OSHpark for the
idea (https://adafru.it/xgB)!)