Skip to content

Project repo for an automated plant watering system project. Code for the backend server, the micropython code for the iot device and the models used for moisture level and water quantity prediction are included.

Notifications You must be signed in to change notification settings

heet434/vruksh.aiot

Repository files navigation

PHOTO-2025-04-16-18-27-36

🌱 vruksh.aiot - Automated Plant Watering System

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.

🚀 Project Overview

  • 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.

🧰 Prerequisites

  • Python 3.8+
  • M5Stack Core2 flashed with MicroPython
  • An EMQX Cloud MQTT broker instance

🔧 Setup Instructions

  1. Clone the repository

    git clone https://github.com/heet434/vruksh.aiot.git
    cd vruksh.aiot
  2. Create and activate a virtual environment

    python -m venv venv
    source venv/bin/activate   # On Windows use `venv\Scripts\activate`
  3. Install dependencies

    pip install -r requirements.txt
  4. Start the server

    python server.py
  5. 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.

📡 IoT Device

  • 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.

📊 Features

  • 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.

PHOTO-2025-04-16-18-24-28 PHOTO-2025-04-16-18-29-39

About

Project repo for an automated plant watering system project. Code for the backend server, the micropython code for the iot device and the models used for moisture level and water quantity prediction are included.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •