Skip to content

Instantly share code, notes, and snippets.

@wujku
Created October 6, 2021 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wujku/1fecfcfde1494db23956cfb5dcdbe54f to your computer and use it in GitHub Desktop.
Save wujku/1fecfcfde1494db23956cfb5dcdbe54f to your computer and use it in GitHub Desktop.
ESPHome example with ADC
esphome:
name: data-collector
platform: ESP32
board: esp-wrover-kit
# Enable logging
logger:
# Enable Home Assistant API
api:
password: ""
ota:
password: ""
wifi:
ssid: "nazwa_wifi"
password: "password"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Data-Collector Fallback Hotspot"
password: "ANr43OCW76OQ"
captive_portal:
sensor:
# DHT22
- platform: dht
pin: GPIO14
model: DHT22
temperature:
name: "Bedroom Temperature"
humidity:
name: "Bedroom Humidity"
update_interval: 30s
# Odczyt z ADC0
- platform: adc
id: source_sensor_0
name: ADC0 Value
pin: GPIO36
filters:
# - offset: -0.042
- multiply: 3.3
- median:
window_size: 8
send_every: 2
send_first_at: 2
update_interval: 30s
# Odczyt z ADC1
- platform: adc
id: source_sensor_1
name: ADC1 Value
pin: GPIO34
filters:
# - offset: -0.042
- multiply: 3.3
- median:
window_size: 8
send_every: 2
send_first_at: 2
update_interval: 30s
# Sensor rezystancji, bazuje na source_sensor_0
- platform: resistance
id: resistance_sensor_0
sensor: source_sensor_0
configuration: UPSTREAM
resistor: 11kOhm
# reference_voltage: 3.3V
name: Resistance Sensor 0
# Sensor rezystancji, bazuje na source_sensor_1
- platform: resistance
id: resistance_sensor_1
sensor: source_sensor_1
configuration: UPSTREAM
resistor: 11kOhm
# reference_voltage: 3.3V
name: Resistance Sensor 1
# Termistor z danymi do kalibracji, korzysta z resistance_sensor_0
- platform: ntc
sensor: resistance_sensor_0
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 10kOhm
name: NTC Temperature 0
# Termistor z danymi do kalibracji, korzysta z resistance_sensor_1
- platform: ntc
sensor: resistance_sensor_1
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 10kOhm
name: NTC Temperature 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment