Skip to content

HardFOC driver

NTC Thermistor Driver

A C++20 driver for NTC thermistors read through an ADC. It turns the voltage of a resistor divider into the thermistor's resistance and the resistance into degrees, with averaging, filtering and calibration, on any MCU with an ADC.

Quickstart API guide Source on GitHub

The driver has no platform code. You give it a small class that brings an ADC up and returns a channel's voltage; it does the rest: the divider equation, the Beta conversion, range checks, averaging, filtering and error codes.

NTC chip thermistor, the driver's default part NTCG163JF103FT1S TDK
Resistance
10 kΩ ± 1 % at 25 °C (R25)
B constant
3435 K ± 1 % (B25/85)
Operating range
−40 °C to +150 °C
Rated power
100 mW at 25 °C, still air
Package
0603 (1.6 mm × 0.8 mm × 0.8 mm)
Interface
Analog: a resistor divider into any ADC input; the driver reads the node voltage

Spec sheet

What you get

  • One object per sensor. NtcThermistor<YourAdc> takes a part type or a full ntc_config_t; several sensors share one ADC. See API guide.
  • Degrees from volts. The divider equation gives the resistance, the Beta equation the temperature, in °C, °F or K. See Conversion methods.
  • Any NTC. Set R25, B and the series resistor for a 10 kΩ, 100 kΩ or other part; the TDK NTCG163JF103FT1S is the default. See Configuration.
  • Clean readings. Multi-sample averaging, an exponential filter, a calibration offset and a valid range, with an NtcError for every failure. See API guide.
  • Zero-overhead portability. The port is a CRTP class with seven small methods: no virtual calls in the ADC path, no heap, no RTOS dependency. See Porting.
  • Tested without hardware. Host unit tests check the conversions against the TDK resistance table. See Testing and CI.

Where to go next

  • Quickstart


    Wire the divider, write the port, read a temperature in about 15 lines.

  • Hardware


    The divider, the series resistor, the ADC, self-heating and the part's limits.

  • Architecture


    The three layers and what each one owns.

  • API guide


    Configure, read, smooth, calibrate and handle errors, task by task.

  • Porting


    Implement the ADC interface for your MCU.

  • API reference


    Every class and member, generated from the headers.