Thermal Imaging

This experiment is different from most of my experiments because it uses 20 diodes instead of 20 LEDs. The background for the experiment is that I found some web pages that state that the forward voltage of 1N4148 diodes will vary by approximately 2mV per Kelvin. Of course I had to try this. A quick check with a datasheet and then with a multimeter confirmed that this effect is real. But if it works with 1 diode then twenty would be better, right? If I arrange 20 diodes in a row I will get a very crude 1 dimensional 20 pixel thermal imaging device.

Since I need to measure forward voltage and because the Arduino does not have 20 analog channels I need some kind of multiplexing. Thus I settled for the following circuit.

Thermal Imaging Hack Schematic

As you might have already noticed this looks suspiciously similar to the Blinkenlight circuit. This is because I am going to hack my own kit to fit this setup. Thus I will get a professional layout instead of the typical proto board look. The next picture shows my desired target layout.

Thermal Imaging Hack Layout

Clearly this is almost a Blinkenlight layout. In order to adapt this to my new needs I used my mini drill to cut the traces at just 4 points.

Thermal Imaging Hack Back Cut

The back side cut is the most critical. It has to be wide enough to really cut through the trace. In my first attempt it was not deep enough. The remainder was so thin that I did not see it with the naked eye but still it botched my circuit. So it is a good idea to check this with a multimeter.

Thermal Imaging Hack Front Cuts

The front cuts are not so critical because there is not so much copper around. However they will stay visible so they need somewhat clean work.

In order to get tidy wiring I used 2 pieces of proto board soldered on top of each other. The result is now some kind of a 4 layer PCB plus 4 jumper wires.

Thermal Imaging Hack Back

Soldering the back side was definitely the painful part. In order to prevent accidental shorts I have added some Kapton tape to the “inner” proto board.

Inner Board With Kapton Tape

The easier part was the front. Soldering 1206 size SMD parts is actually very easy to do. The hardest part is dropping none of them to the floor. Here are my results soldering the front.

Thermal Imaging Hack Front

This looks almost professional. Definitely better than some piece of prototyping board. I am very satisfied with how this looks. Unfortunately the back side extends to far and thus this setup does not fit onto a standard Arduino if ISP headers are mounted. All of my Arduinos have mounted ISP headers though. I fixed this by putting a “raiser” board onto one of my Arduinos.

The sketch for the Arduino is pretty simple. I just multiplex the diodes by toggling the digital pins. Each digital pin enables or disables 5 diodes which are then evaluated through the analog ports. Notice that I get some small forward current for each diode by enabling the pull up resistors for the analog pins. Since the forward voltage is well below 1V I also switch the analog reference to internal. That is to 1.1V. This gives roughly 5 times better voltage resolution.

The data is send in rows, one per digital pin. There is no specific reason for that other than it helps me searching for issues with the electrical connections.

The python script will trigger a reset to enforce that it will be in sync with the Arduino sketch. It will collect some samples to compute a baseline. This is kind of a very crude auto calibration. Of course the whole thing could be calibrated for quantitative measurements but I am interested in getting pictures. So as I need only qualitative outputs I settled for this simpler approach. The output is rendered into some scalable vector graphics file in order to enable rendering this into some internet page. Also rendering SVG is so simple with Python that I did not bother to try some sophisticated plotting package.

So does it really work? Yes it does! Have a look at the video. Notice that the blue thingy is 30-40K below room temperature. Thus the temperature drops are much larger than the temperature increases I get from touching the diodes with my fingers.

One final word of warning. If you copy this hack, please ensure that you connect the shield to your Arduino only after uploading the sketch. If there is some other sketch running that sets the digital pins to low and the analog pins to high the diodes will more or less short circuit these pins. Chances are that this will cause the Arduino to protect the resetable fuse by letting go some magic smoke.

Share this:

Like this:

3 Responses to Thermal Imaging

I would recommend using discrete resistors to bias the diodes, instead of the internal pull-up resistor. Not only will this protect your diodes against accidentally burning out a diode, as mentioned in your post, it will also increase performance. Is you can see on chapter 318 of the Atmega328 datasheet the value of the pull-up resistor is between 20K and 50K. This means different diodes can have different forward currents, and thus forward voltage. Did you do any kind of measurements on this effect?

Yes, it is between 20 and 50k. However it does not wildly fluctuate or vary a lot. You are right about the added protection but my goal was to keep the parts count as low as possible. Right now I am only interested in qualitative measurements, so I ignored the impact of the resistors. I did not investigate this in any detail. The impact can be assessed without measurement by looking at the standard models, e.g. the Shockley model http://en.wikipedia.org/wiki/Diode_modelling

Small diodes can also be obtained from any old broken LCD TV power supply.
These are typically discarded when replaced, and have between 20 and 30 identical SMD diodes on the solder side.
Probably 1N4148s judging by the voltage drop, but they exhibit similar thermal sensitivity.