This module was originally created by DCZYewen: [Github](https://github.com/dczyewen). A K-type
thermocouple

is a sensor that generates an electromotive force (EMF) on two specially designed metal electrodes when the temperature changes.
However, because the generated voltage is extremely small, only about 5mV at 100 degrees Celsius, it is difficult to directly sample using an ADC. Furthermore, due to the weak signal, it is easily affected by various crosstalk interferences.
A common K-type thermocouple often has a wire of a certain length. This wire can act as an antenna in complex electromagnetic environments, picking up electromagnetic waves and causing interference. Simultaneously, the resistance of the wire can cause voltage shunting at the junction. Also, if the cold junction of the thermocouple is not at the ideal 0 degrees Celsius, the thermocouple voltage may deviate, requiring calibration to obtain accurate temperature readings. Finally, this module uses active components; even a slight ripple in the power supply can be unacceptable interference for small signals.
This module's circuit design references the Analog Devices AD8495 K-type thermocouple precision amplifier example. Cold junction voltage compensation was implemented, an RLC filter was designed to remove potential AC signals, and tantalum capacitors and MLCCs were used at the power supply to filter out power supply interference. The MAX31855 device used in this module, manufactured by Maxim Integrated (now a subsidiary of Analog Devices), precisely amplifies the voltage generated by the K-type thermocouple before feeding it into the ADC for sampling. This chip also integrates fault detection functions, such as short-circuit detection. The board uses an AMS1117-3.3 to support 5V input; this can be omitted if your system does not require a 5V input.
The example program is written using the Arduino framework, and the running effect is shown in the figure. Since I am using an STM32duino, this was implemented on an STM32F103C8 minimum system. Implementation may differ slightly if using an AVR or ESP series MCU, which will not be demonstrated here.