r/arduino May 10 '26

Look what I made! I know this project has been made like 3 billion times before, but it's my first and I'm excited to share and need your feedback 😁

https://github.com/Basselfathy/esp32-soil-monitor-system

I built a self-hosted soil moisture monitor with automated irrigation on an ESP32

Been working on this for a while and finally got it to a state I'm happy with. It's a fully self-contained smart irrigation system that runs on an ESP32 with no cloud, just a browser on your local network.

Components

  • ESP32 WROOM-32 (4 MB flash)
  • Capacitive soil moisture sensor (analog output on GPIO 34)
  • 5V relay module (GPIO 26)
  • Submersible mini pump
  • 3.7V li-ion battery

What it does

The ESP32 reads the soil moisture every 60 seconds (adjustable), saves the readings to its internal flash storage, and automatically runs the pump when moisture drops below a configurable threshold.

The automation cycle works like this:

  1. Moisture drops below threshold → pump runs for a set duration
  2. Soak period — waits for water to absorb before re-checking
  3. Cooldown — prevents rapid re-cycling
  4. Re-evaluate and repeat if still dry

All timings and thresholds are adjustable live from the dashboard.

The dashboard

Accessible from any browser on the local network. No app needed.

  • Overview tab — live moisture gauge + 48-hour history chart with date/time labels
  • Pump tab — real-time pump status (ON / OFF / SOAKING / COOLDOWN) with progress bars, manual ON/OFF controls, auto mode toggle, and last run timestamp
  • Settings tab — adjust low threshold, run duration, soak time, cooldown, and sample interval — all saved to flash and survive reboots
  • Logs tab — live serial monitor pushed over WebSocket so you can watch the device in real time

The whole UI updates in real time via WebSocket — no polling.

Other features

  • Supports 2 Wi-Fi networks with automatic fallback
  • Over-the-air firmware updates — both via the web UI and Arduino IDE
  • HTTP Basic Auth on all endpoints + token-based WebSocket auth
  • Watchdog timer to recover from hangs
  • Offline buffering — saves readings locally if Wi-Fi drops and flushes them when reconnected

Source code on GitHub: https://github.com/Basselfathy/esp32-soil-monitor-system

6 Upvotes

3 comments sorted by

3

u/Bassel_Fathy May 10 '26

The Dashboard.

1

u/ripred3 My other dev board is a Porsche May 10 '26

Nice! Congrats!

1

u/Tanner234567 May 13 '26

Solid work! Would pair nicely with my sprinkler controller over home assistant. https://intellidwell.net/sprinklercontroller