Skip to content

hiwakurdy/OpenBiogas-ML-Optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌱 OpenBiogas ML Optimizer

An open-source hardware and software ecosystem designed to monitor and optimize small-scale biogas digesters.


🎯 The Importance of This Project

Scaling down renewable energy technology to the community or household level is a major engineering challenge. A biogas digester is a living ecosystem; if the environment gets too acidic or cold, the methanogenic bacteria die, and gas production stops.

OpenBiogas ML Optimizer tackles the global need for sustainable, decentralized energy. By utilizing basic IoT sensors and a lightweight machine learning model, this project predicts optimal feeding times and warns users of system imbalances before they cause a system crash.

This repository makes industrial-grade monitoring accessible, open-source, and low-cost. By opening up the hardware schematics and software pipeline, we aim to empower communities globally to maximize their renewable energy yields without relying on expensive, proprietary equipment.

👥 Who is this for?

  • Rural Communities & Farmers: Maximize energy independence by efficiently converting organic waste into usable cooking gas or electricity.
  • Green-Tech Hobbyists & Makers: A structured, accessible project to build, deploy, and learn about IoT, machine learning, and renewable energy.
  • Researchers & Educators: A platform for gathering real-world biogas data and optimizing the methanogenesis process.
  • Open-Source Contributors: Anyone passionate about sustainability, data science, hardware engineering, or UI localization (this project natively supports Arabic, Kurdish Sorani, and English).

🏗️ System Architecture

The architecture consists of three main pillars:

1. 📡 The Hardware Node (IoT)

A low-cost, off-the-shelf microcontroller hooked up to resilient sensors.

  • Microcontroller: ESP32 or Raspberry Pi Pico
  • Sensors:
    • Temperature: DS18B20 (Waterproof)
    • pH: Industrial-grade pH probe (hydrogen sulfide resistant)
    • Pressure: BMP280 gas pressure sensor

2. 💻 The Local Dashboard & Data Pipeline

A lightweight application to visualize digester health and log data on edge devices.

  • Backend: Python + FastAPI + SQLite
  • Frontend: React + Vite (Premium Dark-mode UI with Glassmorphism)
  • Localization: Native Right-to-Left (RTL) support for Arabic and Central Kurdish (Sorani).

3. 🧠 The Machine Learning Engine

A predictive model that learns the specific behavior of the digester to optimize yield and prevent souring.

  • Frameworks: Scikit-learn (Isolation Forest & Gradient Boosting)
  • Functions:
    • Anomaly Detection: Early warning for rapid pH drops.
    • Yield Prediction: Correlates feeding amounts and temperature with resulting gas pressure.
    • The Optimizer: Actionable daily prompts (e.g., "Optimal feed amount today: 1.5kg").

🚀 Getting Started

Prerequisites

  • Python 3.9+
  • Node.js 20+

1. Run the Backend & ML Pipeline

Navigate to the backend directory and install the dependencies:

cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

Generate synthetic data (for demo/development) and train the ML models:

python -m ml.synthetic_data
python -m ml.train

Start the FastAPI backend:

python -m uvicorn main:app --port 8000

2. Run the Frontend Dashboard

Open a new terminal, navigate to the frontend directory:

cd frontend
npm install
npm run dev

Navigate to http://localhost:5173 in your browser.


🛠️ Contributing

We welcome contributions!

  • Translations: Help us translate the dashboard to more languages.
  • Hardware: Share your custom 3D-printed sensor housings or PCB designs.
  • Data Science: Improve the ML models with real-world digester datasets.

Please check the issues tab for "Good First Issue" tags!

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors