ESP-LiveControl  1.99.1
HTTP server, AJAX API backend and Vue.js web application implementing self-contained, zero-install WiFi remote control of hardware modules attached to the Espressif ESP32 SoC
Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
SensorKTY81_1xx Class Reference

KTY81-1xx type silicon temperature sensor readout and conversion functions using the ESP32 ADC in its high-linearity region. More...

#include <sensor_kty81_1xx.hpp>

Inheritance diagram for SensorKTY81_1xx:
Inheritance graph
[legend]
Collaboration diagram for SensorKTY81_1xx:
Collaboration graph
[legend]

Public Member Functions

 SensorKTY81_1xx (adc1_channel_t channel, EquidistantPWLUInt16< _common_conf.lut_size > *interpolator)
 Initialize the analog ADC channel for use with the sensor. More...
 
void update_filter ()
 Updates the moving average with a new sampled value from ADC. More...
 
float get_temp_pwl ()
 Excellent precision temperature sensing using piecewise linear interpolation of Look-Up-Table values for a KTY81-121 type sensor. Use this if temperatures above 100°C ore below 0°C are to be measured. More...
 
float get_temp_lin ()
 Fairly precise temperature conversion if the temperature sensor voltage has good linearisation. Worst results at temperature extremes. More...
 

Public Attributes

ESP32ADCChannelFiltered< _common_conf.moving_average_filter_len > adc_ch
 

Static Public Attributes

static constexpr auto _common_conf = KTY81_1xxCommonConfig{}
 

Protected Attributes

EquidistantPWLUInt16< _common_conf.lut_size > * _interpolator
 

Detailed Description

KTY81-1xx type silicon temperature sensor readout and conversion functions using the ESP32 ADC in its high-linearity region.

Sensor connected between GND and ADC input and biased using a 2.2 kOhms series-resistor connected to 3.3V supply.

  +-----------------------+
  |                       |
 +++                      |VREF
 | |r_pullup              |(3V3)
 | |(2k2)             +----------+
 +++                  |          |
  |                   |          |
  +-------------+-----+ AIN      |
  |             |     |          |
 +++            |     +---+------+
 | |KTY81-    +---+       | AGND
 | | 1xx      +---+       |
 +++            |100nF    |
  |             |         |
  +-------------+---------+

Currently not implemented but useful addition would be ratiometric measurement by additionally sampling the 3.3V reference/supply.

Sensor readout with piecewise linear interpolation of LUT calibration values or linear calculation as an option for lower precision applications

Constructor & Destructor Documentation

◆ SensorKTY81_1xx()

SensorKTY81_1xx::SensorKTY81_1xx ( adc1_channel_t  channel,
EquidistantPWLUInt16< _common_conf.lut_size > *  interpolator 
)

Initialize the analog ADC channel for use with the sensor.

Parameters
channelADC 1 channel number
interpolatorPtr. to interpolator, see class EquidistantPWLUInt16.
Note
See derived classes SensorKTY81_121 and SensorKTY81_110_120.
Here is the call graph for this function:

Member Function Documentation

◆ get_temp_lin()

float SensorKTY81_1xx::get_temp_lin ( )

Fairly precise temperature conversion if the temperature sensor voltage has good linearisation. Worst results at temperature extremes.

Returns
Temperature in °C
Note
This only reports the current state of the internal filter. You must call update_filter() periodicly to read new physical data!
Here is the call graph for this function:

◆ get_temp_pwl()

float SensorKTY81_1xx::get_temp_pwl ( )

Excellent precision temperature sensing using piecewise linear interpolation of Look-Up-Table values for a KTY81-121 type sensor. Use this if temperatures above 100°C ore below 0°C are to be measured.

Returns
Temperature in °C
Note
This only reports the current state of the internal filter. You must call update_filter() periodicly to read new physical data!
Here is the call graph for this function:

◆ update_filter()

void SensorKTY81_1xx::update_filter ( )

Updates the moving average with a new sampled value from ADC.

This must be called periodically.

Here is the call graph for this function:

The documentation for this class was generated from the following files: