Infrared Thermometer Pen

by xmorneau in Circuits > Arduino

6406 Views, 93 Favorites, 0 Comments

Infrared Thermometer Pen

IMG_1496.jpg
rendu3D_4.JPG
IMG_1495.jpg
IMG_1476.jpg
rendu3D_3.JPG

The ThermoPen is the result of my final class project in physics that took place from January to March 2021.


Also called the ThermoPen, the goal of this project was to create a portable thermometer usable for precise uses case. More particularly, is was created to inspect overheating electronic parts on PCB and for general troubleshooting. At my school, the ThermoPen was a highly requested product, as multiples teachers who get in touch with electronics need a tool for fast troubleshooting with projects from students or themselves.

So how exactly this weird pen works? Is it only a simple temperature infrared sensor glued onto a pen? To be clear, the pen features an Ir sensor that converts infrared emission from objects into an electric signal which can be translated to a temperature by a micro-controllers.

In that way, I made a PCB that integrates an Atmega 328P (same controller as the Arduino Uno/Nano) to control inputs and outputs from buttons and sensors. In its simplest expression, it's an Ir sensor that reads temperature. What makes the ThermoPen different and original from this basic concept is that it includes features extremely useful for the user, in a small and slim form factor.

The ThermoPen features:

- An OLED screen that displays objects temperature, ambient temperature, maximum and minimum object temperature

-Audio feedback

-Press-to-activate button

-Rechargeable Li-Ion battery circuit

-Laser diode acting as a pointer


Let's start building your own ThermoPen by exploring how I built my own!

Important links:

GitHub repositories link: https://github.com/xmorneau/thermopen

Supplies

- Arduino Uno ou Nano (Arduino As Isp)

- 3D printer for printing the case

-ThermoPen PCB, accessible from GitHub

- All electronic part from the BOM spreadsheet, accessible from GitHub

- Reflow oven

- Magnifying glass for PCB making

- Automatic tin Needle dispenser (better called "Timed Air Dispenser")

Overview of the Project and Preparation

Thermopen.png

Before starting building the infrared thermometer, it's important to understand how it works.

Please refers to the picture for a visual overview of what composes the ThermoPen.


To begin with, the ThermoPen is built around a custom-made PCB that integrates an Arduino-like circuit. It takes inspiration from the Arduino Nano circuit for the integration of the Atmega328p micro-controller and from the circuit of an Adafruit Arduino Uno shield for the charging of a ŀi-Ion battery.

When pressing the button, the battery is powering the circuit and the program inside the micro-controller starts its initialization. A Power-up sound is made. After 1 second, the laser diode goes ON and the screen prints real-time data read from the thermometer sensor. The Arduino code also calculates min and max temperature, as well as battery voltage and capacity. Releasing the power button will let the ThermoPen to work for 4-5 seconds before turning off, made possible by capacitors.

To be clear, the laser diodes only purpose is to give the user an idea of where the temperature is measured. The true magic is made possible by the temperature sensor MLX0614 made by Melexis, which uses a physics principle where an object will emit a certain quantity of infrared light depending on its temperature. From there the sensor converts the quantity of infrared wavelength received into an electric signal proportional to the temperature which is processed by the micro-controller into a temperature in Celcius.

The PCB have differents optional LED that can be soldered ON. One will indicates when the battery is too low. The battery icon will also start to blink in that condition. Fortunately, the pen includes a micro-USB connector with a Li-ıon battery charger circuit, so it's not necessary to charge manually the battery.

Like every person, I make mistakes and have learned from those errors. One way to minimize your mistakes and maximize your productivity is to establish a schedule of tasks that need to be done for every day working on the project. Start your planing early and have a clear idea of when the product should be completed. I worked on this project for about 2 months. Logically, you should have a different planing of mine, as I gave you the ressources to order the PCB, buy the components and print the case. The next steps of the project will give you the necessary to build your own ThermoPen fairly easily! Let's starts having fun!

Design the Schematics and the PCB

schematics1.png
schematics2.png
Capture d’écran 2021-06-26 002524.png

As I said earlier, the schematic takes inspiration from the Arduino Nano for the Atmega328P circuit including its power circuits and clock choices. For convenience, I took a crystal generating a lower frequency, as it would enhance batter efficiency. The Oled screen, buzzer, IR sensor, and laser diode are connected to the micro-controller, via Analog pin, Digital pin, or from I2C communication bus. For the circuit related to the charging and discharging of the Li-Ion battery, I took some serious inspiration from an Adafruit Arduino Uno shield for a rechargeable battery.

Here's a link the to product:
https://learn.adafruit.com/adafruit-powerboost-500...

Thanks, Lady Ada for your awesome work!

Everything was done using KiCad and some libraries provided by DigiKey, a big electronic parts retailer. You will find the complete KiCad project in the ThermoPen GitHub.

I used KiCad for Schematics design, as well as PCB design. It's a really powerful software for an open-source project, and it's free.

Shopping and Ordering Electronics Parts

Capture d’écran 2021-07-03 232833.png

During PCB design, I also took time to select the right electronics parts that fitted my use case. For example, I had to select a small package size so it would fit inside a small enclosure. Most resistors and capacitors are 08x05 package size.

I was lucky enough to have some of those parts in possession, at school, like SMD button and the IR sensor. For all the other parts, I ordered them from Digikey, one of the biggest electronics part retailers in North America. For convenience purposes, I made an Excel list of each component needed, with their price and store link.

The list is accessible from the ThermoPen Github!

Product Design and 3D Render

Capture.PNG
Capture d’écran 2021-07-09 225215.png
rendu3D_4.JPG
rendu3D_1.JPG
rendu3D_2.JPG

Now comes the challenging part: Integrating everything in a small and practical case!

The 3D design was done using Solidworks.

To make my life easier, I modeled all the parts I knew the dimension, like the battery, the USB connector, the PCB, the diode laser, and the infrared sensor.

I decided to choose a squared shape, so I could easily pass wire around the battery or other components. I wanted the tolerance to be very tight, so no screws would be used. As a result, the battery clips very nicely in the casing, as well as the PCB. For the button, I made a clever design that integrates an aluminum button that is squeezed between the PCB button on the plastic housing.

The laser diode is placed just between the IR sensor for maximum accuracy. When the product is in the hand, the laser is hidden behind the point of the pen. It's a more elegant way to integrate the laser because it seems to the user that the laser comes from the IR sensor, but it's not.

On the main side of the pen, I placed the Oled screen next to the button and the ThermoPen Branding at the other end. On one side, there are two holes for the charging indicator LED, which indicate when the battery is charging and fully charged.

As you see, the inside is accessible by a sliding cover dissimulated at the backside of the pen. It stays in place by a plastic bracket. The assembly is done on this side and is also used for battery replacement.

During the design process, I needed to keep in mind that the housing would be 3D printed in plastic, so I tried my best to avoid floating pieces.

It was one of my first product design experiences and I enjoyed doing it. I think I came out with a design workable for the first prototype. For sure, I ended up printing the case multiple times, each time slightly modifying the precedent design.

3D Printing Parts and Machine the Aluminium Button

IMG_1519[1].JPG
IMG_1520[1].JPG
IMG_1521[1].JPG
buttondesign thermopen.png

For each iteration of the case I designed, I 3D printed it to see what was working and what needed to be redesigned. Around 6 different cases were printed before the final prototype.

I enjoyed this step, as I could physically interact with my 3D design. It was also at this point that I started manipulating each component entering the composition of the ThermoPen. I would then enhance my CAD design so the part would fit nicely in the case. For example, the hole I designed for the laser diode got redesigned because I made it too small; having the laser diode in hand helped me to modify the case design.

The 3D printer I used was a Prusa i3 MK3, and it did a pretty good job in ABS plastic. I never really encountered failed printing, as the printer was able to print successfully every part, every time. The only problem I got, visible on the prototype, is that the printer had a hard time printing precisely the sharper edge of the pen, as one of the sides needed to be printed upside down. I added the plastic supports option on the printer, but I would get the same result. The plastic was smooth on one side like shown in the images, but it was rough on the other side. For future production, I will take time to polish the plastic and maybe paint them for a sleeker look.

I didn't have any picture of the button removed from the product, but the machining was quite straightforward. I made a schema to represent the shape of the round button in 2D.

Soldering of the PCB

IMG_1517[1].JPG
IMG_1518[2].JPG
IMG_0772.jpg
IMG_0771.jpg
IMG_0759.jpg
IMG_0760.jpg

One of the greatest challenges of the project was to solder every part without any failure, as the PCB contained more than 50 parts that required different soldering techniques and equipment.

Firstly, I designed the PCB so all components that requires a reflow oven are located on the same side. It was the case for the Atmaga 32P, as well as the buck-boost circuit that converts 3.7V from the battery to 5V for the micro-controller. For better tin application, I used an electronic magnifying glass with a Timed Air Dispenser filled with tin.

The buck-boost chip caused me some serious trouble, as all of its pads were underneath the package type. As a result, my first soldered PCB got burned because of a short circuit caused by this chip. It to me some time to find the problem, which caused me to reconsider the quality of the electrical wiring. Fortunately, I fixed this problem by soldering a new PCB and from now on the circuit seemed to react normally when powered.

You will notice that the PCB includes lots of connector holes. This is where the wires for different components located outside the PCB will be soldered on the assembly step.

