0. Introduction

I’m currently developing a project that needs a thermal camera and I found the AMG8833 IR Thermal Camera from Adafruit. In order to test it, I connected it to an Arduino board and uploaded the example sketch from their library, but I didn’t like it too much and for this reason I developed this simple script you can download from my GitHub repo in order to get a better visualization of the data.

1. Install the library and upload the script on the Arduino

In order to make my script interface with the arduino, I used the Adafruit_AMG88xx library. You can download it from the Arduino IDE itself:

  • click on Sketch –> #include library –> Manage Library;
  • insert AMG8833 as filter
  • Click on Adafruit AMG88xx Library and click “Install”

Now the library is installed inside your Arduino IDE and you can open and upload the library example called “pixels_test” (you find it on File/Examples/Adafruit AMG88xx Library/pixels_test).

2. Install all necessary python libraries

In order to install all libraries faster, I use a tool named “pip”. You can find all the documentation about it on this page The libraries you need to install are NumPy, MatPlotLib and PySerial. Just open a terminal and type:

sudo pip install numpy #or pip2 if using python2.7
 sudo pip install matplotlib 
 sudo pip install pyserial

3. Running the code

After installing all the library, you can finally run your script. Before doing that, be sure edit line 7 in order to connect to your arduino serial port:

ser = serial.Serial('/dev/ttyUSB0') #change '/dev/ttyUSB0' with your serial port

After doing this, you are ready to run the code. Just open a terminal and type:

python thermal_camera.py

And after few seconds it should open a window like this: (the last picture will also be saved in png format in the directory you launched the script).

Now you can use this script to visualize in realtime the output of the thermal camera.

I hope this tutorial could be useful to someone out there and if you have any doubts or issues don’t be afraid to ask in the comment section below this post.