This project implements a smart, automated plant watering system using an IoT device and a Python-based backend. The system uses sensor data to predict and manage optimal watering quantities for plants, helping ensure efficient water usage.
- IoT Device: M5Stack Core2 with an ESP32 processor
- Backend Language: Python
- MQTT Broker: EMQX Cloud
- MQTT Client Library:
paho-mqtt - Database: SQLite for local logging of water dispensed, useful for training water quantity prediction models.
- Device Firmware: MicroPython
- ML Models: Random forest regressors are used for moisture level and water quantity prediction based on live soil and weather conditions.
- Python 3.8+
- M5Stack Core2 flashed with MicroPython
- An EMQX Cloud MQTT broker instance
-
Clone the repository
git clone https://github.com/heet434/vruksh.aiot.git cd vruksh.aiot -
Create and activate a virtual environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies
pip install -r requirements.txt
-
Start the server
python server.py
-
Client side - ESP32 (upide) Run the .py file in upide. It contains the code for reading the soil moisture sensor data and then after processing, publishes data to the MQTT broker on the topics "mqtt/get_optimal_moisture" and "mqtt/moisture_alert" and subscribes to another topic from the other client to get the optimal threshold. It has scheduled times for reading 3 times a day.
- Platform: M5Stack Core2
- Firmware: MicroPython
- Broker: EMQX Cloud
The IoT device reads the soil moisture sensor, publishes the readings via MQTT, and receives watering commands from the backend.
- Real-time soil moisture data collection
- Smart water quantity prediction using trained ML models
- MQTT-based bi-directional communication
- Local database logging of water dispensed
This project can be extended on large scale as well with proper resources and planting strategy.


