Using thermocouples with the Duet and RepRapFirmware

From RepRap
Revision as of 14:15, 1 February 2016 by Dc42 (talk | contribs) (Wiring)
Jump to: navigation, search

This page describes the support for thermocouple temperature sensors in RepRapFirmware version 1.09r-dc42 and later with Duet electronics.


To connect a thermocouple to the Duet, you will need a thermocouple interface board based on the MAX31855 chip. The Duet uses 3.3V signalling, so get a board without 5V level shifters. These boards are readily available on eBay at low prices. You will need one MAX31855 for each thermocouple you want to connect. You can buy boards with two MAX31855 chips, providing two channels.

Make sure that the board has a capacitor connected across the thermocouple terminals. This is normally a ceramic chip capacitor placed between the MAX31855 and the terminal block for the thermocouple. If your board has only the MAX31855 chip and one capacitor on board, that capacitor is the supply decoupling capacitor and you will need to add the other one. A 10nF ceramic disc capacitor is suitable. It can be soldered on the underside of the pins of the terminal block used to connect the thermocouple.

The MAX31855 chip is available in variants for different types of thermocouple. The most common variant is the MAX31855K. Assuming that is what you have, buy K-type thermocouples.

The thermocouple must be electrically isolated from the hot end heater block. If the thermocouple has a bare junction, you will need to insulate it, for example with high-temperature sleeving.

Connect the thermocouple leads to the terminal block on the MAX31855 board. Do not extend the thermocouple leads, because that will move the cold junction away from the MAX31855 chip, which will prevent the chip from performing accurate cold junction compensation.


The MAX31855 boards are connected to the Duet as follows:

MAX31855 signal name Duet signal name DuetExpansion connector pin DueX4 expansion connector pin
Vcc +3.3V 3 25
Gnd GND 2 21
SO MISO0 30 26
CS (see below) NPCS0,NPCS1,TXD1,RXD1 27,16,11,12 20,11,6,7
SCK SPCK0 28 24

Connect the CS pin to one of the pins listed above, a different one for each MAX31855 board. The pins listed are for temperature sensor channels 100, 101, 102 and 103 respectively. If you have Roland mill support enabled in the firmware, only two channels (100 and 101) are available because the mill uses the other two pins.

To tell the firmware to use a thermocouple channel for one of the heaters, use the X parameter in the M305 command for that heater. For example, M305 P1 X100 tells the firmware that for heater 1 (which is normally the first hot end heater) it should sense the temperature using the thermocouple board whose CS pin is connected to NPCS0.


If you have difficulty getting correct readings from the thermocouple board, try connecting a wire link between the two terminals of the terminal block instead of a thermocouple. This should produce a room temperature reading.

If the temperature readout decreases when you heat the thermistor instead of increasing, swap over the thermocouple wires in the terminal block.

If you get wildly inaccurate or fluctuating readings, check that the thermocouple wires are securely connected in the terminal block, and that there is a 10nF capacitor in parallel with the terminals.