Hardware Integration for Waste2Worth
The hardware counterpart to the Waste2Worth app, enabling IoT-based smart composting monitoring. This repository contains firmware for sensor data collection, device communication, and integration with the Waste2Worth Flutter app.
- Real-time Sensor Monitoring: Measures temperature, humidity, pH, and gas levels (NH₃/CO₂).
- WiFi/Bluetooth Connectivity: ESP32-based communication with the Waste2Worth app.
- Data Logging: Stores latest compost metrics when offline.
| Component | Quantity | Purpose |
|---|---|---|
| ESP32 | 1 | Main microcontroller (WiFi/BLE) |
| DHT11 | 1 | Temperature & humidity sensing |
| MQ-135 | 1 | Gas (NH₃/CO₂) detection |
| pH Sensor | 1 | Compost acidity monitoring |
Need these dependencies:
- PlatformIO: Core development framework.
- Libraries:
DHT sensor library(Temperature/Humidity)Esp32 Firebase Client(Firebase integration)
git clone https://github.com/your-username/ECOBIN.git
cd ECOBIN - Install PlatformIO VSCode extension.
- Open the project folder in VSCode.
Edit these values in the src/main.cpp file:
#define WIFI_SSID "Your_SSID"
#define WIFI_PASS "Your_Password"
#define FIREBASE_HOST "YOUR_FIREBASE_REAL_TIME_DATABASE_URL" // without https:// and trailing slash
#define FIREBASE_AUTH "YOUR_FIREBASE_PROJECT_API_KEY" - Import the required libraries by downloading the zip files of the respective directives and place them in the
libdirectory after unzipping.
- Connect ESP32 via USB.
- Click Upload in PlatformIO.
ECOBIN/
├── lib/ # External libraries imported (PlatformIO manages dependencies)
├── src/ # Main firmware code
│ ├── main.cpp # Core code
├── test/ # Unit tests (PlatformIO test framework)
├── platformio.ini # Build configuration
└── README.md
Sensors → ESP32 → (MQTT) → Firebase → Flutter App
{
"temperature": 25.6,
"humidity": 60,
"ph": 6.8,
"gas_ppm": 120
} - Assemble hardware in compost bin (waterproof enclosure recommended).
- Power options:
- 18650 Li-ion battery (solar-charged)
- 5V DC adapter