Arduino IR Temperature Sensor

Arduino IR Temperature Sensor

BeetlejuiceBeetlejuiceBeetlejuice

IR Temperature Sensor ‘guns’ are great! Aim them at an object, pull the trigger, and bam: It will output the average temperature of a focal spot. A very fast, non-contact way to measure the temperature, they are generally very inexpensive. That is, unless you want to record or graph the temperature.

Here’s a simple project that will that will let you record and graph temperatures on the cheap. It is implemented with an Arduino, two 10kohm resistors, some wire, and an inexpensive IR sensor. It is fast and accurate (you can see breathing by pointing the sensor at a human nose!). This project is based on the Adafruit project, but with a more narrow beam (better focus on smaller objects) and a simplified wiring.


Assembly

I chose to go with the Beetle because it is small and inexpensive. Other, smaller Arduino systems (ex: The Adafruit Trinket) may not work, because they lack serial communication. I suppose you could use the tried and true Uno, if you felt so inclined. For the actual sensor, I chose the Melexis MLX90614ESF-ACF-000-SP. It has a narrower viewing angle (10 degrees) than what was used in the original Adafruit project. With only 10 degrees of viewing angle, you can use trigonometry (SOH CAH TOA!!!) to figure out how far away you can place your sensor and still ensure you are only measuring the temperature of the intended object.

Fritzing has neither the beetle nor the IR sensor, so you will have to suffer through my mad paint skillz to see the wiring diagram: IRTempSense.png

As you can clearly see in this beautiful picture, the sensor is powered by ground and 5V from the Beetle. Data is carried through the SDA and SCL on both the Beetle and the sensor. Note that the sensor has an orientation, with a pin on the top of the sensor when it is looking at you. The purple and orange lines indicate two 10K pull-up resistors. Soldering wire on these panel mounts (as opposed to through holes) can be tricky. Put some solder down on the pad and some on the wire, then solder the two together. The two resistors can be placed in the trough-hole, soldered in, then soldered on the wire.

IRTempSense1.png

IRTempSense2.png

You could cover up the exposed electrical components with hot glue or something. It’s pretty safe at 5V, just don’t lick it, or set it on a metal table.

IRTempSense3.png

IRTempSense4.png

See that tiny pin up on top? That’s how you orient the part.


Code

New to Arduino? Check out this project for info on how to download and run a basic Arduino code (called a sketch). Then head over to Adafruit to grab their Adafruit_MLX90614 library. Plug in your Arduino and select the correct port. The Beetle runs as an Arduino Leonardo, so be sure to set the correct board with tools >board > Arduino Leonardo in Arduino IDE. Then download this code (heads up: if the code tries to save as a .txt, just delete the .txt and save it as .ino) and hit upload. Open the serial monitor to see temperatures, or serial plotter to have it automatically plotted for you.

IRTempSense6.png

IRTempSense7.png


ONE Core acknowledgement

Please acknowledge the ONE Core facility in your publications. An appropriate wording would be:

“The Optogenetics and Neural Engineering (ONE) Core at the University of Colorado School of Medicine provided engineering support for this research. The ONE Core is part of the NeuroTechnology Center, funded in part by the School of Medicine and by the National Institute of Neurological Disorders and Stroke of the National Institutes of Health under award number P30NS048154.”