Skip to content

bundlab/smart-irrigation-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Smart Irrigation System πŸŒ±πŸ’§

A modular, extensible smart irrigation controller in Python
Decides intelligently when to water plants by combining soil moisture levels with rain probability forecasts β€” ideal for Raspberry Pi, ESP32, simulators, or any IoT setup.

Python License: MIT Tests

✨ Features

  • Configurable moisture & rain probability thresholds
  • Simulated sensors (easy to replace with real hardware like capacitive soil sensors, DHT22, etc.)
  • Dry-run / simulation mode (no hardware needed for development & testing)
  • Structured logging + basic CLI interface
  • Clean architecture ready for extensions:
    • Real weather APIs (OpenWeatherMap, WeatherAPI, etc.)
    • MQTT publishing/subscribing
    • GPIO control (RPi.GPIO, adafruit libraries)
    • Database storage (SQLite, InfluxDB)
    • Web dashboard (future)

πŸ“‹ Table of Contents

Project Structure

smart-irrigation-platform/ β”‚ β”œβ”€β”€ src/ # Main source code β”‚ β”œβ”€β”€ init.py β”‚ β”œβ”€β”€ main.py # Entry point β”‚ β”œβ”€β”€ core/ β”‚ β”‚ β”œβ”€β”€ init.py β”‚ β”‚ └── irrigation_system.py # Core business logic β”‚ β”œβ”€β”€ sensors/ β”‚ β”‚ β”œβ”€β”€ init.py β”‚ β”‚ └── soil_moisture.py # Sensor abstractions β”‚ β”œβ”€β”€ weather/ β”‚ β”‚ β”œβ”€β”€ init.py β”‚ β”‚ └── weather_service.py # Weather data (simulated or API) β”‚ └── utils/ β”‚ β”œβ”€β”€ init.py β”‚ └── logger.py # Centralized logging β”‚ β”œβ”€β”€ tests/ # Unit & integration tests β”‚ β”œβ”€β”€ init.py β”‚ └── test_irrigation_system.py β”‚ β”œβ”€β”€ config/ β”‚ └── config.py # Configuration (thresholds, etc.) β”‚ β”œβ”€β”€ .env # Environment variables (not in git) β”œβ”€β”€ .env.example # Template for .env β”œβ”€β”€ .gitignore β”œβ”€β”€ README.md β”œβ”€β”€ requirements.txt β”œβ”€β”€ setup.py # Optional: for packaging └── LICENSE

πŸ›  Prerequisites

  • Python 3.8+
  • Git
  • (Optional) Virtual environment tool: venv, uv, poetry, etc.

πŸš€ Installation

  1. Clone the repository:
    git clone https://github.com/bundlab/smart_irrigation_sys.git
    cd smart_irrigation_sys
    

⚑ Quick Start

Run the simulation python -m smart_irrigation

[INFO] Soil moisture: 42% | Rain probability: 15% [INFO] Decision: NO irrigation needed

▢️ Usage Examples

  1. Simulate custom conditions python -m smart_irrigation --simulate --moisture=25 --rain-prob=60

  2. Run once (good for scheduled tasks) python -m smart_irrigation --once

  3. Verbose mode python -m smart_irrigation --verbose

βš™οΈ Configuration

cp src/smart_irrigation/config.example.yaml config.yaml Example config.yml thresholds: moisture_critical: 30 # below β†’ must water moisture_warning: 45 rain_skip_probability: 40 # above β†’ skip

πŸ§ͺ Testing

pytest # run tests pytest --cov # with coverage black . # format ruff check --fix # lint & fix

🀝 Contributing

  • Fork the repo
  • Create your branch (git checkout -b feature/cool-feature)
  • Commit (git commit -m 'Add cool feature')
  • Push (git push origin feature/cool-feature)
  • Open a Pull Request Follow black formatting & add tests where possible.

πŸ“„ License

  • MIT License β€” see LICENSE for details.

About

🌱 Smart Irrigation System – IoT-ready Python app for automated, weather-aware watering. Modular design with simulated/real sensors, configurable thresholds & easy hardware integration (RPi, ESP32…).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages