Thermal imaging camera (Pyboard D based)

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
Post Reply
User avatar
pythoncoder
Posts: 3455
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Thermal imaging camera (Pyboard D based)

Post by pythoncoder » Sun Jun 16, 2019 5:37 pm

This uses the Adafruit AMG8833 sensor with their 1.5 inch OLED display. The AMG8833 device driver is here.

The display is mounted on a custom PCB with the Pyboard D SF2W in a WBUS-DIP28 adaptor on the rear. The WBUS-DIP28 could be dispensed with and connections made to the D pins, except that I am no longer able to solder pads at such a fine pitch. Power is supplied by USB. I use a USB portable phone charger to power it independently.

Alas the forum is still broken and not displaying images. They can be seen on GitHub.
The device looks better than in the picture, partly owing to my lack of skill as a photographer and partly its small size seems to exaggerate its faults. The display image in particular looks much better than in the picture. The device measures 85x55x25mm.

The momentary action switches enable the temperature range for the image to be adjusted. A long press disables image updates until a switch is next pressed - useful for photography or if working in awkward spaces.

Update rate is just over 2Hz (488ms). The sensor itself updates at 10Hz. The driver performs bicubic interpolation in assembler to produce 1024 points of image data which are displayed as 2x2 pixel rectangles to give a 64x64 pixel image (up from the sensor's 8x8 resolution). The Pyboard, running at 216MHz, therefore has 476μs to perform a bicubic interpolation, map the result to a colour, and draw the rectangle to the framebuf.

In practice I think a 2Hz update rate is an acceptable compromise. Clearly the rate could be improved at the cost of image quality by less ambitious interpolation: a cheaper algorithm or a smaller output array.

The code uses uasyncio to manage the switches. It does not use the Pyboard's WiFi but I plan to add a means of making the raw sensor data available locally, probably via MQTT publication. using my asynchronous driver.

I have not published full design details. My AMG8833 repo has the key software components for handling the sensor data. But if there is any interest I can push the full set of files and the Fritzing PCB design.
Peter Hinch

User avatar
jimmo
Posts: 322
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Thermal imaging camera (Pyboard D based)

Post by jimmo » Mon Jun 17, 2019 4:33 am

Wow, the interpolation looks like it works really well! I have used one of these sensors previously and in 8x8 it's hard to really make out anything but now I'm really keen to wire it up again and test it out. Thanks!

User avatar
pythoncoder
Posts: 3455
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Thermal imaging camera (Pyboard D based)

Post by pythoncoder » Mon Jun 17, 2019 8:15 am

Adafruit have an amazing video which brings out more detail than my bicubic interpolation (scroll down the page to see it). They achieve this using heavy-duty software running on a Raspberry Pi. I don't believe this combination of image processing and frame rate is achievable on a Pyboard.

The bicubic is a decent compromise (in my opinion) and produces nicer output than you might expect.
Peter Hinch

Post Reply