Icon Concept (For Designer)
Ek Dustbin bana ho jiska dhakkan (lid) hawa mein khula hua hai. Ek haath kachra (crumpled paper) phenk raha hai. Dustbin ke samne Ultrasonic Sensor ki aankhein bani hon.
What It Does (Yeh Kya Karta Hai?)
Hygiene (Safai) ke liye behtareen hai.
- Jab aap kachra phekne ke liye haath qareeb layenge (Sensor dekhega).
- Motor dhakkan ko 90 Degree (Open) kar degi.
- 3 Second baad dhakkan khud 0 Degree (Close) ho jayega.
Components
To build this DIY Smart Touchless Dustbin (Automatic Lid Opener) with Plzpapa Robotic Kit, we used the following parts from the Robots 2030 Basic Robotic Kits:
- Arduino Uno
- Ultrasonic Sensor
- Servo Motor
Wiring (Taarein Jorna)
1. Ultrasonic Sensor:
- [VCC] to 5V
- [Trig] to Digital5
- [ECHO] to Digital 6
- [GND] to GND
2. Servo Motor
- Brown Wire to GND
- Red Wire to VIN
- Orange Wire to Digital 9
Code
#include <Servo.h>
Servo dustbinServo;
// Define pins
const int trigPin = 5;
const int echoPin = 6;
const int servoPin = 9;
// Variables
long duration;
int distance;
void setup() {
dustbinServo.attach(servoPin);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
dustbinServo.write(0); // Lid closed
Serial.begin(9600);
}
void loop() {
// Send ultrasonic pulse
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Read echo time
duration = pulseIn(echoPin, HIGH);
// Calculate distance (in cm)
distance = duration * 0.034 / 2;
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
// If object is near (less than 15 cm)
if (distance > 0 && distance < 15) {
dustbinServo.write(90); // Open lid
delay(3000); // Keep open for 3 seconds
dustbinServo.write(0); // Close lid
}
delay(300);
}Test Kaise Karein:
- Setup: Ek cardboard ka chota dabba lein, us par motor aur sensor chipkayen (Ya haath mein pakad kar test karein).
- Start: Code upload hone par motor 0 degree (Band) par hogi.
- Action: Sensor ke upar (15cm qareeb) apna haath layen.
- Reaction: Motor 90 degree ghoomegi (Dhakkan khul jayega).
- Finish: Haath hatayen, 3 second baad dhakkan wapis band ho jayega.
