I’m trying to connect a capacitive Soil moisture sensor to a ESP32 DEV4 board. If I configure a GPIO for ADC there is a voltage of arround 3,7 volt on the port. The sensor is not able to “lower” this. If I disconnect the sensor it gives a normal readout. I’ve done thsi before, but not on a DEV4.
Is there something I didn’t know?
esphome:
name: beluchting
friendly_name: Beluchting
esp32:
board: az-delivery-devkit-v4
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "xx"
ota:
password: "xxx"
wifi:
networks:
- ssid: "Nr20_300n"
password: "xxxxxxxxx"
- ssid: "Nr20_300n1"
password: "xxxxxxxxx"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Beluchting Fallback Hotspot"
password: "01071958"
captive_portal:
sensor:
- platform: dht
model: dht11
pin: GPIO32
temperature:
name: "Temperatuur Kasje"
humidity:
name: "Vochtigheid Kasje"
update_interval: 5s
#Soil moisture sensor
- platform: adc
pin: GPIO35
name: ${Buiten} Soil Moisture Kasje
id: soil_moisture
accuracy_decimals: 1
update_interval: 5s
icon: mdi:flower
unit_of_measurement: '%'
attenuation: 0db
filters:
- lambda: |-
if (x > 2.4) { // if over 2.4 volts, we are dry
return 0;
} else if (x < 1.0) { // if under 0.264 volts, we are fully saturated
return 100;
} else {
return (2.4-x) / (2.4-1.0) * 100.0; // use a linear fit for any values in between
}
switch:
- platform: gpio
name: "Ramen Op"
pin: GPIO26
inverted: "no"
- platform: gpio
name: "Ramen Neer"
pin: GPIO27
inverted: "no"