Email us at

vigyanbhaskarmagazine@gmail.com
Vigyan Bhaskar Magazine
  • EnglishEnglish
  • हिन्दीहिन्दी
SUBMIT ARTICLE
Search
  • Home
  • Science
  • Robotics
  • Technology
  • Innovation
  • News & Events
  • Project
Reading: Smart Dustbin
Share
Font ResizerAa
Vigyan Bhaskar MagazineVigyan Bhaskar Magazine
Search
Follow US
  • Home
  • Science
  • Robotics
  • Technology
  • Innovation
  • News & Events
  • Project
Project

Smart Dustbin

By admin
Last updated: November 1, 2025
5 Min Read
Share

How to Make a Smart Dustbin Using Arduino Uno, Servo Motor and an Ultrasonic Sensor

Contents
  • Introduction
  • Hardware Required
  • Software Required
  • Component Details
  • Working Concept
  • Circuit Diagram
  • Main components
  • Connections:
  • Program Code
  • Final Assembly
  • Conclusion

Introduction

In this tutorial, we will learn how to make a smart dustbin using Arduino Uno, Servo motor and an ultrasonic sensor. This project introduces a touchless solution for waste disposal, which is particularly useful in maintaining hygiene during the COVID-19 era and beyond.

Hardware Required

  • Arduino Uno
  • Ultrasonic Sensor HC-SR04
  • SG-90 Micro Servo Motor
  • Dustbin
  • Full Kit

 

Software Required

  • Arduino IDE

 

Component Details

  1. Arduino Uno

Arduino Uno is an open-source microcontroller board based on the ATmega328P processor. Key features include:

  • 14 digital input/output pins, 6 of which support PWM output
  • 6 analog inputs
  • USB connection, power jack, ICSP header, and reset button

It is economical and ideal for beginner-level projects, allowing users to experiment freely without worry.

 

  1. Ultrasonic Sensor HC-SR04

The HC-SR04 sensor measures distance using SONAR principles.

  • Components: Transmitter (emits ultrasound) and Receiver (listens for echo)
  • Applications: Obstacle avoidance, distance measurement
  • Working Principle: Emits an ultrasonic wave that bounces back after hitting an object. The time taken for the wave’s return determines the distance.

 

  1. SG90 Micro Servo Motor

The SG90 is a lightweight, fast, and reliable servo motor, commonly used in:

  • Remote-controlled vehicles (cars, boats, planes)
  • Robotics projects
    It operates smoothly with most radio control systems and provides precise motion for the dustbin lid.

 

Working Concept

The smart dustbin automates the process of opening the lid when an object is detected. Here’s how it works:

  1. Detection: The ultrasonic sensor HC-SR04 detects an object in front of the dustbin.
  2. Signal Processing: The sensor sends data to the Arduino Uno, which processes the signal.
  3. Actuation: The Arduino signals the servo motor to open the dustbin lid for a specified time (default: 3 seconds).

This project provides a contactless solution, making trash disposal more hygienic and efficient.

 

Circuit Diagram

Main components

  1. Arduino Uno
  2. Ultrasonic Sensor HC-SR04
  3. SG90 Servo Motor

Connections:

  • HC-SR04:
    • Trig → Pin 5
    • Echo → Pin 6
    • VCC → 5V
    • GND → GND
  • Servo Motor:
    • Signal → Pin 7
    • VCC → 3.3V
    • GND → GND
  • Power Supply:
    • A 9V battery is connected to the VIN pin on Arduino Uno, with grounds connected together.

 

Program Code

Here’s the code for the smart dustbin. Upload it to the Arduino Uno using the Arduino IDE.

 

#include <Servo.h> // Servo library

Servo servo;

int trigPin = 5;

int echoPin = 6;

int servoPin = 7;

int led = 10;

long duration, dist, average;

long aver[3]; // Array for averaging distance measurements

 

void setup() {

Serial.begin(9600);

servo.attach(servoPin);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

servo.write(0); // Close the lid on startup

delay(100);

servo.detach();

}

 

void measure() {

digitalWrite(led, HIGH);

digitalWrite(trigPin, LOW);

delayMicroseconds(5);

digitalWrite(trigPin, HIGH);

delayMicroseconds(15);

digitalWrite(trigPin, LOW);

 

duration = pulseIn(echoPin, HIGH);

dist = (duration / 2) / 29.1; // Calculate distance

}

 

void loop() {

for (int i = 0; i <= 2; i++) { // Average distance calculation

measure();

aver[i] = dist;

delay(10);

}

dist = (aver[0] + aver[1] + aver[2]) / 3;

 

if (dist < 50) { // Change threshold distance as needed

servo.attach(servoPin);

delay(1);

servo.write(0); // Open the lid

delay(3000); // Keep it open for 3 seconds

servo.write(150); // Close the lid

delay(1000);

servo.detach();

}

Serial.print(dist);

}

 

Final Assembly

  1. Attach the Arduino Uno and the 9V battery to the dustbin wall using double-sided tape.
  2. Upload the code to the Arduino board via the Arduino IDE.
  3. Power on your setup, and your smart dustbin is ready to use!

 

Conclusion

With this smart dustbin, you have created a hygienic and contactless solution for waste disposal. Experiment further by customizing the code to adjust lid timings or sensor sensitivity. Enjoy building!

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Email Copy Link Print
Leave a Comment Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

SUBSCRIBE NOW

Subscribe to our newsletter to get our newest articles instantly!

HOT NEWS

What are the Units of Astronomical Measurement?

Quantum science emerged from studies of the smallest objects in nature. Today, it promises to…

October 10, 2025

Study Alarm System

Madhepura, October 5, 2025 – Introduction Ruby Kumari, a Class 10 student of R. Keshav…

November 3, 2025

Piezoelectric Road

Madhepura, October 5, 2025 – Gautam Kumar, a resident of Lakshmipur Bhagwati village under Kumarkhand…

October 11, 2025

YOU MAY ALSO LIKE

Smart Stick for Blind People Using Arduino Nano

Introduction This project involves creating a smart walking stick to assist visually impaired individuals in detecting obstacles in their path.…

Project
October 30, 2025
We use our own and third-party cookies to improve our services, personalise your advertising and remember your preferences.
  • About Us
  • Contact Us
  • Privacy Policy
  • From the Editor’s Desk
  • Exclusives
  • Learn How
  • Support
  • Solutions
  • Terms And Conditions
  • Editorial Policy
  • Marketing Solutions
  • Industry Intelligence

Follow US: 

Vigyan Bhaskar

Address: Anand Vihar, North of Madhepura College, Madhepura, Bihar, India
Contact number: +91 9117295890

Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?