How to make a Smart Rubbish Bin with Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 ก.ค. 2023
  • In this video I demonstrate how to make a motion activated smart rubbish bin / trashcan / dustbin with an Arduino uno, HC-SR04 ultrasonic sensor and a servo motor.
    #diy #arduino #project #smartgadgets #smart #electronics #robotics #tutorial #servo #sensor #ultrasonic
    How to make arduino controlled bin? How to use servo or ultrasonic sensor with arduino? Arduino controlled bin tutorial? This video has you covered.
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 10

  • @leelameka
    @leelameka 3 วันที่ผ่านมา

    Brilliant! I love that your daughter helped too : )
    I watched another video of a bin done , but they had the stuff wired inside the bin- this is much better : )

  • @rayannkhadheeja1133
    @rayannkhadheeja1133 4 หลายเดือนก่อน

    why is the servo motors red wire and ultrasonic sensor vcc conected to the same place in the arduino 5v??how am i supposed to connect ?,also can u please show the wiring part more clearly?,ty

  • @johannaarboleda9358
    @johannaarboleda9358 4 หลายเดือนก่อน

    Hello!, can you list the materials needed for this project?, like what type of wires do I need?

  • @jesay4632
    @jesay4632 5 หลายเดือนก่อน +1

    Can you help me in programming.....can you send me the program of this video

    • @SparkLabz
      @SparkLabz  5 หลายเดือนก่อน +4

      /*********
      SparkLabz - Motion activated bin
      *********/
      #include
      #define TRIG 10
      #define ECHO 9
      #define SERVO A1
      // Ultrasonic sensor variables
      long duration;
      float distance;
      // Servo variables
      Servo myServo;
      void setup() {
      Serial.begin(115200); // Start serial communication
      pinMode(TRIG, OUTPUT); // Set trigger pin as an Output
      pinMode(ECHO, INPUT); // Set echo pin as an Input
      myServo.attach(SERVO); // Attach servo pin
      }
      void loop() {
      // Clear trigger pin
      digitalWrite(TRIG, LOW);
      delayMicroseconds(5);
      // Set triggerPin to HIGH for 10uS
      digitalWrite(TRIG, HIGH);
      delayMicroseconds(10);
      digitalWrite(TRIG, LOW);
      // Read echoPin and get sound wave travel time in microseconds
      duration = pulseIn(ECHO, HIGH);
      // Calculate distance
      distance = (duration/2.0)/29.0;
      // Prints distance to Serial Monitor
      Serial.print("Distance (cm): ");
      Serial.println(distance);
      if (distance < 50) {
      // If something is closer than 50cm, open the bin
      myServo.write(180);
      delay(5000);
      } else {
      myServo.write(0);
      delay(15);
      }
      delay(100);
      }

  • @DaveT23
    @DaveT23 7 หลายเดือนก่อน

    Hi, your video mentions that you'll pin the code in the comments, but I can see it. Are you able to provide a link?

    • @SparkLabz
      @SparkLabz  5 หลายเดือนก่อน +1

      /*********
      SparkLabz - Motion activated bin
      *********/
      #include
      #define TRIG 10
      #define ECHO 9
      #define SERVO A1
      // Ultrasonic sensor variables
      long duration;
      float distance;
      // Servo variables
      Servo myServo;
      void setup() {
      Serial.begin(115200); // Start serial communication
      pinMode(TRIG, OUTPUT); // Set trigger pin as an Output
      pinMode(ECHO, INPUT); // Set echo pin as an Input
      myServo.attach(SERVO); // Attach servo pin
      }
      void loop() {
      // Clear trigger pin
      digitalWrite(TRIG, LOW);
      delayMicroseconds(5);
      // Set triggerPin to HIGH for 10uS
      digitalWrite(TRIG, HIGH);
      delayMicroseconds(10);
      digitalWrite(TRIG, LOW);
      // Read echoPin and get sound wave travel time in microseconds
      duration = pulseIn(ECHO, HIGH);
      // Calculate distance
      distance = (duration/2.0)/29.0;
      // Prints distance to Serial Monitor
      Serial.print("Distance (cm): ");
      Serial.println(distance);
      if (distance < 50) {
      // If something is closer than 50cm, open the bin
      myServo.write(180);
      delay(5000);
      } else {
      myServo.write(0);
      delay(15);
      }
      delay(100);
      }

    • @leelameka
      @leelameka 3 วันที่ผ่านมา

      @@SparkLabz Ta very much.

  • @andradedanangeloc.145
    @andradedanangeloc.145 หลายเดือนก่อน

    fygfl

  • @thomashall4946
    @thomashall4946 2 หลายเดือนก่อน

    This is rubbish. AHA