Handheld Lab Thermometer Using the MAX31856

Published by ROVot in the blog ROVot's blog. Views: 251

Description: A handheld, battery operated thermometer suitable for lab or field use. By designing the thermometer around the MAX31856, the user is afforded a wide selection of themocouple types. A 16x4 character LCD displays the temperature measured by the TC, the maximum measured temperature, the minimum measured temperature, and a LOW BATTERY alert. A 2 pushbutton user interface allows for the selection of units (degrees F, C or K), resetting the maximum and minimum recorded temperatures to the current value, selecting the TC type and turning the LCD backlight on and off. The various functions of the unit are controlled by an Arduino Pro Mini.


Qty Description
1 MAX31856PMB1 Evaluation Board (USB adapter board is not used)
1 Arduino Pro Mini, 3.3V
1 LCD, 16x4 characters (Crystalfontz P/N CFAH1604B-YYH-ET)
2 Pushbutton, N.O.
1 NPN transistor, 2N2222
1 Resistor, 10 Ohm,1/4W 5%
1 Resistor, 30k Ohm,1/4W 5%
1 Resistor, 36k Ohm,1/4W 5%
2 Resistor, 10k Ohm,1/4W 5%
1 Resistor, 1k Ohm,1/4W 5%
1 Potentiometer, trimmer, 10k Ohm
4 Battery, alkaline, AA
1 Connector, mini thermocouple type
1 Enclosure

See attached PDF.

Design: The Pro Mini connects to the MAX31856 via the SPI bus and to the LCD via a 4-bit parallel interface, using the RS and E control lines. Two of the Pro Mini's digital input pins are connected to the pushbuttons and one analog input is used to measure the battery voltage through a resistor divider. One output pin is used to control power to the LCD backlight via an NPN transistor.

Operation: At power on, the Pro Mini reads two bytes from its EEPROM - the previously stored states of the units (degrees F, C or K) and the thermocouple type. Using these values, the LCD is initialized to display the proper units and the MAX31856 is initialized to the proper TC type. By storing the last selected values of units and TC type, the thermometer powers up in the last configuration set by the user.

Once the thermometer is initialized, the Pro Mini reads the TC temperature from the MAX31856 and displays it on the 1st (top) line of the LCD. Also displayed on the top line is the selected thermocouple type. The Pro Mini then compares the current temperature value with the last maximum and minimum values; if these values are exceeded, the display is updated accordingly. The MAXIMUM value is displayed on the 2nd line of the LCD, while the MINIMUM value is displayed on the 3rd line. The temperature is displayed to an accuracy of one decimal point (i.e. XXXX.X or -XXX.X).

Next, the Pro Mini checks the states of the 2 pushbuttons. These pushbuttons are designated as FUNCTION and SELECT. The FUNCTION button performs the following:
1) if pressed and held for less than 1 second, the displayed MAX and MIN temperature values are reset to the current measured temperature;
2) if pressed and held for more than 1 second but less than 5 seconds, the units are changed from F to C on the 1st press, then C to K on the 2nd
press, then back to F on the 3rd press. If the button is not pressed again for 2 seconds, the selected unit is stored in EEPROM and the thermometer resumes normal operation;
3) if pressed and held for more then 5 seconds, the unit is put into the THERMOCOUPLE SELECT mode. Pressing the button again stores the
selected TC type in EEPROM and returns to normal operation.

The SELECT button performs the following:
1) if the unit is in the THERMOCOUPLE SELECT mode, each press of the SELECT button steps through the various TC types that can be
programmed into the MAX31856 (K, J, N, R, S, T, E, and B);
2) if the unit is not in the THERMOCOUPLE SELECT mode (i.e. in normal operating mode), pressing the SELECT button turns the LCD backlight on and off.

After checking the states of the pushbuttons (and acting on them as required), the Pro Mini reads the value of the battery voltage. Using 4 AA batteries supplies a nominal 6V to the circuitry. When the battery voltage falls to a low enough value, the flashing "LOW BATTERY" warning is displayed on the bottom line of the LCD.

The design of the thermometer is simplified by the fact that the regulated voltage (3.3V) on the Pro Mini is available on one of the board's pins. The on-board regulator can supply up to 150mA of current. The Pro Mini itself uses approximately 3mA while operating; the LCD controller uses approximately 1.2mA and the MAX31856 uses approximately 2mA; thus the total current required for the entire thermometer (not including the LCD backlight) is approximately 6.2mA. As a result, the 3.3V regulator on the Pro Mini can also be used to power the MAX31856 and the LCD. Since the LCD backlight requires approximately 4.2V at 100mA, it is powered directly from the batteries, using a current limiting resistor and controlled by the NPN transistor.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
ADDENDUM: The attached photos show the unit partially assembled. The top photo (without the LCD attached) shows the placement of the MAX31856PMB1 Evaluation Board. The second photo shows the unit with the LCD in place. The top of the case still needs to have holes drilled for the two push buttons and a cut out for the LCD; the top end plate needs to have cut outs made for the thermocouple connector and the power switch. For testing purposes, the unit was being powered by an external power supply instead of batteries.

NOTE: Due to a last minute glitch, I was unable to finish the project. During initial hardware testing I found that there is a problem with adjusting the contrast of the LCD. As a result, the characters are barely visible and are not visible at all in the second photo. I did not have time to trouble shoot this problem before the end of the contest. I intend to find the problem with the display and finish the project, at which time I will upload the code and a video of the working thermometer.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Thermometer without LCD.JPG Thermometer with LCD.JPG

Source Code
In progress.

CAD Files
Not applicable
You need to be logged in to comment