# Improved AMG8833 PyGamer Thermal Camera

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/102/575/medium800/temperature___humidity_IMG_0181.jpg?1622739792 Thermal Camera displaying a thermographic image.)

As with the original [PyGamer Thermal Camera](https://learn.adafruit.com/pygamer-thermal-camera-amg8833), this portable thermal camera project combines an AMG8833 IR Thermal Camera FeatherWing with a PyGamer. The upgraded&nbsp;CircuitPython code used in this version increases the camera resolution from 64 pixels (8 x 8) to 225 pixels (15 x 15) and deepens the color depth from 8 colors to 100 colors, all without hardware modifications.

The new code improves the camera's ability to visualize thermal images to help discern heating and air conditioning ventilation issues, to evaluate the quality of your home's insulation, and to avoid the sleeping cat when heading to the kitchen in the middle of the night.&nbsp;

Increasing the display's resolution required changes to the original camera's code to maintain a useful image frame display rate. As a result, performance monitoring was built-in to the new CircuitPython code as a series of time markers with a summary performance report printed to the serial port at the end of each frame update. See the section on **Performance Monitoring** &nbsp;for more information.

## Thermal Camera Features

The camera's thermal image can be frozen or focused at the touch of a button. The focus feature fine-tunes the display's temperature range to match the current image's maximum and maximum measurements, improving the detail of the image. To get a statistical view of an object's heat, switch to histogram mode. A settable alarm flashes lights and beeps when the camera sees a temperature at or above the threshold. The setup function is used to set the temperature display range and the alarm threshold. An editable configuration file contains the camera's power-up settings for the default temperature range and camera sensor direction.

![](https://cdn-learn.adafruit.com/assets/assets/000/102/529/medium800/camera_OyIV3WZD3-pJf6NjA-Y3NhTq2epce85MyW3q1LcUq9HuKXFujnTjXaxINUWl-zMS4gB6NtfaU_lnsx6WetmPrdPKHWbu5Ngh8zxx.png?1622587552 Internal view of the AMG8833's 8x8 sensor array and control circuitry. Microphotograph courtesy of Adam McCombs.)

The camera's thermal imaging sensor is an 8 by 8 thermopile array that reads temperatures from 32°F to 176°F (0°C to 80°C)&nbsp;with an absolute accuracy of +- 4.5°F (2.5°C) and resolution of 0.9°F (0.5°C). To improve object recognition, the camera software algorithmically enlarges the number of imaged elements from 64 to 225 by calculating the in-between values using a technique called bilinear interpolation. See the guide section **1-2-3s of Bilinear Interpolation** &nbsp;for more detail about the technique.

![](https://cdn-learn.adafruit.com/assets/assets/000/102/508/medium800/camera_iron_spectrum_ref_short.jpeg?1622570364 Visual representation of the iron temperature pseudocolor spectrum.)

Temperatures are represented in the&nbsp;displayed image as colors in a spectrum, ranging from a&nbsp;cold blue to white-hot. The color spectrum is based on a frequently-used palette similar to the range of colors seen when an iron bar is heated -- a technique a blacksmith might use to gauge the&nbsp;malleability&nbsp;of metal.

The camera's numeric temperature values are displayed as degrees Fahrenheit. Converting the values to Celsius is possible but is left as an exercise.

![](https://cdn-learn.adafruit.com/assets/assets/000/102/576/medium800/temperature___humidity_IMG_0180.jpg?1622739907 Thermal Camera displaying a temperature histogram.)

The PyGamer Thermal Camera's custom cover skin was produced by a commercial on-line sticker printing service using the image file below.

![](https://cdn-learn.adafruit.com/assets/assets/000/102/814/medium800/temperature___humidity_Thermal_Cam_panel_label_sticker.jpg?1623271646)

Warning: 

## Parts
Featured
### Adafruit AMG8833 IR Thermal Camera FeatherWing

[Adafruit AMG8833 IR Thermal Camera FeatherWing](https://www.adafruit.com/product/3622)
A Feather board without ambition is a Feather board without FeatherWings! This is the **Thermal Camera FeatherWing** : thanks to the Panasonic AMG8833 8x8 GridEYE sensor, it adds heat-vision to _any_ Feather main board. Using our <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3622)
[Related Guides to the Product](https://learn.adafruit.com/products/3622/guides)
![TFT with thermal camera display, a hand with two fingers slowly passes in front, so the heat map is visible.](https://cdn-shop.adafruit.com/product-videos/640x480/3622-03.jpg)

Featured
### Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino

[Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino](https://www.adafruit.com/product/4242)
What&nbsp;fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right, it's the **Adafruit PyGamer!** We wanted to make an entry-level gaming handheld for DIY gaming, and maybe a little...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4242)
[Related Guides to the Product](https://learn.adafruit.com/products/4242/guides)
![Angled shot of Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino.](https://cdn-shop.adafruit.com/640x480/4242-00.jpg)

Featured
### Lithium Ion Polymer Battery with Short Cable - 3.7V 350mAh

[Lithium Ion Polymer Battery with Short Cable - 3.7V 350mAh](https://www.adafruit.com/product/4237)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 350mAh for a total of about 1.3 Wh. If you need a larger (or smaller!) battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4237)
[Related Guides to the Product](https://learn.adafruit.com/products/4237/guides)
![Lithium Ion Polymer Battery 3.7v 350mAh with JST 2-PH connector and short cable](https://cdn-shop.adafruit.com/640x480/4237-04.jpg)

Featured
### Adafruit PyGamer Acrylic Enclosure Kit

[Adafruit PyGamer Acrylic Enclosure Kit](https://www.adafruit.com/product/4238)
You've got your PyGamer, and you're ready to start jammin' on your favorite arcade games. You gaze adoringly at the charming silkscreen designed by Ada-friend PaintYourDragon.&nbsp;The nostalgia is palpable!

Cradling the PCB in your hands, you realize there's something...

In Stock
[Buy Now](https://www.adafruit.com/product/4238)
[Related Guides to the Product](https://learn.adafruit.com/products/4238/guides)
![Enclosure pieces and black, plastic hardware for a DIY handheld game console.](https://cdn-shop.adafruit.com/640x480/4238-00.jpg)

Featured
### Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt

[Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt](https://www.adafruit.com/product/4227)
Hear the good news! This wee speaker&nbsp;is&nbsp;a&nbsp;great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like this&nbsp;speaker&nbsp;as it is&nbsp;small and comes with nice skinny wires with a connector on the end. It has a handy...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4227)
[Related Guides to the Product](https://learn.adafruit.com/products/4227/guides)
![Mini Oval Speaker with Short Wires ](https://cdn-shop.adafruit.com/640x480/4227-06.jpg)

Featured
### Plastic Button Caps For Square Top (10-pack) - 8mm Diameter

[Plastic Button Caps For Square Top (10-pack) - 8mm Diameter](https://www.adafruit.com/product/4228)
These Reese's Piece's lookin' bits fit perfectly on top of tactile buttons with 2.4mm square tops and give a satisfying 8mm diameter surface area for your fingers to press.  
  
You get 10 candy-colored round caps. You get two of each color: **red, yellow, white,...**

In Stock
[Buy Now](https://www.adafruit.com/product/4228)
[Related Guides to the Product](https://learn.adafruit.com/products/4228/guides)
![Angled shot of 10 plastic button caps colored reddish-orange, yellow, white, and black.](https://cdn-shop.adafruit.com/640x480/4228-04.jpg)

Other than the AMG8833 Thermal Camera FeatherWing, the following kit contains the PyGamer parts for this project including a nifty carrying case.

Featured
### Adafruit PyGamer Starter Kit

[Adafruit PyGamer Starter Kit](https://www.adafruit.com/product/4277)
**Please note: you may get a royal blue _or_ purple case with your starter kit (they're both lovely colors)**

What&nbsp;fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4277)
[Related Guides to the Product](https://learn.adafruit.com/products/4277/guides)
![Adafruit PyGamer Starter Kit with PCB, enclosure, buttons, and storage bag](https://cdn-shop.adafruit.com/640x480/4277-08.jpg)

## Acknowledgements

Thank you to Adam McCombs for the highly detailed optical and electron microscope photographs of the de-capped AMG8833 sensor. It's fascinating to see how it operates under the covers.

Special thanks to David Glaude and Zoltán Vörös for the&nbsp;_ulab_-based bilinear interpolation helper. Array calculations using CircuitPython's integral&nbsp;_ulab_ (micro lab)&nbsp;library are amazingly fast and efficient!

For more information about _ulab_, check out Jeff Epler's [ulab: Crunch Numbers Fast in CircuitPython](https://learn.adafruit.com/ulab-crunch-numbers-fast-with-circuitpython "ulab: Crunch Numbers fast in CircuitPython")&nbsp;learning guide.

- [Next Page](https://learn.adafruit.com/improved-amg8833-pygamer-thermal-camera/features-and-operation.md)

## Guide Products

### Adafruit AMG8833 IR Thermal Camera FeatherWing

[Adafruit AMG8833 IR Thermal Camera FeatherWing](https://www.adafruit.com/product/3622)
A Feather board without ambition is a Feather board without FeatherWings! This is the **Thermal Camera FeatherWing** : thanks to the Panasonic AMG8833 8x8 GridEYE sensor, it adds heat-vision to _any_ Feather main board. Using our <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3622)
[Related Guides to the Product](https://learn.adafruit.com/products/3622/guides)
### Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino

[Adafruit PyGamer for MakeCode Arcade, CircuitPython or Arduino](https://www.adafruit.com/product/4242)
What&nbsp;fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right, it's the **Adafruit PyGamer!** We wanted to make an entry-level gaming handheld for DIY gaming, and maybe a little...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4242)
[Related Guides to the Product](https://learn.adafruit.com/products/4242/guides)
### Lithium Ion Polymer Battery with Short Cable - 3.7V 350mAh

[Lithium Ion Polymer Battery with Short Cable - 3.7V 350mAh](https://www.adafruit.com/product/4237)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 350mAh for a total of about 1.3 Wh. If you need a larger (or smaller!) battery, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4237)
[Related Guides to the Product](https://learn.adafruit.com/products/4237/guides)
### Adafruit PyGamer Acrylic Enclosure Kit

[Adafruit PyGamer Acrylic Enclosure Kit](https://www.adafruit.com/product/4238)
You've got your PyGamer, and you're ready to start jammin' on your favorite arcade games. You gaze adoringly at the charming silkscreen designed by Ada-friend PaintYourDragon.&nbsp;The nostalgia is palpable!

Cradling the PCB in your hands, you realize there's something...

In Stock
[Buy Now](https://www.adafruit.com/product/4238)
[Related Guides to the Product](https://learn.adafruit.com/products/4238/guides)
### Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt

[Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt](https://www.adafruit.com/product/4227)
Hear the good news! This wee speaker&nbsp;is&nbsp;a&nbsp;great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like this&nbsp;speaker&nbsp;as it is&nbsp;small and comes with nice skinny wires with a connector on the end. It has a handy...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4227)
[Related Guides to the Product](https://learn.adafruit.com/products/4227/guides)
### Plastic Button Caps For Square Top (10-pack) - 8mm Diameter

[Plastic Button Caps For Square Top (10-pack) - 8mm Diameter](https://www.adafruit.com/product/4228)
These Reese's Piece's lookin' bits fit perfectly on top of tactile buttons with 2.4mm square tops and give a satisfying 8mm diameter surface area for your fingers to press.  
  
You get 10 candy-colored round caps. You get two of each color: **red, yellow, white,...**

In Stock
[Buy Now](https://www.adafruit.com/product/4228)
[Related Guides to the Product](https://learn.adafruit.com/products/4228/guides)
### Adafruit PyGamer Starter Kit

[Adafruit PyGamer Starter Kit](https://www.adafruit.com/product/4277)
**Please note: you may get a royal blue _or_ purple case with your starter kit (they're both lovely colors)**

What&nbsp;fits in your pocket, is fully Open Source, and can run CircuitPython, MakeCode Arcade or Arduino games you write yourself? That's right,...

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

## Related Guides

- [Introducing Adafruit PyGamer](https://learn.adafruit.com/adafruit-pygamer.md)
- [PyGamer - Gaming Handheld Crank](https://learn.adafruit.com/gaming-handheld-crank.md)
- [Mini Neon Sign Prop & n00ds Booster Case](https://learn.adafruit.com/nood-booster-case.md)
- [BLE Volume Knob with CircuitPython](https://learn.adafruit.com/bluetooth-le-hid-volume-knob-with-circuitpython.md)
- [Trash Panda 2: Garbage Day](https://learn.adafruit.com/trash-panda-2-dumpster-dive.md)
- [TFT Gizmo Turtle](https://learn.adafruit.com/tft-gizmo-turtle.md)
- [Playing Gamebuino META Games on Arcada](https://learn.adafruit.com/playing-gamebuino-meta-games-on-arcada.md)
- [PyBadger Event Badge](https://learn.adafruit.com/pybadger-event-badge.md)
- [PyPortal WFH Busy Sounds Simulator](https://learn.adafruit.com/pyportal-wfh-busy-sounds-simulator.md)
- [Halo Energy Sword RP2040](https://learn.adafruit.com/halo-energy-sword-rp2040.md)
- [Wireless Image Transfer with Circuit Playground Bluefruit and E-Ink Gizmo](https://learn.adafruit.com/wireless-image-transfer-with-circuit-playground-bluetooth-and-eink-gizmo.md)
- [Introducing Adafruit Feather](https://learn.adafruit.com/adafruit-feather.md)
- [Use circup to easily keep your CircuitPython libraries up to date](https://learn.adafruit.com/keep-your-circuitpython-libraries-on-devices-up-to-date-with-circup.md)
- [Making a Name Tag in MakeCode Arcade](https://learn.adafruit.com/making-a-name-tag-in-makecode-arcade.md)
- [Re-MakeCode the Classics: Py Hunter](https://learn.adafruit.com/re-makecode-the-classics-spy-hunter.md)
- [PyBadge Case with Flip Out Mic](https://learn.adafruit.com/pybadge-case-with-flip-out-mic.md)
