• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Touchless Dustbin Circuit using Arduino Uno and Ultrasonic Sensor

Touchless Dustbin Circuit using Arduino Uno and Ultrasonic Sensor

Last updated on 3 September 2025 by Admin-Lavi Leave a Comment

This is simple and useful mini project for Touchless Dustbin Circuit using Arduino Uno and Ultrasonic Sensor.

It is called smart dustbin or automatic dustbin.

In normal dustbin we have to touch lid by hand which is not hygienic.

In smart dustbin the lid opens automatically when person comes near.

It uses Arduino, ultrasonic sensor and servo motor.

It can be used in home, office, hospital and public places.

Code:

#include <Servo.h>

Servo servoMotor;  
int trigPin = 9;   
int echoPin = 10;  
long duration;     
int distance;      

void setup() {
  servoMotor.attach(6);       // Servo signal pin connected to D6
  pinMode(trigPin, OUTPUT);   // Trig pin of ultrasonic sensor
  pinMode(echoPin, INPUT);    // Echo pin of ultrasonic sensor
  servoMotor.write(0);        // Initial position, lid closed
  delay(1000);
  Serial.begin(9600);         // For debugging
}

void loop() {
  // Send ultrasonic trigger pulse
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  // Read echo time
  duration = pulseIn(echoPin, HIGH);

  // Convert time into distance (cm)
  distance = duration * 0.034 / 2;

  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");

  // Check if object is near (less than 10 cm)
  if (distance < 10) {
    servoMotor.write(90);   // Open lid
    delay(3000);            // Wait for 3 seconds
    servoMotor.write(0);    // Close lid
  }
}

Code Explanation:

  • Ultrasonic sensor formula used as distance = (Time x Speed of Sound)/2.
  • Speed of sound is approx 343 meter per second or 0.034 cm per microsecond.
  • Division by 2 is because wave travel forward and backward.
  • This distance value is compare with set threshold.
  • Servo motor is controlled by Servo library in Arduino.
  • Command servo.write(angle) move motor to set position.

Circuit Working:

Touchless Dustbin Circuit Diagram using Arduino Uno and Ultrasonic Sensor

Parts List:

ComponentQuantity
Arduino UNO1
Servo Motor1
Ultrasonic Sensor1
9V Battery1

Arduino UNO is the main controller.

This power supply also run servo and sensor.

The ultrasonic sensor sense distance of object.

When hand or any object comes in front of dustbin within set range then Arduino receive signal.

Arduino send command to servo motor.

Servo motor rotates and open the dustbin lid.

After some seconds servo again rotate back and closes the lid.

Power is given by 9V battery.

Pin connections of Ultrasonic sensor, Servo motor and 9V battery:

Ultrasonic sensor has 4 pins.

  • VCC pin connect to Arduino 5V.
  • GND pin connect to Arduino GND.
  • Trig pin connect to Arduino digital pin 9.
  • Echo pin connect to Arduino digital pin 10.

Servo motor has 3 wires.

  • Red wire connect to 5V.
  • Brown or black wire connect to GND.
  • Yellow or orange wire connect to Arduino digital pin 6.

9V battery connect to Arduino Vin and GND pin.

Formulas:

Formula for distance = (Echo Time in microsecond × 0.034) / 2

Example: If echo time is 600 microsecond then distance = (600 × 0.034) / 2 = 10.2 cm approx.

If distance < 10 cm then dustbin lid gets open.

Conclusion:

This Touchless Dustbin Circuit using Arduino Uno and Ultrasonic Sensor project is simple and useful.

It is with low cost and automatic and it makes dustbin hygienic.

There is no need to touch lid by hand.

Circuit is good for school, home, office and hospital.

With bigger servo or metal frame we can work for large dustbin also.

References:

Smart Dustbin using Arduino Uno

Filed Under: Arduino Projects, Sensors and Detectors

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Luggage Safety Alarm Circuit using IC LM358
Next Post: Solar Powered Mobile Charger Circuit »

Reader Interactions

Leave a Reply Cancel reply

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

Primary Sidebar




Categories

  • Alarm Circuits (33)
  • Amplifier Circuits (67)
  • Arduino Projects (31)
  • Audio Circuits (93)
  • Automobile Circuits (19)
  • Battery Charger Circuits (48)
  • Free Energy (13)
  • Heater and Temperature Controllers (9)
  • High Voltage (1)
  • Indicator Circuits (38)
  • Inverter Circuits (13)
  • LDR Circuits (15)
  • LED and Lamps (116)
  • Meters and Testers (28)
  • Motor Controllers (18)
  • Oscillator Circuits (33)
  • Power Supply Circuits (92)
  • Remote Control Circuits (6)
  • Security and Protection (25)
  • Sensors and Detectors (76)
  • Solar Circuits (17)
  • Timer Circuits (30)
  • Transistor Circuits (56)
  • Transmitter Circuit (12)
  • Tutorials (5)
  • Water Level Controller (4)

Recent Posts

  • DIY Paper Recycling: Turn Old Paper into New
  • Solar Powered Mobile Charger Circuit
  • Touchless Dustbin Circuit using Arduino Uno and Ultrasonic Sensor
  • Luggage Safety Alarm Circuit using IC LM358
  • Cricket Stumps and Bails LED Indicator Circuit

Recent Comments

  1. Admin-Lavi on Constant Voltage, Constant Current Battery Charger Circuit
  2. Bill on Constant Voltage, Constant Current Battery Charger Circuit
  3. Admin-Lavi on Long Range FM Transmitter Circuit (2km)
  4. Sina on Long Range FM Transmitter Circuit (2km)
  5. Admin-Lavi on Long Range FM Transmitter Circuit (2km)

Copyright © 2025 | New Circuit Ideas