Hi All. fairly new to the ESPHome world and am trying to understand how to get a capacitive soil monitor working (or just as importantly what the numbers that it outputs mean because it seems to be the reverse of what I was expecting. Eventually this will feed into Homeassistant but that is a later step in the process.
I have an espwroom-32 with one of these detectors connected. I have the following connections:
GND is connected to GND on the ESP32
VCC is connected to VN on the ESP32
AOUT is connected to D35 on the ESP32
My YAML will follow.
I am testing this but firstly leaving this on my work bench out of water and then putting it into a glass of water (water level below the white line on the sensor)
So this is my YAML - I have define the pin as GPIO35 - should it be A0 (or something like that?)
esp32:
board: esp32dev
framework:
type: arduino
time:
- platform: homeassistant
id: esptime
Enable logging
logger:
Enable Home Assistant API
api:
ota:
sensor:
-
platform: adc
pin: GPIO35
name: esp_32_01_soil_01
update_interval: 1s
attenuation: 11db
id: esp_32_01_soil_01
unit_of_measurement: “%”
filters:- median:
window_size: 7
send_every: 4
accuracy_decimals: 0
- median:
And these are the readings…started with dry but you can see where I dipped it in the glass of water. Should the dry ones be higher than the wet ones?
[13:04:30][D][api:102]: Accepted ::FFFF:C0A8:89
[13:04:30][D][api.connection:861]: Home Assistant 2022.7.5 (::FFFF:C0A8:89): Connected successfully
[13:04:30][D][time:042]: Synchronized time: 2022-07-31 13:04:30
[13:04:31][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 2.05900 % with 0 decimals of accuracy
[13:04:35][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 2.05900 % with 0 decimals of accuracy
[13:04:39][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 2.06200 % with 0 decimals of accuracy
[13:04:43][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 2.05900 % with 0 decimals of accuracy
[13:04:47][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 2.06000 % with 0 decimals of accuracy
[13:04:51][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 2.06200 % with 0 decimals of accuracy
[13:04:55][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 0.85200 % with 0 decimals of accuracy
[13:04:59][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 0.84700 % with 0 decimals of accuracy
[13:05:03][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 0.85000 % with 0 decimals of accuracy
[13:05:07][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 0.84700 % with 0 decimals of accuracy
[13:05:11][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 0.84700 % with 0 decimals of accuracy
[13:05:15][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 0.85100 % with 0 decimals of accuracy
[13:05:19][D][sensor:125]: ‘esp_32_01_soil_01’: Sending state 0.85300 % with 0 decimals of accuracy
Thanks for reading everyone.