Ad Code

Responsive Advertisement

Ticker

6/recent/ticker-posts

How To Make DIY Automatic Dustbin using Arduino & Bluetooth by WTC Zone

How To Make DIY Automatic Dustbin using Arduino & Bluetooth by WTC Zone


A Smart Dustbin using an IR sensor, servo motor, and Arduino is a practical project where the dustbin lid opens automatically when it detects an approaching object (like a hand). This setup is great for touchless interaction and is especially useful for improving hygiene.

Parts Required

  1. Arduino Uno (or any Arduino compatible board)
  2. IR Sensor Module
  3. Servo Motor (preferably a small one like SG90)
  4. Breadboard and Jump Wires
  5. Power Supply (5V or USB power for Arduino)
  6. Dustbin lid or model dustbin for attaching the servo

Circuit Connections

  1. IR Sensor Connections:

    • VCC pin of IR Sensor → 5V on Arduino
    • GND pin of IR Sensor → GND on Arduino
    • OUT pin of IR Sensor → Digital Pin 2 on Arduino
  2. Servo Motor Connections:

    • VCC (Red wire) of Servo → 5V on Arduino
    • GND (Black wire) of Servo → GND on Arduino
    • Signal (Yellow/White wire) of Servo → Digital Pin 9 on Arduino

Circuit Diagram

Video Link: - Click Here For Video

How To Make DIY Automatic Dustbin using Arduino & Bluetooth by WTC Zone simple Circuit: -



How To Make DIY Automatic Dustbin using Arduino & Bluetooth by WTC Zone Arduino Programming: -

Arduino IDE Program

The code uses the IR sensor to detect an object in front of the dustbin. When the sensor detects an object within its range, the servo motor rotates to open the lid. After a short delay, the servo rotates back to close the lid

#include <Servo.h>

// Pin definitions
const int irSensorPin = 2;   // IR sensor pin
const int servoPin = 9;      // Servo motor pin

// Servo object
Servo servo;

void setup() {
  // Initialize IR sensor pin
  pinMode(irSensorPin, INPUT);
 
  // Attach servo motor to pin
  servo.attach(servoPin);
 
  // Close lid initially
  servo.write(0);  // 0 degrees (closed position)
 
  // Begin serial communication (optional for debugging)
  Serial.begin(9600);
}

void loop() {
  int irValue = digitalRead(irSensorPin);  // Read IR sensor
 
  if (irValue == LOW) {  // Object detected (typically LOW)
    Serial.println("Object detected. Opening lid...");
    servo.write(60);  // Open the lid (90 degrees)
    delay(3000);      // Keep lid open for 3 seconds
    servo.write(0);   // Close the lid
    Serial.println("Lid closed.");
  }
 
  delay(100);  // Small delay for sensor stability
}



-----------------------------------------------------------------------------------------------------------------------------

Description of the Process

  1. IR Sensor Detection:

    • The IR sensor continuously monitors for objects in front of the dustbin. When it detects an object (e.g., a hand approaching), it sends a signal to the Arduino. In this setup, the IR sensor’s OUT pin goes LOW when an object is detected within its range.
  2. Servo Motor Action:

    • Upon receiving a LOW signal from the IR sensor, the Arduino triggers the servo motor to rotate, causing the dustbin lid to open. The servo.write(60); command in the code rotates the servo to 90 degrees, opening the lid.
  3. Closing Mechanism:

    • After a short delay (3 seconds), allowing time for the user to dispose of waste, the servo returns to its original position (0 degrees) to close the lid. The servo.write(0); command resets the servo, closing the lid.
  4. Loop and Repeat:

    • The Arduino continues to loop through this cycle, waiting for the IR sensor to detect a new object to reopen the lid.

Explanation of Key Code Sections

  • Servo servo;: Creates a servo object to control the servo motor.
  • servo.attach(servoPin);: Binds the servo object to the specified pin.
  • if (irValue == LOW): Checks if the IR sensor detects an object by reading the sensor’s output.
  • servo.write(90); and servo.write(0);: Commands to rotate the servo to specific angles for opening and closing the lid.

Testing and Final Adjustments

  1. Test the Range: Adjust the IR sensor’s range for optimal performance (most IR sensors have a small potentiometer for range adjustment).
  2. Servo Calibration: Test the servo positions to ensure the dustbin lid fully opens and closes.
  3. Power Management: Ensure the servo has adequate power. If it struggles, use an external 5V power supply to support it.

This project provides a clean, touch-free way to open a dustbin and can be expanded with additional sensors or a battery-powered setup for complete portability.

Circuit Simulation:

You can not use Tinkercad to simulate this project as there is no IR Sensor available in tinker cad yet. Let me know if you need more details or help setting up.

Share, Support, and Subscribe!!! 1. PRO KAM EXPLAINED 2. Knowledge KAM 3. PRO KAM Follow us on 1. Facebook 2. Instagram 3. Pinterest 4. Blogspot 5 Twitter If you have any other ideas to make me design, you can describe them in the comment section and if I can, I will make a designing video on it. So I am waiting #prokam #wtc #Arduino #ideas #projects #diy #how #to #ArduinoProjects #UltrasonicSensor #HeightMeasurement #TechDIY #WeTechCreators

Post a Comment

0 Comments

Ad Code

Responsive Advertisement