SenseBin is an ESP32-based smart waste-management system designed to automate dustbin monitoring, touchless lid operation, and waste-level detection. The system combines ultrasonic sensing, servo motor control, embedded firmware, alert mechanisms, and a real-time IoT dashboard to demonstrate an industry-oriented smart waste-management solution.
The project is developed with a hardware-ready architecture and a Wokwi virtual simulation, making it possible to develop and validate the complete embedded system without physical hardware.
Traditional waste bins require manual checking to determine whether they are full. This can result in unnecessary collection trips, overflowing bins, poor maintenance efficiency, and hygiene concerns.
SenseBin addresses this problem by continuously monitoring the bin and automatically responding to detected objects and waste levels.
The system provides:
- 🤖 Touchless automatic lid operation
- 📡 Ultrasonic-based object detection
- 📊 Real-time waste-level estimation
- 🚨 Full-bin alert generation
- 💡 LED-based status indication
- 🔊 Buzzer-based critical alert
- ⚙️ Servo-controlled lid
- 📟 Local status monitoring through OLED
- 🌐 Flask-based telemetry API
- 📈 Real-time web dashboard
- 🧪 Wokwi virtual embedded-system simulation
The main objectives of SenseBin are:
- Detect a nearby hand/object without physical contact.
- Automatically open and close the dustbin lid.
- Measure the distance between the sensor and waste.
- Calculate the approximate waste-fill percentage.
- Classify the bin as NORMAL, HIGH, or FULL.
- Generate visual and audible alerts when collection is required.
- Stream telemetry to a monitoring dashboard.
- Validate the embedded system using virtual simulation.
┌──────────────────────┐
│ ESP32 │
│ Microcontroller │
└──────────┬───────────┘
│
┌─────────────────┴─────────────────┐
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ HC-SR04 Sensor 1 │ │ HC-SR04 Sensor 2 │
│ Hand/Object │ │ Waste Level │
│ Detection │ │ Measurement │
└────────┬─────────┘ └────────┬─────────┘
│ │
▼ ▼
Object Detection Distance Measurement
│ │
▼ ▼
Servo Control Fill Calculation
│ │
▼ ▼
Lid OPEN/CLOSE NORMAL/HIGH/FULL
│
┌───────────────────┼──────────────────┐
│ │ │
▼ ▼ ▼
Green LED Red LED Buzzer
│ │ │
└───────────────────┴──────────────────┘
│
▼
Telemetry / Monitoring
│
▼
Flask REST API
│
▼
SenseBin Dashboard
| Component | Purpose |
|---|---|
| ESP32 | Main microcontroller |
| HC-SR04 #1 | Hand/object detection |
| HC-SR04 #2 | Waste-level measurement |
| Servo Motor | Automatic lid control |
| Green LED | Normal status |
| Red LED | High/full status |
| Buzzer | Critical/full-bin alert |
| OLED Display | Local system information |
| Breadboard | Circuit prototyping |
| Jumper Wires | Component connections |
Note: Physical hardware is optional for this implementation. The embedded circuit is validated using Wokwi simulation.
The first ultrasonic sensor monitors the area near the dustbin.
Object Distance ≤ Detection Threshold
↓
Object Detected
↓
Servo Activated
↓
Lid OPEN
After the configured delay:
Lid CLOSE
The second ultrasonic sensor measures the distance between the sensor and the waste surface.
Assuming a known bin height:
Fill Level = Bin Height − Measured Distance
The fill percentage is calculated as:
Fill Percentage =
((Bin Height − Measured Distance) / Bin Height) × 100
Example for a 30 cm bin:
| Waste Level | Sensor Distance | Status |
|---|---|---|
| 0% | 30 cm | NORMAL |
| 25% | 22.5 cm | NORMAL |
| 50% | 15 cm | NORMAL |
| 75% | 7.5 cm | HIGH |
| 90% | 3 cm | FULL |
0–74%
↓
NORMAL
↓
Green LED
75–89%
↓
HIGH
↓
Warning indication
90–100%
↓
FULL
↓
Red LED + Buzzer
SenseBin uses a lightweight telemetry structure to communicate sensor and system states.
Example:
{
"event": "object_detected",
"fill_percentage": 50,
"status": "NORMAL",
"lid": "OPEN",
"alert": false,
"hand_distance": 15,
"bin_distance": 15
}Telemetry fields:
| Field | Description |
|---|---|
event |
Current system event |
fill_percentage |
Calculated waste level |
status |
NORMAL / HIGH / FULL |
lid |
OPEN / CLOSED |
alert |
Collection alert state |
hand_distance |
Object detection distance |
bin_distance |
Waste sensor distance |
The project includes a futuristic web dashboard designed specifically for SenseBin telemetry.
- Real-time waste level
- Bin status
- Lid status
- Sensor distance
- Object detection state
- Collection alerts
- Waste-level trend
- Activity/event log
- Sensor telemetry
- System status
The dashboard does not use unrelated metrics. All displayed values correspond to actual SenseBin sensor inputs, calculated states, actuator states, or system events.
The project uses a lightweight Flask backend.
frontend
│
│ GET
▼
Flask Server
│
│ telemetry
▼
SenseBin Dashboard
GET /api/telemetry
Used by the dashboard to retrieve the latest SenseBin telemetry.
Telemetry can also be simulated directly from the terminal using:
backend/telemetry_input.py
Example:
{"event":"bin_full","fill_percentage":90,"status":"FULL","lid":"CLOSED","alert":true,"hand_distance":100,"bin_distance":3}The embedded system is simulated using Wokwi.
The simulation includes:
- ESP32
- Two ultrasonic sensors
- Servo motor
- Green LED
- Red LED
- Buzzer
- OLED display
- Serial Monitor
Sensor Input
↓
ESP32 Firmware
↓
Sensor Processing
↓
Decision Logic
↓
Servo / LED / Buzzer
↓
Serial Monitor
Hand Distance : 2.9 cm
Bin Distance : 100.9 cm
Fill Level : 0%
Status : NORMAL
Lid : OPEN
Expected:
Object Detected
Servo → OPEN
Green LED → ON
Fill Percentage : 50%
Status : NORMAL
Lid : CLOSED
Alert : FALSE
Expected:
Green LED → ON
Red LED → OFF
Buzzer → OFF
Fill Percentage : 75%
Status : HIGH
Lid : CLOSED
Alert : FALSE
Expected:
Warning state activated
Fill Percentage : 90%
Status : FULL
Lid : CLOSED
Alert : TRUE
Expected:
Red LED → ON
Buzzer → ON
Collection Required
Smart-Dustbin/
│
├── backend/
│ ├── server.py
│ └── telemetry_input.py
│
├── frontend/
│ ├── index.html
│ ├── styles.css
│ ├── app.js
│ └── sb.jpeg
│
├── wokwi/
│ ├── sketch.ino
│ ├── diagram.json
│ └── libraries.txt
│
├── screenshots/
├── circuit_diagram/
├── reports/
├── docs/
│
├── requirements.txt
├── README.md
└── .gitignore
Contains the Flask telemetry server and terminal-based telemetry simulator.
Contains the SenseBin IoT monitoring dashboard.
Contains the embedded firmware and Wokwi circuit configuration.
Project demonstration screenshots.
Circuit and wiring documentation.
Project reports and documentation.
Additional technical documentation.
- Python 3.x
- Flask
- Flask-CORS
- Requests
- Arduino IDE or Wokwi
- VS Code
- Modern web browser
pip install flask flask-cors requestscd backend
python server.pyThe server runs at:
http://localhost:3000
Open another terminal:
cd backend
python telemetry_input.pySend telemetry as JSON.
Example:
{"event":"object_detected","fill_percentage":50,"status":"NORMAL","lid":"OPEN","alert":false,"hand_distance":15,"bin_distance":15}Open:
frontend/index.html
using VS Code Live Server.
The dashboard retrieves telemetry from:
/api/telemetry
The dashboard can be tested using a progressive waste-level sequence:
{"event":"bin_monitoring","fill_percentage":0,"status":"NORMAL","lid":"CLOSED","alert":false,"hand_distance":100,"bin_distance":30}{"event":"bin_monitoring","fill_percentage":25,"status":"NORMAL","lid":"CLOSED","alert":false,"hand_distance":100,"bin_distance":22.5}{"event":"object_detected","fill_percentage":50,"status":"NORMAL","lid":"OPEN","alert":false,"hand_distance":15,"bin_distance":15}{"event":"bin_warning","fill_percentage":75,"status":"HIGH","lid":"CLOSED","alert":false,"hand_distance":100,"bin_distance":7.5}{"event":"bin_full","fill_percentage":90,"status":"FULL","lid":"CLOSED","alert":true,"hand_distance":100,"bin_distance":3}This produces a meaningful Waste Level Trend from 0% → 25% → 50% → 75% → 90%.
The system is validated across three layers:
Ultrasonic Sensors
↓
ESP32
↓
Servo / LED / Buzzer
Telemetry JSON
↓
Flask REST API
↓
HTTP 200 Response
API Telemetry
↓
Real-Time Visualization
↓
Status / Trends / Alerts
This layered architecture allows the embedded system, communication layer, and monitoring interface to be tested independently.
Smart waste-management systems can improve operational efficiency in:
- Smart cities
- Hospitals
- Airports
- Railway stations
- Shopping malls
- Office buildings
- Educational campuses
- Industrial facilities
- Public spaces
Potential benefits include:
- Touchless waste disposal
- Improved hygiene
- Reduced manual monitoring
- Early detection of overflowing bins
- More efficient collection planning
- Reduced unnecessary collection trips
- Real-time operational visibility
The current system can be extended with:
- ESP32 Wi-Fi telemetry
- MQTT communication
- Cloud-based monitoring
- Multiple-bin management
- GPS-based bin tracking
- Mobile notifications
- Predictive waste-level analytics
- Waste collection route optimization
- Battery and power monitoring
- Solar-powered operation
- Machine-learning-based collection prediction
This project demonstrates practical implementation of:
- Microcontroller programming
- GPIO
- Digital input/output
- Ultrasonic sensing
- PWM
- Servo motor control
- Sensor interfacing
- Threshold-based decision making
- Actuator control
- Embedded C / Arduino programming
- Serial communication
- Sensor calibration
- Real-time telemetry
- REST API communication
- IoT dashboard integration
- Virtual hardware simulation
- System testing and validation
The repository contains evidence of:
- Wokwi embedded-system simulation
- Sensor readings
- Servo response
- LED and buzzer alerts
- Flask telemetry communication
- SenseBin dashboard
- Waste-level trend visualization
- Full-bin detection
Domain: Embedded Systems / IoT / Smart Infrastructure
Project Level: Industry-Oriented Student Project
Controller: ESP32
Simulation: Wokwi
Backend: Python + Flask
Frontend: HTML + CSS + JavaScript
Communication: REST API / JSON Telemetry
SenseBin demonstrates how an embedded system can combine sensing, real-time decision-making, actuator control, telemetry, and visualization into a practical smart-infrastructure solution.
By integrating ESP32 firmware, ultrasonic sensors, servo control, alert mechanisms, virtual hardware simulation, Flask telemetry, and a real-time dashboard, the project provides a complete prototype architecture for intelligent waste-level monitoring and automated waste-bin management.