はっくはっくキッチン
Hack Hack Kitchen

MAX31855 Controller using AVR

 2022/01/29

max31855-banner.jpg

If you want to measure a temperature (especially the surface temperature of some object), you can use, for example, a thermocouple integrated in a digital multimeter (DMM), but the major disadvantage is that you cannot use the DMM to measure voltage or current.

To use the DMM for other purposes but still measure the surface temperature, I built a thermometer with the MAX31855 board.

MAX31855 Controller board
MAX31855 Controller board
MAX31855 Controller board
MAX31855 Controller board

In the photograph above, the thermocouple is connected via crocodile clips, but the thermocouple should be connected directly to the terminal. The small white board is a DC-DC boost module (5 V). The AVR is located under the 7-segment LED board. SMD components for transistors, resistors etc. are used to make these thermometers. (They are not visible in this photograph because they are on the back of the board).

Schematic

./max31855ctrl-sch-thumb.png
Schematic of AD9833 Controller (click to enlarge)

How to compile

The use of seven-segment displays, USART output and temperature compensation can each be enabled or disabled. By default they are all enabled. Comment out the appropriate lines in Makefile.settings, if you don't need them.

See Correcting Temperature Data of MAX31855 for more details on temperature compensation.

The pins of AVR connected to the MAX31855 board can be changed in max31855-config.h.

The pins of AVR for connection to the 7-segment board are fixed. It is possible to use other pins by changing the source code, but the current implementation makes the following assumptions, so using other pins would require a major change to the source code.

  • 8 pins of one port type (e.g. PB0 to PB7 or PC0 to PC7 ) are used for switching the segments on and off, and

  • 0- to 3-pins of a port type (e.g. PC0 to PC3) for digit selection.

This program uses my pAVRlib and Library for Thermocouple based on NIST ITS-90 Database. Since they are git submodules, you can either clone them with --recursive as shown below, or do a normal git clone and then git submodule update -i.

Here are the concrete steps:

If you do not use temperature compensation, you can also build it with avra. In this case, instead of make above, do the followings.

make -f Makefile.avra
make flash

(You can run make flash with or without -f Makefile.avra).

How to use

If you compile the program with USE_USART (default), you will get detailed information through the serial port.

If an error occurs, the following error code is displayed:

0

An out-of-range value was specified for the temperature compensation, resulting in a NAN (not a number).

1–7

Corresponds to the 3 LSB bits of the MAX31855:

D2

SCV Fault (the thermocouple is short-circuited to V$_\text{CC}$)

D1

SCG Fault (the thermocouple is short-circuited to GND)

D0

OC Fault (the thermocouple is open (no connections))

License

  • MIT License