Soil Moisture Sensor with Battery
Print Profile(1)

Description
A simple Soil Moisture sensor. This casing can hold either a Wemos D1 mini or a ESP32 C3/S3 mini boards. I used home assistant and ESPHome Builder to install and configure the microcontroller, however you can use micro python or Arduino IDE, your choice.
ESPHome Code:
```
sensor:
- platform: adc
pin: A0 #Replace this with your GPIO pin
name: "Soil Moisture Sensor 1"
unit_of_measurement: "%"
icon: "mdi:water-percent"
accuracy_decimals: 1
update_interval: 3s
filters:
- calibrate_linear:
#Replace the values below with the ones you found.
# The first number is your DRY voltage, which maps to 0% moisture.
- 0.50 -> 0.0
# The second number is your WET voltage, which maps to 100% moisture.
- 0.26 -> 100.0
# The clamp filter ensures the output never goes below 0% or above 100%.
- clamp:
min_value: 0.0
max_value: 100.0
# The median filter helps smooth out noisy readings.
- median:
window_size: 5
send_every: 3
send_first_at: 1
# ==========================================================
deep_sleep:
run_duration: 120s
sleep_duration: 15min
```










Comment & Rating (0)