Adafruit AMG8833 8x8 Thermal Camera Sensor Created by Dean Miller Last updated on 2018-08-22 04:01:13 PM UTC
Guide Contents Guide Contents Overview Pinouts 2 3 6 Power Pins: Logic pins: 6 6 Assembly 8 Prepare the header strips: Add the breakout board: And Solder! 8 9 10 Arduino Wiring & Test I2C Wiring Download Adafruit_AMG88xx library Load Thermistor Test Pixel Array Output Library Reference Arduino Library Docs Arduino Thermal Camera Adafruit 1.
Overview 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. © Adafruit Industries https://learn.adafruit.
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 this breakout on an Arduino or compatible (the sensor communicates over I2C) or on a Raspberry Pi with Python.
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.
Pinouts 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.
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. © Adafruit Industries https://learn.adafruit.
Assembly Prepare the header strips: Cut the strips to length if necessary. It will be easier to solder if you insert it into a breadboard - long pins down © Adafruit Industries https://learn.adafruit.
Add the breakout board: Place the breakout board over the pins so that the short pins poke through the breakout pads © Adafruit Industries https://learn.adafruit.
And Solder! Be sure to solder all pins for reliable electrical contact. (For tips on soldering, be sure to check out our Guide to Excellent Soldering (https://adafru.it/aTk)). © Adafruit Industries https://learn.adafruit.
You're done! Check your solder joints visually and continue onto the next steps © Adafruit Industries https://learn.adafruit.
Arduino Wiring & Test You can easily wire this breakout to any microcontroller, we'll be using an Arduino. You can use any other kind of microcontroller as well as long as it has I2C clock and I2C data lines. I2C Wiring Connect Vin to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of. For most Arduinos, that is 5V Connect GND to common power/data ground Connect the SCL pin to the I2C clock SCL pin on your Arduino.
To begin reading sensor data, you will need to install the Adafruit_AMG88xx library (https://adafru.it/xfw). Start up the IDE and open the Library Manager: Type in AMG88xx until you see the Adafruit Library pop up. Click Install! We also have a great tutorial on Arduino library installation at: http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use (https://adafru.
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! Pixel Array Output OK now that we know the sensor is working, let's read actual thermal data. Load up File -> Examples -> Adafruit_AMG88 -> pixels_test Upload the code, and open the serial console at 9600 baud rate. You should see a printout of the array of readings every second.
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; Initialize the sensor using 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.
Arduino Library Docs Arduino Library Docs (https://adafru.it/Au6) © Adafruit Industries https://learn.adafruit.
Arduino Thermal Camera To make your Arduino into a cool thermal camera, we can add a small display. 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 $14.
James DV has also sent over a version that is optimized if you want a faster display-update rate (https://adafru.it/BPj) © Adafruit Industries https://learn.adafruit.
Python & CircuitPython It's easy to use the AMG8833 sensor with Python or CircuitPython and the Adafruit CircuitPython AMG88xx (https://adafru.it/xha) module. This module allows you to easily write Python code that reads thermal imaging data from the sensor. 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).
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. Python Installation of AMG88xx Library You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python.
That's all there is to using AMG88ss with CircuitPython! Full Example Code import import import import time busio board adafruit_amg88xx i2c = busio.I2C(board.SCL, board.SDA) amg = adafruit_amg88xx.AMG88XX(i2c) while True: for row in amg.pixels: # Pad to 1 decimal place print(['{0:.1f}'.format(temp) for temp in row]) print("") print("\n") time.sleep(1) © Adafruit Industries https://learn.adafruit.
Python Docs Python Docs (https://adafru.it/C41) © Adafruit Industries https://learn.adafruit.
Raspberry Pi Thermal Camera 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.
PiTFT Plus Assembled 320x240 2.8" TFT + Resistive Touchscreen $34.95 IN STOCK ADD TO CART Assembled Pi T-Cobbler Plus - GPIO Breakout $7.95 IN STOCK ADD TO CART 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).
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 It should show up under it's default address (0x69). If you don't see 0x69, check your wiring, did you install I2C © Adafruit Industries https://learn.adafruit.
support, etc? Run example code At long last, we are finally ready to run our example code """This example is for Raspberry Pi (Linux) only! It will not work on microcontrollers running CircuitPython!""" import os import math import time import busio import board import numpy as np import pygame from scipy.interpolate import griddata from colour import Color import adafruit_amg88xx i2c_bus = busio.I2C(board.SCL, board.SDA) #low range of the sensor (this will be blue on the screen) MINTEMP = 26.
displayPixelHeight = height / 30 lcd = pygame.display.set_mode((width, height)) lcd.fill((255, 0, 0)) pygame.display.update() pygame.mouse.set_visible(False) lcd.fill((0, 0, 0)) pygame.display.update() #some utility functions def constrain(val, min_val, max_val): return min(max_val, max(min_val, val)) def map_value(x, in_min, in_max, out_min, out_max): return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min #let the sensor initialize time.sleep(.
© Adafruit Industries https://learn.adafruit.
Downloads Documents AMG8833 datasheet (https://adafru.it/xgE) AMG8833 Arduino Driver (https://adafru.it/xfw) Fritzing object in the Adafruit Fritzing library (https://adafru.it/aP3) AMG8833 CircuitPython Driver (https://adafru.it/xha) AMG8833 breakout PCB files (EAGLE format) (https://adafru.it/xhb) Schematic click to enlarge Dimensions in inches. Click to enlarge © Adafruit Industries https://learn.adafruit.
© Adafruit Industries Last Updated: 2018-08-22 04:01:08 PM UTC Page 30 of 30