Arduino-Based Smart Dustbin
1. Project Title
Arduino-Based Smart Automatic Dustbin with Touchless Lid Opening and Waste-Level Monitoring
2. Project Abstract
The Arduino-Based Smart Dustbin is an automatic waste-management system designed to improve hygiene and convenience. The system uses an Arduino microcontroller, an ultrasonic sensor, and a servo motor to detect a person's hand near the dustbin and automatically open the lid without physical contact.
A second ultrasonic sensor can be used to monitor the waste level inside the dustbin. When the dustbin becomes full, the system can provide an alert using an LED and buzzer. This project demonstrates the practical application of microcontrollers, sensors, automation, and embedded systems in smart waste management.
3. Project Aim
The main aim of this project is:
To design and develop an Arduino-based automatic dustbin that opens its lid without physical contact and indicates when the dustbin is full.
Objectives
- To provide a touch-free waste disposal system.
- To automatically open the lid when a person approaches.
- To monitor the waste level inside the dustbin.
- To provide a visual or audio alert when the bin is nearly full.
- To reduce the spread of germs caused by touching dustbin lids.
- To learn practical applications of an Arduino microcontroller.
4. Project Description
The system consists of two main functions:
Function 1: Automatic Lid Opening
An ultrasonic sensor is installed near the front of the dustbin. When a person's hand comes within a specified distance, the sensor detects the object.
The Arduino then sends a control signal to the servo motor. The servo motor rotates and opens the dustbin lid automatically.
After a few seconds, the lid closes automatically.
Function 2: Waste-Level Monitoring
A second ultrasonic sensor is installed at the top inside the dustbin.
It continuously measures the distance between the sensor and the waste.
- Low waste level → Normal operation
- Medium waste level → Warning LED
- High waste level → Buzzer and full indication
5. Block Diagram
┌──────────────────────┐ │ Object Detection │ │ Ultrasonic Sensor 1 │ └──────────┬───────────┘ │ ▼ ┌───────────────┐ │ │ │ ARDUINO │ │ MICROCONTROLLER│ │ │ └───┬─────┬─────┘ │ │ ┌──────────┘ └──────────┐ ▼ ▼ ┌─────────────────┐ ┌──────────────────┐ │ Servo Motor │ │ Waste-Level │ │ Automatic Lid │ │ Ultrasonic │ │ Opening/Closing │ │ Sensor 2 │ └─────────────────┘ └────────┬─────────┘ │ ▼ ┌─────────────────┐ │ Alert System │ │ LED + Buzzer │ └─────────────────┘ ┌──────────────────┐ │ Power Supply │ │ 5V / USB Supply │ └────────┬─────────┘ │ ▼ Arduino System
6. Components Required
| No. | Component | Quantity | Purpose |
|---|---|---|---|
| 1 | Arduino UNO | 1 | Main microcontroller |
| 2 | HC-SR04 Ultrasonic Sensor | 2 | Object and waste-level detection |
| 3 | Servo Motor SG90 | 1 | Opens and closes lid |
| 4 | Buzzer | 1 | Full-bin warning |
| 5 | LED | 1 or 2 | Status indication |
| 6 | 220 Ω Resistor | 1 or 2 | LED protection |
| 7 | Breadboard | 1 | Circuit assembly |
| 8 | Jumper Wires | As required | Connections |
| 9 | Dustbin with movable lid | 1 | Mechanical structure |
| 10 | 5 V USB Power Supply | 1 | Power source |
Optional Components
- 16×2 LCD with I2C module
- ESP8266 or ESP32 for IoT monitoring
- GSM module for SMS alerts
- OLED display
- Battery pack
7. Arduino Pin Connections
Ultrasonic Sensor 1 — Object Detection
| HC-SR04 Pin | Arduino UNO |
|---|---|
| VCC | 5V |
| GND | GND |
| TRIG | D2 |
| ECHO | D3 |
Ultrasonic Sensor 2 — Waste-Level Monitoring
| HC-SR04 Pin | Arduino UNO |
|---|---|
| VCC | 5V |
| GND | GND |
| TRIG | D4 |
| ECHO | D5 |
Servo Motor
| Servo Wire | Arduino UNO |
|---|---|
| Red | 5V |
| Brown/Black | GND |
| Orange/Yellow | D9 |
For a larger servo motor, use an external 5 V power supply. Always connect the external power supply GND to Arduino GND.
Buzzer
| Buzzer Pin | Arduino UNO |
|---|---|
| Positive (+) | D8 |
| Negative (-) | GND |
LED
| LED Pin | Arduino UNO |
|---|---|
| Anode (+) | D7 through 220 Ω resistor |
| Cathode (-) | GND |
8. Schematic Diagram
+----------------------+ | ARDUINO UNO | | | Object Sensor | | HC-SR04 #1 | | +-------------+ | | | VCC --------|------| 5V | | GND --------|------| GND | | TRIG -------|------| D2 | | ECHO -------|------| D3 | +-------------+ | | | | Level Sensor | | HC-SR04 #2 | | +-------------+ | | | VCC --------|------| 5V | | GND --------|------| GND | | TRIG -------|------| D4 | | ECHO -------|------| D5 | +-------------+ | | | | Servo Motor | | +-------------+ | | | Signal ------|------| D9 | | VCC ---------|------| 5V | | GND ---------|------| GND | +-------------+ | | | | Buzzer | | +-------------+ | | | + ----------|------| D8 | | - ----------|------| GND | +-------------+ | | | | LED | | D7 ----[220Ω]---->|--| GND | +----------------------+
9. Working Principle
Step 1: System Power ON
When power is supplied, the Arduino starts the system and sets the lid to the closed position.
Step 2: Object Detection
The first ultrasonic sensor sends ultrasonic waves.
If a person's hand is detected within approximately 20 cm, the Arduino detects the object.
Step 3: Lid Opening
The Arduino sends a PWM signal to the servo motor.
The servo rotates from approximately:
0° → 90°
The dustbin lid opens.
Step 4: Automatic Closing
After a short delay, the servo motor returns to its original position:
90° → 0°
The lid closes automatically.
Step 5: Waste-Level Detection
The second ultrasonic sensor measures the distance from the top of the dustbin to the waste.
The Arduino calculates the approximate filling condition.
Step 6: Full-Bin Alert
If the waste reaches the defined full level:
- LED turns ON.
- Buzzer sounds.
- The user is notified that the dustbin needs emptying.
10. Step-by-Step Project Construction
Step 1: Prepare the Dustbin
Select a dustbin with a movable lid.
Create a suitable mechanical connection between the lid and the servo motor.
Example:
Servo Motor Horn │ │ Mechanical Link ▼ Dustbin Lid
The servo motor should be firmly fixed to the side of the dustbin.
Step 2: Install Object Detection Sensor
Place Ultrasonic Sensor 1 near the front of the dustbin.
Suggested position:
Hand ↓ [ HC-SR04 ] │ ▼ ┌─────────┐ │ │ │ Dustbin │ │ │ └─────────┘
This sensor detects the user's hand.
Step 3: Install Waste-Level Sensor
Place Ultrasonic Sensor 2 at the top of the dustbin facing downward.
HC-SR04 ↓ ┌───────────┐ │ │ │ │ │ WASTE │ │███████████ │ └───────────┘
Step 4: Connect the Arduino
Connect both ultrasonic sensors according to the pin tables above.
Make sure:
- All GND pins are connected together.
- VCC is connected to 5 V.
- TRIG and ECHO pins are connected correctly.
Step 5: Connect the Servo Motor
Connect the servo signal wire to Arduino D9.
The servo mechanically controls the lid.
Step 6: Connect the LED and Buzzer
Connect:
- LED to D7 through a 220 Ω resistor.
- Buzzer positive terminal to D8.
- All negative terminals to GND.
Step 7: Upload the Program
- Open Arduino IDE.
- Select Arduino UNO.
- Select the correct COM port.
- Upload the program.
- Test the sensor readings.
11. Basic Arduino Program
#include <Servo.h> Servo lidServo; // Object detection sensor const int trigObject = 2; const int echoObject = 3; // Waste-level sensor const int trigLevel = 4; const int echoLevel = 5; // Output devices const int ledPin = 7; const int buzzerPin = 8; const int servoPin = 9; long duration; int distance; void setup() { Serial.begin(9600); pinMode(trigObject, OUTPUT); pinMode(echoObject, INPUT); pinMode(trigLevel, OUTPUT); pinMode(echoLevel, INPUT); pinMode(ledPin, OUTPUT); pinMode(buzzerPin, OUTPUT); lidServo.attach(servoPin); // Initially close the lid lidServo.write(0); digitalWrite(ledPin, LOW); digitalWrite(buzzerPin, LOW); } int getDistance(int trigPin, int echoPin) { digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = duration * 0.034 / 2; return distance; } void loop() { // Measure distance from user's hand int objectDistance = getDistance(trigObject, echoObject); // Measure waste level int wasteDistance = getDistance(trigLevel, echoLevel); Serial.print("Object Distance: "); Serial.print(objectDistance); Serial.println(" cm"); Serial.print("Waste Distance: "); Serial.print(wasteDistance); Serial.println(" cm"); // Automatic lid opening if (objectDistance > 0 && objectDistance < 20) { lidServo.write(90); delay(3000); lidServo.write(0); delay(1000); } // Waste-level monitoring if (wasteDistance < 10) { // Dustbin is full digitalWrite(ledPin, HIGH); digitalWrite(buzzerPin, HIGH); delay(500); digitalWrite(buzzerPin, LOW); } else { // Dustbin is not full digitalWrite(ledPin, LOW); digitalWrite(buzzerPin, LOW); } delay(200); }
12. Flowchart
┌──────────────┐ │ START │ └──────┬───────┘ ▼ ┌────────────────────┐ │ Initialize Arduino │ │ Sensors and Servo │ └─────────┬──────────┘ ▼ ┌────────────────────┐ │ Detect Hand/Object │ └─────────┬──────────┘ ▼ ┌────────────────────┐ │ Object < 20 cm ? │ └──────┬───────┬─────┘ │Yes │No ▼ │ ┌─────────────┐ │ │ Open Lid │ │ │ Servo = 90° │ │ └──────┬──────┘ │ ▼ │ ┌─────────────┐ │ │ Wait 3 Sec │ │ └──────┬──────┘ │ ▼ │ ┌─────────────┐ │ │ Close Lid │ │ │ Servo = 0° │ │ └──────┬──────┘ │ └────┬────┘ ▼ ┌────────────────┐ │ Measure Waste │ │ Level Distance │ └───────┬────────┘ ▼ ┌────────────────┐ │ Waste < 10 cm? │ └──────┬────┬────┘ │Yes │No ▼ ▼ ┌────────┐ ┌────────────┐ │Buzzer +│ │Normal │ │LED ON │ │Operation │ └────┬───┘ └─────┬──────┘ └──────┬────┘ ▼ Repeat Loop
13. Expected Output
| Condition | System Response |
|---|---|
| No person nearby | Lid remains closed |
| Hand detected | Lid opens automatically |
| After 3 seconds | Lid closes |
| Bin partially filled | Normal operation |
| Bin almost full | LED turns ON |
| Bin completely full | Buzzer alert |
14. Advantages
- Touchless operation
- Improved hygiene
- Low-cost project
- Easy to build
- Low power consumption
- Simple Arduino programming
- Useful for homes, schools, offices, and hospitals
15. Future Enhancements
The project can be upgraded by adding:
IoT Monitoring
Use ESP32 to send the dustbin fill level to a web dashboard.
Mobile Notifications
Send a notification when the dustbin becomes full.
Solar Power
Use a solar panel and battery for outdoor applications.
Automatic Waste Collection
Multiple smart dustbins can send their fill levels to a central monitoring system.
LCD/OLED Display
Display:
Dustbin Status: EMPTY / HALF FULL / FULL
Recommended Final Project Title
“Arduino-Based Smart Automatic Dustbin with Touchless Lid Control and Waste-Level Monitoring”
Project Description
The Arduino-Based Smart Automatic Dustbin is an intelligent waste-management system designed to improve hygiene, convenience, and cleanliness. The project uses an Arduino UNO microcontroller as the main control unit. An HC-SR04 ultrasonic sensor detects the presence of a person's hand near the dustbin without requiring physical contact.
When an object or hand is detected within a predefined distance, the Arduino processes the sensor signal and activates a servo motor. The servo motor automatically opens the dustbin lid. After a short delay, the lid closes automatically.
A second ultrasonic sensor can be installed inside the dustbin to monitor the waste-filling level. The sensor measures the distance between the top of the dustbin and the waste material. When the waste reaches a specified level, the Arduino activates an LED and buzzer to indicate that the dustbin is full and needs to be emptied.
The system provides a simple, low-cost, and efficient solution for automatic waste disposal. It reduces direct contact with the dustbin, helps improve hygiene, and demonstrates the practical application of microcontrollers, sensors, embedded systems, and automation technology.
Working Summary
Object Detected ↓ Ultrasonic Sensor Measures Distance ↓ Arduino Processes the Signal ↓ Servo Motor Opens the Lid ↓ Waste is Deposited ↓ Lid Closes Automatically ↓ Waste-Level Sensor Checks the Bin ↓ LED/Buzzer Alert if the Bin is Full
This project is suitable for homes, schools, offices, hospitals, public places, and smart-city waste-management applications.

No comments:
Post a Comment