Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: Thermal imaging camera

  1. #1

    Thermal imaging camera

    I have a leak in my A/C duct system and to help isolate the problem, I built a thermal imaging camera. It’s based on an AMG8833 sensor that has an 8x8 sensor grid. The unit was packaged in a breakout board from Adafruit, who also published a library for fast startup use. Connection is via I2C, and the examples made getting the unit working a snap.

    Out of the box the results were not very good, namely because of a small 8x8 sensor and the few colors that were assigned to for each pixel to represent temperature. The library is just to get started, so no complaints—I’ll have to thank any library writer for doing the heavy lifting. My code improves the results by taking advantage of all colors on my 2.8” TFT screen (65K), and turned up the resolution to 70x70 with some basic interpolation.

    My algorithm for color assignment based on temperature is linear (namely due to the need to keep code running as fast as possible), and 65K colors will not be perfectly smooth anyway. I found a neat website that had RGB color definition per temp, so i just had to plot the RGB values and develop some equations, using y=mx + b.

    To generate data at the interior points I had to interpolate each row, expanding 8 points to 70 for each row, and when complete I ran interpolation against each of the 70 columns. My interpolation routine to generate 10 points between each measured point is also linear. Again, in an attempt to display sensor readings at the maximum of 10 fps (as governed by the sensor), I wanted to keep the math as fast as possible. Also the 65K color limit prevents the need for supper accurate log-based color interpolation.

    I also added some touch screen capability so the user can set the max/min temperature for converting the temp to color before drawing the results to the screen, and a grid that uses an interesting concept to avoid flickering due to repeatedly drawing grid lines.

    I’m using a Teensy 3.2 running at 120 mhz and the screen refreshes around 3 fps—good enough for an $80 project. I still can't find my leak though...

    To help others get started, I created a YouTube video of this project and have a link to the source code. Have a look.

    https://www.youtube.com/watch?v=A9F1ezGgaC4

    Happy measuring

    KrisClick image for larger version. 

Name:	20171129_155425.jpg 
Views:	41 
Size:	118.6 KB 
ID:	12119
    Last edited by KrisKasprzak; 11-29-2017 at 10:00 PM. Reason: added image

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    550
    @KrisKasprzak. Nice job on the imager and especially the interpolation. Had a project to update based on the mlx90620 chip. Have to put it on my list of things to do this winter Thanks for sharing.

  3. #3
    Senior Member
    Join Date
    Jan 2013
    Location
    San Francisco Bay Area
    Posts
    638
    That's awesome! Nicely done. That looks really nice from an 8x8 grid.

    I wonder if there is a clever way to create a heat map of an area by repeatedly panning over a certain area. Basically, use the motion to gather info on the gaps.
    Also would be kinda cool to do some stitching so you could create a detailed heat map of your entire wall. Just dumping all the values to an sdcard might be useful, and then doing all the processing on the PC.

  4. #4
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    550
    @linuzgeek and @@KrisKasprzak. A lot of years ago some one had posted on how to do that with a mlx90614. The site is now defunct but he had the Arduino code and processing sketch to get some detailed images. I tried doing that with the 90620 but ran into problem with the interpolation to get a good image. If there is any interest by anyone for this I can post a copy of the page and code someplace.

    UPDATE: Heres a link for a couple of the original 90614 project. https://drive.google.com/open?id=1Y4...O85AvB0EnxSXI3
    Last edited by mjs513; 12-01-2017 at 09:24 PM.

  5. #5
    Senior Member
    Join Date
    Apr 2013
    Posts
    1,580
    Have one of these in the mail, so interested in your results. With tiling images together do you have any idea what the actual FOV for each pixel is? If you have a point IR source some distance out does it always light up one pixel (pixels touch) sometimes vanish (pixels have dead space) or sometimes show up twice (pixels actually overlap).

    If there are gaps wondering if you could use a mirror or prisim assembly to scan the FOV across the sensor to trade time for more pixels?

    Probably winds up cheaper to just buy a real camera but many moons ago worked with an 8 sensor IR system that used a very complex scanning mirror system to make up a TV image from those 8 pixels.

  6. #6
    Senior Member
    Join Date
    Jan 2013
    Location
    San Francisco Bay Area
    Posts
    638
    Quote Originally Posted by GremlinWrangler View Post
    If there are gaps wondering if you could use a mirror or prisim assembly to scan the FOV across the sensor to trade time for more pixels?
    That's a great idea!

  7. #7
    Thanks for the compliments. The FOV is about 60 degrees so maybe if you get close enough to the heat source you could scan and build a larger array to avoid interpolation. At around 5 inches from the sensor i can "see" my fingers holding up a peace sign, at about 10 inches, the peace sign becomes a single blob. I really think there's not much you can do with an 8x8 array. Lately i've gotten to printing my own PCB boards, paper transfer from a laser printer, and 20 min in Muriatic+H2O2 acid. Works perfectly for a garage DYI. I forgot to reverse the pins on my 3v3 regulator as it's mounted on the copper side so some jumpers need to be added and I'm designing an enclosure to be 3D printed. I've become quite proficient at this process and warrants another YouTube video.

    Click image for larger version. 

Name:	20171201_231653.jpg 
Views:	27 
Size:	101.9 KB 
ID:	12130

    Click image for larger version. 

Name:	20171201_231705.jpg 
Views:	32 
Size:	98.6 KB 
ID:	12131

  8. #8
    Senior Member
    Join Date
    Jul 2014
    Location
    New York
    Posts
    550
    @@KrisKasprzak. Nice job on the circuit board. Never tried that will have to give it a shot at some point. Anyway, you guys got me going on this again, haven't touched for a few year, thanks for the inspiration. This was one of my first Arduino projects (it was before I discovered Teensies ). Anyway here is some more info that I thought might be of interest:

    If there are gaps wondering if you could use a mirror or prisim assembly to scan the FOV across the sensor to trade time for more pixels?
    Had in my notes that somebody did that with a lepton sensor, you can check this out Poor Mans Thermograph

    I found this last night on someone that did some testing using several sensors that I thought was interesting, Low-cost IR Array Sensors performance characterization (Thermal Imaging)


    Cheers

  9. #9
    Only 80$ for an thermal Camera, you did a good job man. Anw, I am enjoying your video

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •