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
|
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>
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 |
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
SensorKTY81_1xx::SensorKTY81_1xx | ( | adc1_channel_t | channel, |
EquidistantPWLUInt16< _common_conf.lut_size > * | interpolator | ||
) |
Initialize the analog ADC channel for use with the sensor.
channel | ADC 1 channel number |
interpolator | Ptr. to interpolator, see class EquidistantPWLUInt16. |
float SensorKTY81_1xx::get_temp_lin | ( | ) |
Fairly precise temperature conversion if the temperature sensor voltage has good linearisation. Worst results at temperature extremes.
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.
void SensorKTY81_1xx::update_filter | ( | ) |
Updates the moving average with a new sampled value from ADC.
This must be called periodically.