Skip to content

[For Arduino/esp/stm32duino] Library for working with a thermocouple based on the MAX6675 driver.

License

Notifications You must be signed in to change notification settings

konosubakonoakua/MAX6675_Thermocouple

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAX6675 Thermocouple Library

For Arduino boards.

The Library implements a set of methods for working with a thermocouple based on the MAX6675 driver. Provides a temperature reading in Celsius, Fahrenheit and Kelvin. Modified version of the MAX6675-library.

MAX6675 driver measures the output of a K Thermocouple and provides the result to the Arduino via a SPI interface.

Installation

  1. Download the Latest release from gitHub.
  2. Unzip and modify the Folder name to "MAX6675_Thermocouple" (Remove the '-version')
  3. Paste the modified folder on your Library folder (On your libraries folder inside Sketchbooks or Arduino software).
  4. Restart the Arduino IDE.

Circuit Diagram

Circuit Diagram

SO: The module’s serial output. Your Arduino will read this output.

CS: Chip Select. Setting low, selects the Module and tells it to supply an output that is synchronize with a clock.

SCK: The Serial Clock, an input from your Arduino.

VCC: 5V supply

GND: Ground.

Methods

    // Instantiation:
    /**
        SCK_PIN - SCK digital port number.
        CS_PIN - CS digital port number.
        SO_PIN - SO digital port number.
    */
    MAX6675_Thermocouple thermocouple(SCK_PIN, CS_PIN, SO_PIN);

    // or
    /**
    	READINGS_NUMBER - How many readings are taken to determine
        a mean temperature. The more values, the longer a calibration
        is performed, but the readings will be more accurate.
    	DELAY_TIME - Delay time between a temperature readings (ms).
    */
    MAX6675_Thermocouple thermocouple(
        SCK_pin, CS_pin, SO_pin,
        READINGS_NUMBER,
        DELAY_TIME
    );

    // Read a temperature in Celsius.
    double celsius = thermocouple.readCelsius();
    // Read a temperature in Kelvin.
    double Kelvin = thermocouple.readKelvin();
    // Read a temperature in Fahrenheit.
    double fahrenheit = thermocouple.readFahrenheit();
    // For older devices.
    double farenheit = thermocouple.readFarenheit();

    // Sets a new readings number.
    thermocouple.setReadingsNumber(READINGS_NUMBER);
    // Sets a new delay time.
    thermocouple.setDelayTime(DELAY_TIME);

Created by Yurii Salimov.

Modified by Konosubakonoakua.

  • read more quickly
  • use hardware SPI by setting #define USE_HW_SPI 1
  • use freertos delay by setting #define USE_FREERTOS_DELAY 1

About

[For Arduino/esp/stm32duino] Library for working with a thermocouple based on the MAX6675 driver.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 100.0%