The MAX31855K Thermocouple Driver is a 14-bit resolution, SPI-compatible, serial interface thermocouple board that makes reading a wide range of temperatures, using a K-type thermocouple typically -200 °C to 1000 °C, relatively simple. A thermocouple works by taking two wires made of dissimilar metal alloy, connecting them at the two ends, and making a temperature gradient between one end and the other (a ‘hot’ end and a ‘cold’ one). Once this is achieved, a voltage potential is formed due to the Seebeck Effect and current flows. The MAX31855 amplifies, digitises and converts this signal and outputs the temperature as a binary data stream via a SPI interface. Details about the necessary circuit connections and coding in regards interfacing to a Microchip PIC18F248 are given below.
The Microchip PIC18F248, although now an 'old' Part, is mainly used as I have these readily available, but these chips are advantageous in terms of small physical size, low cost per GPIO/onboard peripheral provided and still easily available in DIP form (which is generally easier for the DIY PCB). This is particularly good for 'small' DIY projects controlling a single sensor and or output for example, such as temperature monitoring for kilns, furnaces, ovens and other such 'high' temperature applications. The PIC18F248, or similar parts such as the PIC18F452 etc, are still economically available from ebay and/or other more reputable suppliers. So, the demonstration code and circuity below is generally applicable.
First some background about thermocouples (specifically related to use with the MAX31855) and then some specifics about the MAX31855.
As mentioned, thermocouples operate due to two wires of different metal compositions connected at the two ends, with the two ends being placed in differing temperature environments, which generates a voltage potential and current flow (Seebeck Effect). This means that thermocouples are classified by type of metals used, with the most common being type K made from chromel and alumel. These two alloys produce a potential of approximately 41.276 µV/°C. The MAX31855 uses this known potential difference to calculate the temperature. Therefore, it is important that the MAX31855 variant used is the "K" version, to match the type of thermocouple used, otherwise the reported temperature will be incorrect.
Further, thermocouples can be either 'grounded' or 'ungrounded' in construction. When a thermocouple is ungrounded, the junction is detached from the sensor hull and electrically isolated. The detached junction results in slower response times compared to grounded probes. The electrically isolated junction prevents the signal from being interrupted by electrical noise. Thus the accuracy of the temperature measurement is much higher. A grounded thermocouple is a thermocouple where the junction is welded directly to the inside of the hull at the tip of the sensor which results an effective heat transfer thus faster response times. However, grounded thermocouples are prone to induce noise from ground loops which results in a less accurate reading.
The MAX31855 only works with ungrounded thermocouple probes.
MAX31855 Thermocouple Driver
The datasheet (see Bill of Materials Section) gives the full list of the necessary details and specifications.
In brief, the MAX31855 is a thermocouple-to-digital converter with a built-in 14-bit analog-to-digital converter (ADC). The device also contains cold-junction compensation sensing and correction, a digital controller, with an SPI-compatible interface. The device is designed to work in conjunction with an external microcontroller. The MAX31855 is available in several versions, each optimized and trimmed for a specific thermocouple type (K, J, N, T, S, R, or E.). The thermocouple type is indicated in the suffix of the part number (e.g., MAX31855K).
For a K-type thermocouple, the voltage changes by about 41.276 µV/°C, the MAX31855 assumes a linear relationship between temperature and voltage. Because all thermocouples exhibit some level of nonlinearity, you may need to apply appropriate correction to the device’s output data.
The MAX31855 resolves temperatures to 0.25°C, allows readings as high as +1800°C and as low as -270°C (dependant upon thermocouple in use), and exhibits thermocouple accuracy of ±2°C for temperatures ranging from -200°C to +700°C for K-type thermocouples.
Code Library
The MAX31855 provides the temperature output in the form or a signed 14-bit, SPI-compatible, read-only format. This means the necessary microcontroller code is relatively simple, basically just being the SPI connection to capture the output data, which is 32bits. Then from this 32 bits, strip the 14-bit thermocouple temperature data, the 12-bit internal temperature, and 4-bits of error code.
The CCS C-Compiler is used for generating the Microchip Hex files, and a code library using hardware-SPI and another version using 'bit-banging' is provided below. The 'bit-banging' version enables using alterative I/O pins rather than those multiplexed for hardware SPI (typically the SPI pins are also utilised for I2C connectivity). This enables using Parts such as the PCF8574 port expander which needs I2C connections (e.g., to interface a LCD and or keypad) while still interfacing with the MAX31855.
The code, and particularly the SPI communications and retrieval of the bit data corresponding to the measured temperature, is described more fully in the Testing and Experimental Results Section below.
Only Logged-In Members can add comments