How to make a Smart Rubbish Bin with Arduino

Поделиться
HTML-код
  • Опубликовано: 11 янв 2025

Комментарии • 13

  • @leelameka
    @leelameka 5 месяцев назад

    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 : )

  • @johannaarboleda9358
    @johannaarboleda9358 10 месяцев назад

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

  • @rayannkhadheeja1133
    @rayannkhadheeja1133 9 месяцев назад +1

    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

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

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

    • @SparkLabz
      @SparkLabz  10 месяцев назад +12

      /*********
      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 Год назад

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

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

      @@SparkLabz Ta very much.

    • @ChukwuebukaOnyeukwu
      @ChukwuebukaOnyeukwu 4 месяца назад

      @@SparkLabz

    • @dylangomez4435
      @dylangomez4435 Месяц назад

      @@SparkLabz Thanks homie, very intimate surprise is on the way :)

  • @dylangomez4435
    @dylangomez4435 Месяц назад

    Shits fire bro mind if i borrow it ? Send me the code rq please and thank you.

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

    fygfl

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

    This is rubbish. AHA