Urban areas me garbage management ek major problem ban chuka hai. Public dustbins:
Time par empty nahi hote
- Time par empty nahi hote
Overflow ho jate hain
- Overflow ho jate hain
Bad smell aur pollution create karte hain
- Bad smell aur pollution create karte hain
Manual monitoring par dependent hote hain
- Manual monitoring par dependent hote hain
Is problem ko solve karne ke liye maine design kiya hai:
π₯ Smart Garbage Bin Full Alert System
π₯ Smart Garbage Bin Full Alert System
Ye IoT-based system dustbin ka fill level detect karta hai aur full hone par alert bhejta hai.
π₯ Problem StatementTraditional garbage bins:
β No fill level monitoringβ Manual inspection requiredβ Overflow issuesβ Unhygienic environment
Cities need smart waste monitoring.
π‘ Proposed Solutionβ Ultrasonic sensor se level detectionβ Real-time monitoringβ MQTT cloud alertβ Mobile notificationβ LED/Buzzer alertβ Scalable for smart cities
π§° Required Hardware1οΈβ£ ESP32 Development BoardRole:
WiFi connectivity
- WiFi connectivity
Data processing
- Data processing
MQTT communication
- MQTT communication
Role:
Detect garbage level inside bin
- Detect garbage level inside bin
Role:
Local alert when bin is full
- Local alert when bin is full
Ultrasonic Pin
ESP32 Pin
VCC
5V
GND
GND
Trig
GPIO5
Echo
GPIO18
Buzzer β ESP32GPIO4 β Buzzer
π§ Software UsedArduino IDE
- Arduino IDE
ESP32 Core
- ESP32 Core
MQTT Broker (HiveMQ)
- MQTT Broker (HiveMQ)
PubSubClient Library
- PubSubClient Library
#include <WiFi.h>
#include <PubSubClient.h>
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
const char* mqtt_server = "broker.hivemq.com";
#define TRIG_PIN 5
#define ECHO_PIN 18
#define BUZZER_PIN 4
long duration;
float distance;
WiFiClient espClient;
PubSubClient client(espClient);
void setup_wifi() {
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
}
void reconnect() {
while (!client.connected()) {
client.connect("SmartBinClient");
}
}
void setup() {
Serial.begin(115200);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
pinMode(BUZZER_PIN, OUTPUT);
setup_wifi();
client.setServer(mqtt_server, 1883);
}
void loop() {
if (!client.connected()) reconnect();
client.loop();
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
duration = pulseIn(ECHO_PIN, HIGH);
distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.println(distance);
if(distance < 10){
digitalWrite(BUZZER_PIN, HIGH);
client.publish("garbage/status","BIN FULL");
} else {
digitalWrite(BUZZER_PIN, LOW);
client.publish("garbage/status","BIN NOT FULL");
}
delay(3000);
}
#include <WiFi.h>
#include <PubSubClient.h>
const char* ssid = "YOUR_WIFI_NAME";
const char* password = "YOUR_WIFI_PASSWORD";
const char* mqtt_server = "broker.hivemq.com";
#define TRIG_PIN 5
#define ECHO_PIN 18
#define BUZZER_PIN 4
long duration;
float distance;
WiFiClient espClient;
PubSubClient client(espClient);
void setup_wifi() {
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
}
}
void reconnect() {
while (!client.connected()) {
client.connect("SmartBinClient");
}
}
void setup() {
Serial.begin(115200);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
pinMode(BUZZER_PIN, OUTPUT);
setup_wifi();
client.setServer(mqtt_server, 1883);
}
void loop() {
if (!client.connected()) reconnect();
client.loop();
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
duration = pulseIn(ECHO_PIN, HIGH);
distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.println(distance);
if(distance < 10){
digitalWrite(BUZZER_PIN, HIGH);
client.publish("garbage/status","BIN FULL");
} else {
digitalWrite(BUZZER_PIN, LOW);
client.publish("garbage/status","BIN NOT FULL");
}
delay(3000);
}
βοΈ Working Logic1οΈβ£ Ultrasonic sensor measures distance2οΈβ£ If distance < threshold β Bin full3οΈβ£ Buzzer ON4οΈβ£ MQTT alert sent5οΈβ£ If distance > threshold β Normal
π ApplicationsSmart Cities
- Smart Cities
Municipal Corporations
- Municipal Corporations
Public Areas
- Public Areas
Schools
- Schools
Hospitals
- Hospitals
Malls
- Malls
β Smart city solutionβ Municipal waste monitoringβ Commercial IoT deploymentβ Scalable smart infrastructure
π Project SupportFor:
β Complete Codeβ Dashboardβ Android Appβ PCB Designβ Commercial Deployment
π² WhatsApp: +91 9336183481
π ConclusionSmart Garbage Bin Full Alert System ensures:
β Clean surroundingsβ Timely waste collectionβ Reduced overflowβ Smart city readiness
A scalable IoT-based waste management solution.











Comments