IoT B.Tech Intermediate

ESP32 Soil Moisture Monitoring with MQTT and Auto Irrigation

Monitor soil moisture of multiple plants using ESP32 with capacitive sensors and automatically activate water pumps via MQTT from Node-RED.

  • Suitable forB.Tech IoT students
  • Build time3-4 weeks
  • LevelIntermediate
  • Available atAjvika Labs, Kakinada

About this project

Smart irrigation system uses ESP32 with 4 capacitive soil moisture sensors to monitor plant health and automatically water when moisture falls below thresholds. Capacitive sensors: more reliable than resistive (no corrosion). Each sensor output: 0V = wet, 3.3V = dry. ADC reads on GPIO34, GPIO35, GPIO36, GPIO39. 4-channel relay activates submersible mini pumps. MQTT: sensor readings published to home/garden/soil1..4 topics every 5 minutes. Home Assistant integration via MQTT auto-discovery. Node-RED flow: receive MQTT readings, compare to thresholds, publish pump commands to home/garden/pump1..4. Manual override: push button per pump + web interface. Watering duration: configurable per plant (5-60 seconds). Daily watering schedule: time-based watering regardless of moisture. Flow meter (YF-S201) optional for liters pumped. Libraries: PubSubClient, WiFi, ArduinoJson, NTPClient.

Detailed Project Description

ESP32 Soil Moisture Monitoring with MQTT and Auto Irrigation automates watering / feeding based on real sensor data instead of fixed timers, saving water and effort while keeping conditions stable.

How It Works
1. Sensors measure the relevant conditions (soil moisture, water level, pH, temperature).
2. The controller compares readings with set-points and decides when to run the pump, valve or feeder.
3. Actions and readings are logged and can be viewed/overridden from a phone or web page.
4. Schedules and thresholds are configurable without re-flashing the firmware.

Key Components and Their Role
- ESP32: dual-core Wi-Fi + Bluetooth microcontroller that runs the firmware, reads the sensors and hosts the network connection.
- Relay module: electrically isolated switch that lets the controller turn AC/DC loads on and off.
- Soil moisture sensor: capacitive probe that measures water content of soil.
- MQTT: lightweight publish/subscribe messaging protocol used for IoT data.
- Node-RED: flow-based tool used to build the dashboard and automation logic.

Implementation Steps
1. Collect the components and study each module's datasheet (pin-out, voltage, interface).
2. Wire the circuit on a breadboard following the pin mapping; power sensors from the correct rail (3.3 V / 5 V).
3. Install Arduino IDE, PubSubClient Library, Node-RED and the required libraries; flash a minimal test sketch for each module separately.
4. Write the main firmware: read sensors → process → drive outputs / send data.
5. Configure network or cloud credentials and test communication end-to-end.
6. Calibrate thresholds, add error handling (reconnect, sensor time-out) and run a long-duration test.
7. Finalise on a PCB / enclosure and document wiring, code and results.

Key Features
- Sensor-based automation
- Manual override
- Configurable thresholds
- Remote monitoring

Expected Output
On completion the student will have automatic pump/feeder operation with a log of every action and reading.

Deliverables
- Complete source code with comments
- Circuit diagram and pin mapping
- Project report with screenshots and results
- Demonstration-ready build

Technologies used

ESP32Arduino IDEC++WiFiMQTTNode-REDHome Assistant

Hardware components

  • ESP32 DevKit
  • 4x Capacitive Soil Moisture Sensors
  • 4x Mini Submersible Pumps
  • 4-Channel Relay
  • 12V Power Supply

Software & tools

  • Arduino IDE
  • PubSubClient Library
  • Node-RED
  • Home Assistant

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.