Introduction: Make the World's Cheapest and Worst IR Camera!

Here I convert a cheap infrared thermomitor into a high resoultion thermal 'camera'.  Yes, it's incredibly slow, and hard to set up, but perhaps it could be useful to somebody? 

It does actually work, and is reasonably sensitive.

All design files are available on Github here: https://github.com/ccrome/temperature_scanner

Supplies

  • Non-Contact Pocket Thermometer
  • 3d-printer.  I used a CR-10
  • 3.3V Arduino of some sort
  • Pogo pins if you're going to use the pogo pins. Otherwise, direct solder is fine

Step 1: Build the Temperature Probe

Here you connect your arduino to the thermometer, either by direct-wiring, or using the pogo pins if you have them handy.

The point here is to connect power, ground, and the two data pins to your thermometer. You can either 3d-print the pogo holding clip from the STL files, or just open up the case and solder directly to the PCB.

  • Connect the arduino GND to the G pin labeled (right most, labeled G)
  • Connect the arduino 3.3V to the second-to-right pin (labeled 3 in the images above)
  • Connect the arduino data pin to the 'D' pin of the thermometer.
  • Connect the arduion clock pin to the 'C' pin of the thermometer.

Careful! If you're wiring directly, the edge-connector pins are in a somewhat different order than the test points. Be careful.

Once you power up your Arduino, the display should light up. You'll need to hit the 'mode' pin until you start seeing temperatures.

And you need to hold down the large button for continuous measurement. I 3d-printed a little clip that does double duty of holding the pogo pins and holding down the measure button.

Step 2: Program the Arduino

Grab the Arduino code, and upload it.

Pretty straight forward, open up the 'temperature_sniffer' Arduino project and upload. The only modifications needed are for you to update whatever pins you actually connected:

int clkpin = 6;  <---- update here
int datapin = 7; <----

Once you're up and running, look at the serial console, and you should be getting results that look like this:

0x0000004c1322810d
0x0000004c1321800d
0x0000004c13207f0d
0x000000530000530d
0x0000004c13207f0d
0x000000530000530d
0x0000006612c9410d
0x0000004c1321800d
0x0000004c13207f0d
0x0000004c131f7e0d
0x000000530000530d
0x0000006612c9410d
0x0000004c131f7e0d

which shows the 40-bit number that the serial protocol of the thermometer is sending.


Pro tip: If you don't want to do any scanning, and just want to log this data and make sense of it, the information you want is in the scanner/scan.py file, get_temp function.

    def get_temp(self, x):
        if (x >> 32) & 0xFF == 0x4c:
            return (x>> 16) & 0xFFFF
        else:
            return None

that is, bits 32-39 == 0x4c means this frame has a temperature reading, and when that's true, bits 16-31 contain the temperature.

Step 3: Connect to 3d Printer

Now, glue this thing to your 3d printer, plug in the 3d-printer and the arduino USB output into your computer, and run the scan.py program!

You can scan as fine or as coarse as you like!

usage: scan.py [-h] -pp PRINTER_PORT [-pb PRINTER_BAUD] -sx START_X -sy
               START_Y -dx DELTA_X -dy DELTA_Y -g GRIDSIZE [-sz SAFE_Z]
               [-sn SCAN_Z] -tp TEMP_PORT [-tb TEMP_BAUD] [--logfile LOGFILE]
               resultsfile


positional arguments:
  resultsfile           text File to put results into


optional arguments:
  -h, --help            show this help message and exit
  -pp PRINTER_PORT, --printer-port PRINTER_PORT
                        Printer port
  -pb PRINTER_BAUD, --printer-baud PRINTER_BAUD
                        Printer Baud. Default 115200
  -sx START_X, --start-x START_X
                        Start X location of scan
  -sy START_Y, --start-y START_Y
                        Start Y location of scan
  -dx DELTA_X, --delta-x DELTA_X
                        The X width of scan
  -dy DELTA_Y, --delta-y DELTA_Y
                        The Y width of scan
  -g GRIDSIZE, --gridsize GRIDSIZE
                        Scanning grid step
  -sz SAFE_Z, --safe-z SAFE_Z
                        Safe Z for all moves. Default=45
  -sn SCAN_Z, --scan-z SCAN_Z
                        Scan Z during actual scanning. Default=10
  -tp TEMP_PORT, --temp-port TEMP_PORT
                        Temperature scanner port
  -tb TEMP_BAUD, --temp-baud TEMP_BAUD
                        Temperature baud
  --logfile LOGFILE     name of logfile to dump to. Default is scanner.log


I created the above image with the following command:

python scan.py   -pp COM13 -sx 00 -sy 25  -dx 140 -dy 70 -g 1  -tp COM8 -sz 30 -sn 15 test.csv

This collects all the data. You can then use

python plot-log.py test.csv

to plot the collected data. Actually, the plot-log.py file will dynamically plot, even as data is being collected. So you can run both commands and watch as your data is collected automaticaly.

(python scan.py   -pp COM13 -sx 00 -sy 25  -dx 140 -dy 70 -g 1  -tp COM8 -sz 30 -sn 15 test.csv &) && python plot-log.py test.csv


Enjoy!