In this example we take a look at the MAX6675 Cold-Junction-Compensated K-Thermocouple-to-Digital Converter
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.
Key Features
Cold-Junction Compensation
Simple SPI-Compatible Serial Interface
12-Bit, 0.25°C Resolution
Open Thermocouple Detection
Usually you use these in a breakout/module form and can also purchase a kit which includes a thermocouple. Here is a picture of the module that I purchased
Here are the connections , sometimes these are named differently on the modules, in particular the CS connection
Vcc connected to 3.3v
Gnd connected to Gnd
SO connected to Pin 6
SS/CS connected to Pin 7
CSK connected to Pin 8
Code
You will need the MAX6675 library – https://github.com/adafruit/MAX6675-library
[codesyntax lang=”cpp”]
#include "Max6675.h" Max6675 ts(D6, D7, D8); // Max6675 module: SO on pin D6, SS on pin D7, CSK on pin D8 of Wemos Mini void setup() { ts.setOffset(0); // set offset for temperature measurement. Serial.begin(9600); } void loop() { Serial.print(ts.getCelsius(), 2); Serial.print(" C / "); Serial.print(ts.getFahrenheit(), 2); Serial.print(" F / "); Serial.print(ts.getKelvin(), 2); Serial.print(" Kn"); Serial.println(); delay(2000); }
[/codesyntax]
Results
Open the serial monitor window and you should see something like this
24.00 C / 75.20 F / 259.15 Kn
24.00 C / 75.20 F / 259.15 Kn
25.50 C / 77.90 F / 260.65 Kn
26.75 C / 80.15 F / 261.90 Kn
27.50 C / 81.50 F / 262.65 Kn
27.25 C / 81.05 F / 262.40 Kn
Links
You can pick up the module and a thermocouple for about $4
MAX6675 Module + K Type Thermocouple Thermocouple Sensor
just what I needed, thanks!
C:\Users\Tslod\Documents\Arduino\libraries\MAX6675-library-master\max6675.cpp:9:24: fatal error: util/delay.h: No such file or directory
#include
^
compilation terminated.
exit status 1
Błąd kompilacji dla płytki WeMos D1 R1.
Can you help me?
Found an answer in the adafruit library issue tracker on github
https://github.com/adafruit/MAX6675-library/issues/9#issuecomment-168213845