πSmart Automatic Dustbin
π― Objective of This Project
The goal of this project is to build a Smart Automatic Dustbin that:
-
Opens automatically when a hand is detected
-
Detects whether the dustbin is full or not
-
Works without touching the lid (Hygienic System)
This project uses:
-
Distance measurement
-
Servo motor control
-
ESP32 microcontroller logic
π Real-World Application
-
Smart homes
-
Hospitals
-
Smart city waste management
-
Public places (malls, railway stations)
-
IoT-based garbage monitoring systems
π§© Components Used in This Project
1οΈβ£ ESP32 Development Board
πΉ About ESP32
The ESP32 is a powerful microcontroller with:
-
Built-in WiFi
-
Built-in Bluetooth
-
Multiple GPIO pins
-
PWM support (for servo control)
πΉ Why We Use ESP32?
-
Future IoT upgrade possible
-
Fast processing
-
Ideal for smart automation projects
2οΈβ£ Ultrasonic Sensor (HC-SR04)
πΉ Function
Used to measure distance using sound waves.
πΉ How It Works
-
Sends ultrasonic sound
-
Sound reflects from object
-
Time taken is calculated
-
Distance is computed
πΉ In This Project
-
Sensor 1 β Detects Hand
-
Sensor 2 β Detects Garbage Level
3οΈβ£ Servo Motor (SG90)
πΉ Function
Rotates at specific angles (0Β°β180Β°).
πΉ In This Project
-
0Β° β Lid Closed
-
90Β° β Lid Open
4οΈβ£ Other Required Items
-
Breadboard
-
Jumper wires
-
External 5V supply (recommended)
-
Dustbin body
-
Mounting support for servo
π Circuit Diagram & Connections
π Pin Configuration
πΉ Ultrasonic Sensor 1 (Hand Detection)
| Sensor Pin | ESP32 Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| TRIG | GPIO 5 |
| ECHO | GPIO 18 |
πΉ Ultrasonic Sensor 2 (Garbage Level)
| Sensor Pin | ESP32 Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| TRIG | GPIO 19 |
| ECHO | GPIO 04 |
πΉ Servo Motor
| Servo Wire | ESP32 Pin |
|---|---|
| Red | 5V (External recommended) |
| Brown | GND |
| Orange | GPIO 13 |
β Important: Connect ESP32 GND and Servo GND together.
π§ Setup Guide (Step-by-Step)
Step 1 β Mount Servo on Lid
-
Fix servo motor near hinge area
-
Connect servo arm to lid using plastic rod
Step 2 β Install Ultrasonic Sensor 1
-
Place outside front of dustbin
-
Facing outward to detect hand
Step 3 β Install Ultrasonic Sensor 2
-
Place inside top of dustbin
-
Facing downward toward garbage
Step 4 β Make Circuit Connections
-
Connect sensors to ESP32
-
Double-check VCC & GND
-
Avoid loose connections
Step 5 β Power On & Test
β Working Principle Summary
-
Hand comes near dustbin
-
Ultrasonic sensor detects object
-
ESP32 processes distance
-
Servo rotates and opens lid
-
After delay β lid closes
-
Second sensor continuously monitors garbage level
-
If garbage reaches threshold β βDustbin Fullβ