/NTC_Thermistor

[For Arduino and STM32] Library for working with a NTC thermistor.

Primary LanguageC++

NTC Thermistor Library

For Arduino ant STM32 boards.

The Library implements a set of methods for working with a NTC thermistor. Provides a temperature reading in Celsius, Fahrenheit and Kelvin.

Installation

  1. Download the Latest release from gitHub.
  2. Unzip and modify the Folder name to "NTC_Thermistor" (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

!!! Помилка!!! R0 на 3,3 вольта, а не на 5 !!!

Connect to the analog side of an Arduino Uno. Run GND through the thermistor, then a pull-down resistor (R0), and into 3.3V. To measure the temperature pull a line off the junction of the thermistor and the resistor, and into an analog pin (A1 here).

Diagram

Methods

    // Instantiation:
    /**
        pin - an analog port number to be attached to the thermistor.
        R0 - reference resistance.
        Rn - nominal resistance.
        Tn - nominal temperature in Celsius.
        B - b-value of a thermistor.
    */
    NTC_Thermistor thermistor(pin, R0, Rn, Tn, B);

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