This page provides details that are specific to the supported Max31855, Max6675 and DS705 chips.
Max31855
The Max31855 is a cold-junction compensated thermocouple-to-digital converter that support a wide range of thermocouple types, and provides temperature readings over wide ranges (up to -270 to 1800 degrees Celsius). It has a resolution of 0.25 degrees, an accuracy of +/- 2 degrees, and can also provide information relating to the internal state/temperature of the device (the cold junction) as well as details concerning fault conditions.
It’s important to note that the device is 3.3V, so you’ll either want to power your whole circuit at 3.3V or use voltage regulation and level shifting on the SPI lines.
The standard constructor for these devices is called with:
MaxThermo::Max31855(nSelectPin, clockPin, soPin [, quickReads [ autoInitSPI ]])
Where the parameters are:
- nSelectPin: the uC pin tied to the device ~CS (active-low chip select, pin 6)
- clockPin: the uC pin tied to the Max6675 SCK pin (pin 5)
- soPin: the uC pin used to transfer data in (miso), connected to device SO (pin 7)
- quickReads: optional boolean to turn on quick reads (in which case each reading will require the transfer of only 2 bytes, over SPI, rather than the standard 4 which include the device internal data). Default to false (off/full reads)
- autoInitSPI: optional bool to automatically initialize SPI on begin() (defaults to true)
Max6675
The Max6675 is a cold-junction-compensated k-type thermocouple-to-digital converter, that provides temperature values between 0 and 1024 degrees C, with a resolution of 0.25 degrees.
It is not recommended for new designs, but is supported by MaxThermo because it is in wide circulation and can operate between 3 and 5.5V making integration with many microcontrollers (like Arduino) very easy.
The standard constructor for these devices is, like for the Max31855, called with:
MaxThermo::Max6675(nSelectPin, clockPin, soPin [, quickReads [ autoInitSPI ]])
Where the parameters are:
- nSelectPin: the uC pin tied to the device ~CS (active-low chip select, pin 6)
- clockPin: the uC pin tied to the Max6675 SCK pin (pin 5)
- soPin: the uC pin used to transfer data in (miso), connected to device SO (pin 7)
- quickReads: optional boolean to turn on quick reads (meaningless for Max6675)
- autoInitSPI: optional bool to automatically initialize SPI on begin() (defaults to true)
If you disable auto-init for SPI, you need to ensure everything is properly setup before calling begin() and using the MaxThermo object for reads.
The MaxThermo::Max6675 instance will return 0/false for all the internalTemp*() methods, as this information is not provided by the Max6675.
The MaxThermo::Max6675::Sample objects used with logging functions always return NULL for their internal() data.
DS7505
The DS7505 is a digital thermometer and thermostat. It has a smaller range than the thermocouple-to-digital devices (-55.0 – 125.0 degrees C) but it has better accuracy (0.5 degrees between 0 and 70) and doesn’t require a thermocouple. Its resolution is configurable, between 9 and 12 bits inclusively. Like the Max31855, it is a low-powered device which only accepts a supply voltage of up to 3.7V–so you’ll need to use a unified 3.3V supply for your project or use volgate regulation/level shifting.
Unlike the other supported devices, communication with the DS7505 happens over I2C (rather than SPI). This means you can network up to 8 devices on the same bus (each has a unique address assigned using the three address pins) but the downside is you need to include TwoWire support, which increases the library’s footprint.
To enable I2C support, you must:
Edit the library includes/ThermoLibConfig.h
and uncomment the flag indicating you want I2C support:
#define MAXTHERMOLIB_ENABLE_I2C_SUPPORT
Include the Wire.h header in your program, prior to the MaxThermo.h include:
// TwoWire support #include <Wire.h> // Include MaxThermo #include <MaxThermo.h>
The DS7505 example demonstrates this and the other DS7505-specific functionality.
The constructor for the MaxThermo::DS7505 is a little different than for the other supported devices as you must specify the address of the device you wish to exchange with.
// Address bits MaxThermo::DS7505(address2, address1, address0 [, resolution]);
Where the parameters are:
address[2-0]: whether each of the address pins is 1 (VCC) or 0 (tied to ground)
resolution: optional resolution setting, one of the MaxThermo:DS7505::Resolution values (defaults to MaxThermo:DS7505::Resolution_10bits)
The other constructor simply combines the address bits into a single corresponding value (between 0-7)
// address as single param MaxThermo::DS7505(address [, resolution]);
and the optional resolution parameter is as for the constructor above.
Because the DS7505 is a thermostat, rather than simply a thermometer, it supports a few additional functions.
setThermostat(temperature, hysteresis)
Use setThermostat to specify the desired temperature and hysteresis. Both must be within the device’s usable range (-55 to 125) and hysteresis (the value at which the thermostat switches back on) must be below the target temperature.
setTOSTrigger(fault_tolerance)
The thermostat will trip the O.S. pin when required, after a certain number of detected faults. This value is configurable using the setTOSTrigger() method. The fault_tolerance parameter must be a MaxThermo::DS7505::FaultTolerance value, one of:
TOS_1_Fault // trip immediately TOS_2_Faults // after two faults TOS_4_Faults // after four TOS_6_Faults // after six
See the datasheet for more details on the DS7505 functionality in this regard.