# DIY Thermal Light Painting - Heat Map Photography

## Overview

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

![](https://cdn-learn.adafruit.com/assets/assets/000/015/786/medium800/temperature_hero-the-two-flir.jpg?1397046680)

In this project we’ll use a temperature sensor to change the color of a NeoPixel ring to create heat map photography. A cyber-tronic looking sensor measures remote infrared light making it a contact-less temperature sensor.   
  
 This 3D Printed project comes in two different styles. This neoblaster makes a practical ray gun and this ergomonical handle resembles a magnifying glass.  
Info: 

Prerequisite Guides

- [Gemma M0 guide](https://learn.adafruit.com/adafruit-gemma-m0/circuitpython-digital-in-out?view=all)&nbsp;or the&nbsp;[Classic Introducing&nbsp;GEMMA guide](https://learn.adafruit.com/introducing-gemma/introduction)&nbsp;
- [Using Melexis MLX90614](../../../../using-melexis-mlx90614-non-contact-sensors "Link: https://learn.adafruit.com/using-melexis-mlx90614-non-contact-sensors")

Tools

- [Wire Stripper](http://www.adafruit.com/product/527 "Link: http://www.adafruit.com/product/527")
- [3D Printer](http://www.adafruit.com/category/128 "Link: http://www.adafruit.com/category/128")
- [Soldering Iron](http://www.adafruit.com/categories/84 "Link: http://www.adafruit.com/categories/84")

Parts & Supplies

- [24x NeoPixel Ring](http://www.adafruit.com/product/1586 "Link: http://www.adafruit.com/product/1586")
- [Gemma M0](https://www.adafruit.com/product/3501)&nbsp;or&nbsp;[classic Gemma](https://www.adafruit.com/product/2470)
- [On / Off Slide switch](https://www.adafruit.com/product/805)
- [Melexis Contact-less Infrared Sensor](http://www.adafruit.com/product/1747 "Link: http://www.adafruit.com/product/1747")
- [3x AAA Battery Holder](http://www.adafruit.com/product/727 "Link: http://www.adafruit.com/product/727")
- [30 AWG Wire](http://www.adafruit.com/product/1446)

# Like this project?
[Check out what we based it off of - Public Labs' Thermal Torch!](http://publiclab.org/notes/drdbw/3-28-2012/thermal-torch-adjustable-temperature-scale "Link: http://publiclab.org/notes/drdbw/3-28-2012/thermal-torch-adjustable-temperature-scale")  
# DIY Thermal Light Painting - Heat Map Photography

## 3D Printing

[Download STLs](http://www.thingiverse.com/thing:291934)
Parts are optimized to print on a [Makerbot Replicator 2](http://www.adafruit.com/category/128 "Link: http://www.adafruit.com/category/128") and sliced with Makerware. Download the parts from [thingiverse](http://www.thingiverse.com/thing:291934) and print them out using the recommended settings below.

 **Ray Gun**  
This model is composed of 10 pieces that snap-fit together. Each piece should be printed separately in your favorite colored PLA. The diffuser should be printed in transparent PLA to soften the NeoPixel ring.  **Light Handle**  
Easier to print and assemble, the light handle model is composed of only 4 pieces that snap-fit together. # DIY Thermal Light Painting - Heat Map Photography

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/015/801/medium800/temperature_circuit.jpg?1397095308)

Info: 

Follow the circuit diagram to and solder the components together using [wrapping wire](http://www.adafruit.com/product/1446). Carefully measure the lengths of wire to ensure the components will have enough slack to reach the desired location in the 3d Printed model. The ray gun will require significantly more wire.

 **D1** \> **IN** NeoPixel Ring  
**GND** \> **GND** NeoPixel Ring  
**Vout** \> **PWR** NeoPixel Ring  
**GND** \> **Top Right** - MLX90614  
**3V** \> **Bottom Right** - MLX90614  
**D0** \> **Bottom Left (Include Resistor)** - MLX90614   
**D2** \> **Top Left (Include Resistor)** - MLX90614  
**JST** \> **3X AAA** Battery Holder # DIY Thermal Light Painting - Heat Map Photography

## Arduino Code

Info: 

Make sure to to download the [Mini MLX90614](https://github.com/adafruit/Adafruit_MiniMLX90614), [NeoPixel](https://github.com/adafruit/Adafruit_NeoPixel) and [TinyWireM Library](https://github.com/adafruit/TinyWireM). Below is a sample sketch that will change the color of the NeoPixel ring depending on temperature values - copy it into your Adafruit Arduino IDE as-is and then mod the temperature values to make it your own. Remember that to program GEMMA you need to download the special Adafruit version of the Arduino IDE from the [Introduction to GEMMA guide.](https://learn.adafruit.com/introducing-gemma)

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/DIY_Thermal_Light_Painting/DIY_Thermal_Light_Painting.ino

# DIY Thermal Light Painting - Heat Map Photography

## CircuitPython Code

![](https://cdn-learn.adafruit.com/assets/assets/000/056/184/medium800/temperature___humidity_gemma-cp.jpg?1529967070)

 **GEMMA&nbsp;M0** &nbsp;boards can&nbsp;run&nbsp; **CircuitPython** &nbsp;— a different approach to programming compared to Arduino sketches. In fact,&nbsp; **CircuitPython comes&nbsp;factory pre-loaded on GEMMA&nbsp;M0**. If you’ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the&nbsp;[**Adafruit GEMMA&nbsp;M0 guide**](https://learn.adafruit.com/adafruit-gemma-m0/circuitpython-setup-1).

Info: 

Below is CircuitPython code that works&nbsp;similarly (though not the same) as the Arduino sketch shown on a prior page. To use this, plug the GEMMA M0 into USB…it should show up on your computer as a small&nbsp; **flash drive** …then edit the file “ **main.py** ” with your text editor of choice. Select and copy the code below and paste it into that file,&nbsp; **entirely replacing its contents** &nbsp;(don’t mix it in with lingering bits of old code). When you save the file, the code should&nbsp; **start running almost immediately** &nbsp;(if not, see notes at the bottom of this page).

**If GEMMA M0 doesn’t show up as a&nbsp;drive, follow the GEMMA M0 guide link above to prepare the board for CircuitPython.**

This code requires two additional libraries be installed:

1. adafruit\_mlx90614
2. adafruit\_bus\_device
3. neopixel

If you’ve just reloaded the board with CircuitPython, create the “lib” directory and then download the[&nbsp;Adafruit CircuitPython Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases).

[Adafruit CircuitPython Bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases)
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/DIY_Thermal_Light_Painting/code.py

# DIY Thermal Light Painting - Heat Map Photography

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/015/794/medium800/temperature_slideSwitchb.jpg?1397057414)

 **Slide Switch Adapter**  
This tiny slide switch soldered to a JST extension cable is great way to extend your battery power button. Make sure to use shrink tubing to secure the soldered connections![](https://cdn-learn.adafruit.com/assets/assets/000/015/804/medium800/temperature_resistorsB.jpg?1397140266)

 **Resistors**  
The resistors are included with the **MLX90614**. These two resistors can be solder directly on to the **GEMMA**. Both of them will share the **3V pin** of the **GEMMA**.![](https://cdn-learn.adafruit.com/assets/assets/000/015/803/medium800/temperature_circuits2b.jpg?1397140119)

 **The Circuit**   
And heres what the bare circuit looks like. A bit different then the circuit diagram, right? You will need to ensure the **MLX90614** temperature sensor is orientated the correct way in order to solder the connections properly. You can trim the terminals of the sensor. Be sure to use shrink tubing to secure the connections on the sensors. # DIY Thermal Light Painting - Heat Map Photography

## The Light Handle

![](https://cdn-learn.adafruit.com/assets/assets/000/015/787/medium800/temperature_3d-parts.jpg?1397057128)

 **3D Printed Parts**  
The GEMMA is housed in the **flir-handle-btm.stl** with the **USB port** facing the **bottom**. This allows you to easily reprogram the GEMMA without having to disassemble the handle.  
  
The **3X AAA Battery** holder fits in the large space just above the **GEMMA**. You may need to secure it into place with double sided foam tape or any other plastic-friendly adhesive.  
  
The **slide switch adapter** is held in place between the two handle pieces. The opening is located in the upper back of the handle parts.  
  
The **MLX90614** temperature sensor is housed in the upper front of the handle and also held in place by the two handle parts.![](https://cdn-learn.adafruit.com/assets/assets/000/015/790/medium800/temperature_circuits.jpg?1397057298)

The **24x NeoPixel Ring** is placed inside the **flir-handle-light.stl** with the wires feeding through the hole. The three wires are strung through the opening of the hinge in the **flir-handle-btm.stl** and **flir-handle-top.stl**. A [third helping hand](http://www.adafruit.com/product/291 "Link: http://www.adafruit.com/product/291") will help keep the components stationary while you solder.

The **flir-handle-btm.stl** and **flir-handle-top.stl** parts snap together. Before closing them shut, ensure the three wires to the NeoPixel ring are strung through the opening near the top hinge. Be careful not to kink the wires. The **flir-handle-light.stl** snaps to the joined handle piece. To secure this piece to the handle, insert a piece of a paper clip into the hole located in the middle of the hinge where they meet.

# DIY Thermal Light Painting - Heat Map Photography

## The Ray Gun

![](https://cdn-learn.adafruit.com/assets/assets/000/015/789/medium800/temperature_3d-parts2.jpg?1397057216)

 **3D Printed Parts**  
There are 10 pieces to the ray gun. This is a great print if you're really ambitious about 3D Printing. The **raygun-neck.stl** , **raygun-handle-top.stl** , and **raygun-handle-btm.stl** parts require support material to print properly.   
  
Once you have them all printed out, test fit them to see if the tolerance allow for a snap fit. If things are too tight, you can always try sanding down areas to allow assembly. Below is a list of parts that fit to one another.  
  

- raygun-cap.stl \> raygun-body.stl  
- raygun-neck.stl \> raygun-body.stl   
- raygun-cone.stl \> raygun-neck.stl  
- raygun-sensor.stl \> raygun-cone.stl  
- raygun-ring.stl \> raygun-cone.stl  
- raygun-handle-top.stl \> raygun-handle-btm.stl  
- raygun-handle-lid.stl \> raygun-handle-top.stl  
- raygun-handle-top.stl + raygun-handle-btm.stl \> raygun-body.stl
- raygun-diffuser.stl \> raygun-ring.stl  

![](https://cdn-learn.adafruit.com/assets/assets/000/015/795/medium800/temperature_barrelWireHole.jpg?1397057478)

 **MLX90614**   
The temperature sensor is inserted into the **raygun-sensor.stl** part with the orientation aligning up with the slit opening for the sensors nub. Use a long thin screw driver to gently press against the sensor, securing into place.![](https://cdn-learn.adafruit.com/assets/assets/000/015/791/medium800/temperature_wirePaths.jpg?1397057332)

 **GEMMA**  
The micro-controller snaps to the inside of the **raygun-cap.stl** with the USB port facing the large opening for reprogramming without disassembly. The slide switch adapter tightly fits into the opening of the **raygun-cap.stl** , just above the **GEMMA**.  **NeoPixel Ring**  
The wiring needs to be long enough to run from the **raygun-cap.stl** to the **raygun-body.stl** , strung through the **raygun-neck.stl** and strung through the small hole of the **raygun-ring.stl**. The wiring should be exposed on the **raygun-cone.stl** part.![](https://cdn-learn.adafruit.com/assets/assets/000/015/792/medium800/temperature_gunScrews.jpg?1397057359)

 **Assembling the Handle**  
The **raygun-handle-top.stl** and **raygun-handle-btm.stl** pieces snap fit together. Both parts have 2mm holes for small screws that will mount the two parts to the **raygun-body.stl** ![](https://cdn-learn.adafruit.com/assets/assets/000/015/793/medium800/temperature_screwVscrewb.jpg?1397057382)

 **3X AAA Battery Holder**  
The two handle parts and the **raygun-body.stl** have a large hole, this allows the battery JST wire to run through the parts and is connected to the slide switch adapter that is mounted to the **raygun-cap.stl**. The **raygun-handle-lid.stl** part is secured to the **raygun-handle-top.stl** with 2 small screws.  
![](https://cdn-learn.adafruit.com/assets/assets/000/015/796/medium800/temperature_gunHero.jpg?1397057550)

 **Ray Gun**  
The fully assembled model is a challenging project but definitely reproducible. Each piece is hollow and optimized for sturdiness. 
## Featured Products

### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
### Adafruit GEMMA v2 - Miniature wearable electronic platform

[Adafruit GEMMA v2 - Miniature wearable electronic platform](https://www.adafruit.com/product/1222)
 **Deprecation Warning: The Gemma bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Gemma so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1222)
[Related Guides to the Product](https://learn.adafruit.com/products/1222/guides)
### NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1586)
Round and round and round they go! 24 ultra bright smart LED NeoPixels are arranged in a circle with 2.6" (66mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1586)
[Related Guides to the Product](https://learn.adafruit.com/products/1586/guides)
### Type A Machines Series 1 Pro 3D Printer

[Type A Machines Series 1 Pro 3D Printer](https://www.adafruit.com/product/2412)
Built to last&nbsp;and better than ever. The **Series&nbsp;1&nbsp;Pro 3D** printers&nbsp;from Type A Machines offer&nbsp;durability, modularity and one of the largest build volumes in their&nbsp;class.

Featuring a streamlined aluminum and acrylic body, a glass build surface...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2412)
[Related Guides to the Product](https://learn.adafruit.com/products/2412/guides)
### PLA Filament for 3D Printers - 1.75mm Natural Translucent - 1KG

[PLA Filament for 3D Printers - 1.75mm Natural Translucent - 1KG](https://www.adafruit.com/product/2451)
Having a 3D printer without filament is sort of like having a regular printer without paper or ink. &nbsp;And while a lot of printers come with some filament there's a good chance you've been printing up a storm and need something new. &nbsp;That's why we've started carrying a...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2451)
[Related Guides to the Product](https://learn.adafruit.com/products/2451/guides)
### PLA Filament for 3D Printers - 1.75mm Diameter

[PLA Filament for 3D Printers - 1.75mm Diameter](https://www.adafruit.com/product/2449)
Having a 3D printer without filament is sort of like having a regular printer without paper or ink. &nbsp;And while a lot of printers come with some filament there's a good chance you've been printing up a storm and need something new. &nbsp;That's why we've started carrying a...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2449)
[Related Guides to the Product](https://learn.adafruit.com/products/2449/guides)
### Silicone Cover Stranded-Core Wire - 30AWG in Various Colors

[Silicone Cover Stranded-Core Wire - 30AWG in Various Colors](https://www.adafruit.com/product/2051)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2051)
[Related Guides to the Product](https://learn.adafruit.com/products/2051/guides)
### Melexis Contact-less Infrared Sensor - MLX90614 3V

[Melexis Contact-less Infrared Sensor - MLX90614 3V](https://www.adafruit.com/product/1747)
This cyber-tronic looking sensor hides a secret behind it's glimmering eye. Unlike most temperature sensors, this sensor measures infrared light emitted off of remote objects so it can sense temperature _without_ having to touch them physically. Simply point the sensor towards what...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1747)
[Related Guides to the Product](https://learn.adafruit.com/products/1747/guides)

## Related Guides

- [NeoPixel Spats with Gemma and MakeCode](https://learn.adafruit.com/neopixel-spats.md)
- [3D Printed LED Fire Horns](https://learn.adafruit.com/3d-printed-led-fire-horns.md)
- [AdaBox 007](https://learn.adafruit.com/adabox007.md)
- [Space Face LED Galaxy Makeup](https://learn.adafruit.com/space-face-led-galaxy-makeup.md)
- [The Foul Fowl -- Keystroke Injection Attack Tool with Gemma M0](https://learn.adafruit.com/the-foul-fowl-keyboard-injection-payload-gemma-m0.md)
- [Techno-Tiki RGB LED Torch](https://learn.adafruit.com/techno-tiki-rgb-led-torch.md)
- [Logan’s Run Hand Jewel LED](https://learn.adafruit.com/led-in-you-hand-logans-run-life-clock.md)
- [MakeCode Maker](https://learn.adafruit.com/makecode-maker.md)
- [Animated NeoPixel Glow Fur Scarf](https://learn.adafruit.com/animated-neopixel-gemma-glow-fur-scarf.md)
- [Debugging the SAMD21 with GDB](https://learn.adafruit.com/debugging-the-samd21-with-gdb.md)
- [Cyber Tank Girl Cosplay](https://learn.adafruit.com/cyber-tank-girl-cosplay.md)
- [Unibeam](https://learn.adafruit.com/unibeam.md)
- [Esenciales para CircuitPython](https://learn.adafruit.com/esenciales-para-circuitpython.md)
- [UFO Drone](https://learn.adafruit.com/ufo-drone.md)
- [NeoPixel GoPro Lens Light](https://learn.adafruit.com/neopixel-gopro-lens-light.md)
