Build a Thermal Flashlight - Light Painting With Temperature
Intro: Build a Thermal Flashlight - Light Painting With Temperature
Inspired by the Public Laboratory and having just finished a round of college applications, I decided to experiment with thermal imaging on the cheap.
Thermal cameras are expensive. Even at low resolutions, it is not uncommon for a decent thermal camera to cost over $10,000. However, for only $20, you can buy an infrared thermometer that reads the average temperature over a small area. If we could turn that single area into a color and use a long exposure photography to "paint" the scene with that color, we could create something very similar to a proper thermal image.
This is not a new idea. The Public Laboratory has come out with a design for something that does this, but I have yet to see one make its way off of a breadboard. I decided to take the project to the next level and make a real, bona fide thermal flashlight. Here's how I did it.
Thermal cameras are expensive. Even at low resolutions, it is not uncommon for a decent thermal camera to cost over $10,000. However, for only $20, you can buy an infrared thermometer that reads the average temperature over a small area. If we could turn that single area into a color and use a long exposure photography to "paint" the scene with that color, we could create something very similar to a proper thermal image.
This is not a new idea. The Public Laboratory has come out with a design for something that does this, but I have yet to see one make its way off of a breadboard. I decided to take the project to the next level and make a real, bona fide thermal flashlight. Here's how I did it.
STEP 1: Materials
Materials:
- Infrared Thermometer - MLX90614
- 0.1uF Ceramic Capacitor
- 2 4.7k Resistors
- 3 1k Resistors
- 8 RGB LEDsNote: Previously, and in the images in this instructable, you will see me using common cathode (negative) LEDs. To make your life easier with the transistors, use common anode LEDs like the ones now linked.
- Dorcy LED Flashlight
- 3 NPN Transistors
- Arduino, any will do
- 9V Battery Clip and Battery
- Perfboard
STEP 2: Making the RGB LED Assembly
First I cracked open the flashlight and had a look inside. Then I removed the LED assembly, which required removing three screws. Save the old LED assembly if you want. We don't need it, but it's a useful source of ultra-bright LEDs.
Now we have to start making our own RGB LED assembly. Remove the reflector from the flashlight's housing so we can work on it. One interesting thing to keep in mind - even though the reflector is made of plastic, it has a very conductive coating. Make sure you don't short anything against it by accident.
Place all of the 5mm LEDs in the outer ring of the reflector. We are leaving the center empty for the infrared thermometer. Also, remove the plastic lens from the flashlight cap. Using the placed LEDs as a guide, insert the leads through your piece of perfboard. Solder the LEDs in place, making sure they are all in the same orientation relative to one another. In this case, the blue pin of the RGB LED is always on the right (the long pins are the common anodes of the RGB LEDs).
Now we have to start making our own RGB LED assembly. Remove the reflector from the flashlight's housing so we can work on it. One interesting thing to keep in mind - even though the reflector is made of plastic, it has a very conductive coating. Make sure you don't short anything against it by accident.
Place all of the 5mm LEDs in the outer ring of the reflector. We are leaving the center empty for the infrared thermometer. Also, remove the plastic lens from the flashlight cap. Using the placed LEDs as a guide, insert the leads through your piece of perfboard. Solder the LEDs in place, making sure they are all in the same orientation relative to one another. In this case, the blue pin of the RGB LED is always on the right (the long pins are the common anodes of the RGB LEDs).
STEP 3: Wiring the LED Assembly
We are wiring all of the LEDs in parallel. Bend down the same pin on each LED and solder each to the core of a piece of solid core wire to connect everything together. Add a couple of pieces of electrical tape to insulate these connections from the next layer. Bend down the next pin. Lather, rinse, repeat. Note that I didn't add 100 ohm current limiting resistors to each of the LEDs. This would have been advisable, but I got away with it by adding a 15 ohm resistor in series with the red, green, and blue channels. That was not ideal, since I'm trusting that each of the LEDs will draw its correct share of current (unfortunately, that almost certainly is not the case). Be smarter than me and add your current limiting resistors to each LED during this stage.
Inside the plastic flashlight housing, break off the two plastic flaps on either side of the power switch. We need the room.
Inside the plastic flashlight housing, break off the two plastic flaps on either side of the power switch. We need the room.
STEP 4: Wiring the Sensor
Solder wires to each of the pins on the thermometer. I used heat-shrink tubing to make sure nothing shorted out. Make sure to remember which wire goes to which pin (relative to the little bump on the thermometer).
Wire up the thermometer as described by the diagram (borrowed from here).
Connect everything to the Arduino: the pins you connect the RGB LEDs to have to be PWM pins since we need gradations of brightness with each color. Where you connect everything depends on your code (see next step). Two pins from the sensor went to analogs 4 and 5, and each color of the LEDs should go to pins 3, 5, and 6 through the NPN transistors to ground (I made a mistake by not doing this -- Ugifer correctly pointed out that I was drawing too much current from the Arduino otherwise). If you don't know what that means, check out this diagram. Power went to the common anodes of the LEDs. Solder the power switch of the flashlight between the 9V and the Arduino.
Wire up the thermometer as described by the diagram (borrowed from here).
Connect everything to the Arduino: the pins you connect the RGB LEDs to have to be PWM pins since we need gradations of brightness with each color. Where you connect everything depends on your code (see next step). Two pins from the sensor went to analogs 4 and 5, and each color of the LEDs should go to pins 3, 5, and 6 through the NPN transistors to ground (I made a mistake by not doing this -- Ugifer correctly pointed out that I was drawing too much current from the Arduino otherwise). If you don't know what that means, check out this diagram. Power went to the common anodes of the LEDs. Solder the power switch of the flashlight between the 9V and the Arduino.
STEP 5: Programming and Final Assembly
I used the code generously provided by the Public Laboratory. It does exactly what we need it to!
Carefully place everything into the flashlight housing making sure no boards can short out against each other. You're done!
As always, please feel free to ask me any questions. Let me know if you build your own thermal flashlight - I'd love to see it!
Carefully place everything into the flashlight housing making sure no boards can short out against each other. You're done!
As always, please feel free to ask me any questions. Let me know if you build your own thermal flashlight - I'd love to see it!
38 Comments
eng_Andy 11 years ago
You should get a single ATMega for that function (it'll probably just cost you a couple of dollars over there), use the Arduino to program it, then take it out and connect it to your perfboard.
See http://arduino.cc/en/Tutorial/ArduinoToBreadboard for an example of how to do this, and http://arduino.cc/en/Hacking/PinMapping168 for the corresponding uC pins to connect to.
SaedD 7 years ago
can i ask something?
you mentiond that atmega168 is recommend, can i use atmega32u4?
https://www.arduino.cc/en/Products/Compare
maxjus 11 years ago
DIY-Guy 11 years ago
(I still need to learn how to make a dedicated processor and am looking forward to learning how to make this with the ATMega chip previously mentioned.)
Ultra Computers 8 years ago
power000 11 years ago
davidprosser 11 years ago
Ugifer 11 years ago
That should give you the idea.
Ugi
Ugifer 11 years ago
For 8 LEDs, you want something that can drive at least 8 x 20 = 160 mA per colour so a standard 2N3904 (200mA) per channel should be fine. My guess is that it will be much brighter using these because the Arduino is probably limiting your current at the moment.
Hope I'm not just being dense and missing something in the write-up!
Fab' project BTW.
Ugi.
maxjus 11 years ago
Ugifer 11 years ago
Ugi
SnyperBob 11 years ago
Creator Nater 11 years ago
rondacosta 11 years ago
However, it appears the people that already "know about Thermal measurement" are the ones jumping up and down in joy.
For the rest of us,,,,, well,,,,, after spending some time investigating now I understand the theory and purpose.
So, question #1: do I also need a camera? which type of film?
question #2: does this work if I point it to my house at night and see the thermal situation? or is it too large an object for this device?
As somebody else suggested, you need to explain the theory and purpose, the construction (you did), and the practical application or usage of your ‘able.
Otherwise it is like “preaching to the choir”, everybody else may be left out….
maxjus 11 years ago
rondacosta 11 years ago
could anyone describe, if you have done it, the experience in doing a full external house thermal study? That would be of great help and enticement.
If you could document it with some pics or video, great.
T3h_Muffinator 11 years ago
maxjus 11 years ago
TIvetun 11 years ago
Dia1Up 11 years ago