Thermistor
Much like the original PCB, eNSPanel uses an NTC thermistor to measure ambient temperature.
The thermistor is connected to the ESP32 via a voltage divider. The voltage divider is made up of a 20k resistor and the thermistor. The voltage divider is connected to the ESP32's ADC pin.
The thermistor is a normal 10k NTC thermistor with a B value of 3950. There is another 10k resistor in series with the thermistor to protect the ESP32's ADC pin.
GPIO
The thermistor is connected to the ESP32 via IO9 which is ADC1 in the selected ESP32 module.
Configuration
The most up-to-date configuration is in the esphome folder. This is a known to be working minimal configuration for the thermistor:
sensor:
# Internal temperature sensor, adc value
- platform: adc
id: ntc_source
pin: 9
attenuation: auto
# Internal temperature sensor, adc reading converted to resistance (calculation)
- platform: resistance
id: resistance_sensor
sensor: ntc_source
configuration: UPSTREAM
resistor: 10kOhm
# Internal temperature sensor, resistance to temperature (calculation)
- platform: ntc
id: temperature
sensor: resistance_sensor
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 10kOhm
name: Temperature
switch:
- platform: gpio
pin: 3
id: ntc_vcc
interval:
- interval: 10s
then:
- switch.turn_on: ntc_vcc
- delay: 100ms
- component.update: ntc_source
- switch.turn_off: ntc_vcc
Also the ESPHome platform provides a climate component that can be used to control a heater or a cooler. The climate component can be used to control a relay that turns on a heater or a cooler. Check the relays documentation for more info.