DIY thermal vision shoots 360 panoramas

Like most of you, I do like new technology and spend some money on new parts, sensors, toys, instruments and gadgets. While purchased small toy is on slow route I usually forget about it and remember only after it is delivered. Then item is settled in box proudly named “inbox” and continues it’s existence there for a while. Sometimes it lives there for years. Few days ago I found this forgotten Melexis MLX90614 thermopile (not to be confused with microbolometer) thermal sensor. Unused, unopened and abandoned. Time to make use of it.

I was keen to build my version of scanning thermometer and see what resolution and technological limits are, so let’s get started.

Construction

There is not much to invent about scanner construction – it is pan/tilt rig made of two stacked rotary stages. Thermal sensor is installed in more or less rotation center. Slip rings are not necessary but a nice touch that allows continuous rotation.

Motion platform

I have been building modular motorized rotary stage Kurokesu RSA1 (smallest and simplest of upcoming series) for a while and finally assembled all custom made parts in to one piece. So it was a good opportunity to test it and use it as a motion platform.

Motion controller

Motion platform is controlled with controller Kurokesu SCA1 based on GRBL code (powerful enough to be used with small CNC machines or laser engraver). It allows to control directly two stepper motors and have two homing switches. While construction is not over-complicated, I selected top of the shelf Trinamic controllers with 1/256 micro stepping for super quiet and smooth operation. In theory there are 256000 steps per revolution but in reality it is more like 16000 (0.0225 deg resolution per step) which is also more than enough.

Thermometer controller

For reading temperature data I used dirt cheap Atmega328 board (aka Arduino Nano) and medical grade MLX90614 thermometer. Arduino is programed to spit measured temperature every 50ms over serial port.

In action

While rig can move pretty fast (30rpm) it needs to be slowed down to collect enough data points.

How it works

It might seem simple task but it involves some tricks to control motors and read sensor data from two separate controllers.

One of the challenges I faced is meshing position and temperature data. Feedback received from each controllers is timestamped. After scan is complete timings are being analyzed and each temperature value is assigned interpolated coordinate from motor feedback. If done incorrectly (brute forced) this procedure can take hours. Luckily there are tricks to speed this up to few seconds. Hint: Python numpy searchsorted.

Another annoying (but luckily easy to fix) task is correctly and evenly visualizing data. Unless you oversample few times there will be black dots on complete picture. In photography they are called dead pixels. In our situation it is pretty easy to spot these pixels and filling is done by averaging neighboring ones.

Results

Well, results are pretty spectacular. Single point 360 panorama, native 720×360 resolution, but being pretty cheap to build it has major drawback – speed. For example to capture all visible sphere it took more than a hour to complete. Speed is limited by thermal sensor refresh rate which is about 20 samples per second.

Future considerations – recently Melexis produced few new sensors one of them has grid array 32×24 pixels – this should speed scanning time by factor of ~500 so scanning could take few minutes. Also it would be nice to add narrower lens to increase resolution.