IOT Lab Experiment No. 10
IOT Lab Experiment No. 10
10
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:
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.
#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;
// Calculate distance
distance = (duration / 2) / 29.1; // cm
delay(100);
}
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.