Some parts and PCB footprints changed since this prototype, like the inductance footprint, as I only got one chance to develop and manufacture a PCB during my project deadline. Since then, I did various little tweaks and also added a diode preventing reverse battery condition.

Programation of the Micro-controller

IMG_0839.jpg
arduino-uno-breakdown-27.jpg
IMG_0687.jpg
IMG_0682.jpg
Capture d’écran 2021-07-18 000910.png
Capture d’écran 2021-07-18 001011.png
components_tenergydischarge.gif

It's now time to add life to the product and give it the brain it deserves!

The Arduino code file is available in the ThermoPen GitHub project.

I will not explain in detail what's in my code, as it remains a fairly simple one.

Its general content is:

- Multiple libraries for the Oled screen, display graphics, and infrared sensor.

- A setup sequence doing a startup sound and initializing the laser diode and Infrared sensor.

- Read and print battery life.

- Print object temperature, ambient temperature, minimum and maximum temperature.

To program the Atmega 328p, I considered the ThermoPen like it was another Arduino Uno/Nano. Using an SPI connection between our PCB and another Arduino, called the host, I could program my soldered chip using a method called "Arduino as ISP". The Arduino ISP is an In-System-Programmer that is used to program AVR microcontrollers. For more information about Arduino ISP programming, visit https://www.arduino.cc/en/Guide/ArduinoISP

The integration of the infrared sensor was really easy, thanks to the library available for this sensor. I was surprised to see that after 2 minutes of experimentation with this library, I got the sensor to work as I needed it for the project.

For the battery icon, I used the infamous Microsoft Paint to design quite basic icons that fit a low-resolution screen. For a certain battery voltage range, it would print the icon corresponding to the battery voltage. However, I still consider the battery icon a "work and progress", as I didn't verify which battery percentage corresponds to which battery voltage. To be clear, a Li-Ion battery has a specific battery voltage discharge curve and it's not a straight line!

Also, I tried to include a sleep mode so the TermoPen goes to sleep when activated for too long to prevent battery discharge, but I didn't succeed to make it work. For now, it works well without this functionality and I"m fine with it.

Assembling the ThermoPen

IMG_1803.JPG
IMG_1511[1].JPG
IMG_1515[1].JPG

As the title suggests, now comes the time to assemble everything together.

I started by wiring the Oled display to the PCB. I also added wires for the battery contact pads and the Micro-USB connector board. I will later solder them to their wire, as I needed to install the wires and PCB in the case before.

When all wires were correctly positioned, I put in place the PCB. The case integrated plastic clips which maintained the PCB well in place.

The laser diode needed to be placed after the IR sensor was in place, from the exterior, as the hole from the inside was too small. From there, we can solder the laser diode to the board. In my case, I did the mistake to solder the diode before mounting it on the case, so it was impossible to place it without cutting its wires. I ended up cutting them, re-soldering them, and added heatshrinks.

For this prototype, I placed a negative pole icon, as I did a mistake in my wiring. In the final design, I incorporated a (-) symbol on the case, which will indicate where you need to locate the (+) side of the battery.

Validates and Experiences Its Features

IMG_1498.jpg
IMG_1804.JPG
THERMOPEN - Projet individuel
IMG_1477.jpg
IMG_1490.jpg

Congratulation, we just finished building our very own ThermoPen!

Now comes the step of verifying how the product performs, from charging to temperature sensing.

First, I connected the ThermoPen via USB to a PC so I could verify it charges the battery. An orange LED should appear on the side indicating the battery is charging. Another way to verify the functionality is to read the current entering the battery with the multimeter. Note that as the battery charges, the current decreases until 0 A, when the battery voltage reaches around 4,2 V.

Then, we can see in the video above that I tested the temperature measurement by comparing the ThermoPen temperature with a thermocouple. Note that the sensor was recuperated from an old student project and that I didn't know how its condition was. Result were really good for low temperature and acceptable for the high one.

These result depend only on the sensor, as the manufacturer says that they are calibrated at the factory.

I also tested the over-temperature alarm, where the buzzer makes a sound when passing a temperature threshold (set at 120°C).

I'm still highly satisfied with these results, as I know that all systems and components work as intended in the ThermoPen!

I must also say that the thermoPen still works perfectly after 4 months of light use and I didn't run out of charge since then! The only flaw detected was that the battery was moving slightly inside the case, so I added plastic support to the enclosure to prevent this annoyance.

To conclude, I'm proud of how the ThermoPen ended up, considering that all my expectations from the start were realized and incorporated successfully into the product. I've learned a lot from product design during this project and it gave me a rich experience that will certainly impact my studies and career path.

I wish you had a great time reading or building my project, as it gave a general, but complete overview of a successful product design project!

What do you think of this product creation? I would love to know more about your impression and discuss it with you!


sheer,

Xavier