0% found this document useful (0 votes)
14 views4 pages

IOT Lab Experiment No. 10

Uploaded by

rei0zlitch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views4 pages

IOT Lab Experiment No. 10

Uploaded by

rei0zlitch
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Experiment No.

10

Implementation of Smart Dustbin System for Smart City

Objective: To design and implement a smart dustbin system that utilizes Arduino Uno and
sensors for automated waste disposal management in smart cities.

Required Components
1. Arduino Uno
2. Ultrasonic Sensor (HC-SR04)
3. Servo Motor
4. Jumper Wires
5. Breadboard
6. Resistors (as required)
7. Power Supply (e.g., 9V battery or USB)
8. LED indicators (optional)
9. Buzzer (optional)
10. Dustbin model

Theory
The smart dustbin system uses an ultrasonic sensor to detect the presence of an object near
the dustbin. Once detected, the servo motor operates the lid of the dustbin, opening it to allow
waste disposal. After a specified delay, the lid closes automatically. The system is designed
to improve hygiene and convenience in waste disposal in smart cities.

Circuit Diagram
Connections:

1. Connect the Ultrasonic Sensor:


o VCC pin to 5V on Arduino
o GND pin to GND on Arduino
o Trig pin to digital pin D9 on Arduino
o Echo pin to digital pin D10 on Arduino
2. Connect the Servo Motor:
o Signal wire to digital pin D3 on Arduino
o VCC wire to 5V on Arduino
o GND wire to GND on Arduino

3. Optional Components:
o LED: Connect to a digital pin (e.g., D13) with a resistor in series.
o Buzzer: Connect to a digital pin (e.g., D8) with proper polarity.

Procedure
Step 1: Assemble the Components

1. Mount the ultrasonic sensor and servo motor on the dustbin model.
2. Connect the components as per the circuit diagram.
3. Verify all connections before powering up the system.

Step 2: Program the Arduino Uno

1. Open the Arduino IDE.


2. Write the following code:

#include <Servo.h>

Servo servo;
const int trigPin = 9;
const int echoPin = 10;
const int servoPin = 3;
const int ledPin = 13;

void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(ledPin, OUTPUT);
servo.attach(servoPin);
servo.write(0); // Lid closed initially
Serial.begin(9600);
}

void loop() {
long duration, distance;

// Send ultrasonic pulse


digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

// Measure pulse duration


duration = pulseIn(echoPin, HIGH);

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

if (distance <= 20 && distance > 0) { // If object is close


digitalWrite(ledPin, HIGH); // Turn on LED
servo.write(90); // Open lid
delay(5000); // Wait 5 seconds
servo.write(0); // Close lid
digitalWrite(ledPin, LOW); // Turn off LED
}

delay(100);
}

3. Upload the code to the Arduino Uno.

Step 3: Test the System

1. Place your hand near the ultrasonic sensor.


2. Observe the dustbin lid opening and closing automatically.
3. Optionally, check LED or buzzer indications.

Observations
1. Record the distance at which the dustbin opens.
2. Note the time taken for the lid to close automatically.
3. Check for any malfunctions or delays in response.

Precautions
1. Ensure correct connections to prevent short circuits.
2. Avoid placing the sensor in a dusty or moist environment.
3. Use components within their operating voltage range.

Result
The smart dustbin system was successfully implemented. The lid operates automatically
based on object proximity, making it efficient for waste disposal management in smart cities.

You might also like