Это видео недоступно.
Сожалеем об этом.

How to make a Smart Rubbish Bin with Arduino

Поделиться
HTML-код
  • Опубликовано: 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 23 дня назад

    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 5 месяцев назад

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

  • @jesay4632
    @jesay4632 6 месяцев назад +2

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

    • @SparkLabz
      @SparkLabz  6 месяцев назад +7

      /*********
      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 8 месяцев назад

    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  6 месяцев назад +2

      /*********
      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 23 дня назад

      @@SparkLabz Ta very much.

  • @andradedanangeloc.145
    @andradedanangeloc.145 2 месяца назад

    fygfl

  • @thomashall4946
    @thomashall4946 3 месяца назад

    This is rubbish. AHA