An ESP32 device that measures soil moisture and earth resistance, waters the ground automatically, and streams live readings to a secure web dashboard with remote pump control.

[ Role ]

Hardware, firmware & web engineer

[ Categories ]
  • IoT & Hardware
[ Stack ]
  • ESP32 (Arduino C++)
  • Firebase Realtime Database
  • Firebase Authentication
  • Firebase Hosting
  • Chart.js
  • HTML, CSS, JavaScript
  • GitHub Actions
  • Relay + DC pump hardware

Earthing rods work best in moist soil, and dry ground pushes earth resistance up. I built a low-cost device that watches the soil and waters it only when needed. An ESP32 reads a moisture probe and measures real earth resistance in ohms with a two-rod voltage divider, flipping probe polarity each cycle to slow corrosion. A 40 to 60 percent hysteresis band drives a relay and pump without chatter. Readings flow through Firebase Realtime Database to a Chart.js dashboard deployed by GitHub Actions.

  1. 01Real earth resistance in ohms. Two metal rods and a 1 kΩ reference resistor form a voltage divider, and the ESP32 turns the ADC reading into ohms.
  2. 02Corrosion-aware sensing. The rods are driven in alternating polarity on every reading, which slows electrolysis and keeps the probes usable for longer.
  3. 03Pump control that does not chatter. A 40 to 60 percent hysteresis band and averaged ADC samples keep the relay steady even with noisy sensor data.
  4. 04Remote override from any browser. Firebase Authentication guards the dashboard, and a manual mode lets me force the pump on or off in real time.

Want something like this built?