|
MAX6675_RK
|
MAX6675 SPI thermocouple library for Particle devices
You will typically allocate one of these objects as a global variable.
You can configure more than one sensor by creating multiple objects. Each sensor must have its own CS line. See example 2-multiple.
Use the readValue() method to read the value in degrees Celsius:
I purchased this set of inexpensive MAX6675 with thermocouples from Amazon. There are many similar boards available on Amazon, eBay, and AliExpress.
| Pin | Description | Connects To | Picture |
|---|---|---|---|
| GND | Ground | GND | Gray to GND |
| VCC | 3.0 to 5V | 3V3 | Purple to 3V3 |
| SCK | SCK | SCK | Blue to SCK |
| CS | Chip Select | Available GPIO | Green to S3 |
| SO | Data Out | MISO | Yellow to MISO |
The CS pin can be connected to any available GPIO. There is a default CS pin named SS that varies depending on the device, but you don't have to specifically use that pin.
The color doesn't matter, and that is not the same Dupont wire that came with the thermocouple adapter as I wanted male-to-female instead of female-to-female. The colors are only listed to clarify the picture.
The connections on this adapter board:
The sample code in examples/1-Simple can be used to test the firmware side.
The output should look like this:
If you disconnect the T+ or T- thermocouple connection, you should see something like:
If you disconnect the SPI interface, you will typically get a value of 0.
From the datasheet:
Cold-Junction-Compensated K-Thermocouple-to-Digital Converter (0°C to +1024°C)
The MAX6675 performs cold-junction compensation and digitizes the signal from a type-K thermocouple. The data is output in a 12-bit resolution, SPI-compatible, read-only format.
This converter resolves temperatures to 0.25°C, allows readings as high as +1024°C, and exhibits thermocouple accuracy of 8 LSBs for temperatures ranging from 0°C to +700°C.
The MAX6675 is available in a small, 8-pin SO package.
Additionally: