Table of Contents

Automated Plant Watering System with MQTT and ESP32-S3

Paul-Christian Thoma(32436)-Elham Mohammadi(32475)-Deniz-Zeynep Adem(33784)

1. Introduction

Plants require consistent and appropriate watering to grow and remain healthy. However, in daily life, particularly during travel or vacations, it's easy to forget or be unable to water plants. Overwatering and underwatering are common issues that can damage plant health. An automated watering system that responds to soil moisture levels helps ensure optimal plant hydration while minimizing manual intervention.

This project presents a smart plant watering system designed to operate semi-autonomously. It monitors the soil moisture and automatically activates a peristaltic pump via a latching relay to deliver water when needed. The system uses two ESP32-S3 microcontrollers connected over Wi-Fi, communicating through MQTT protocol to exchange sensor data and control messages.

The architecture is split into two subsystems:

Sensor Node: Measures soil moisture and publishes data to an MQTT broker.

Actuator Node: Receives watering commands via MQTT and controls the pump.

Users can integrate remote notifications or dashboards via tools such as Node-RED, Telegram bots, or email alerts.

2. Materials and Methods

2.1 Materials

Component Description
ESP32-S3 Microcontroller with built-in Wi-Fi used for both sensor and actuator nodes
Capacitive Soil Moisture Sensor Provides analog output corresponding to soil moisture
DFRobot Peristaltic Pump (DFR0523) Waters the plant when triggered
2-Coil Latching Relay (HF0D2/005-S-L2) Used to control the pump with minimal power consumption
Flexible PVC Tubing Connects pump to plant pot and water source
LED and resistor (optional) Indicates system status (e.g., dry soil)
External Power Supply Powers the pump and relay (e.g., 5V/12V DC adapter)

2.2 Software and Tools

2.3 System Overview

The system operates in two parts:

Sensor Node (ESP32-S3 + Soil Sensor)

Actuator Node (ESP32-S3 + Latching Relay + Pump)

3. Results

3.1 Code Overview

Sensor Node Highlights:

Actuator Node Highlights:

MQTT Topic Examples:

Optional Python Logic:

3.2 Testing and Observations

Pump successfully turns on when soil is dry and stops when moisture reaches target range.

4. Discussion and Conclusion

This project successfully demonstrates a modular, scalable, and remotely-controllable plant watering system. By separating sensing and actuation, it allows for distributed architecture and clean integration with home automation systems.

Key advantages:

4.1 Improvements and Future Work

5. Media and Demonstration

\[Link to demo video]
sketch of the circuit in circuit-diagram.org
Photos of the prototype and setup
Screenshot of MQTT dashboard and Telegram messages

References

* [ESP32 Official Documentation](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/)

* [DFRobot Peristaltic Pump Wiki](https://wiki.dfrobot.com/Gravity_Peristaltic_Pump_SKU_DFR0523)

* [HiveMQ MQTT Broker](https://www.hivemq.com/public-mqtt-broker/)

* [Node-RED Documentation](https://nodered.org/docs/)

* [Telegram Bot API](https://core.telegram.org/bots/api)

* [ESP32 ADC Tutorial – Random Nerd Tutorials](https://randomnerdtutorials.com/esp32-adc-analog-read-arduino-ide/)

-