Distance Meter / Range Finder using Arduino Uno & HC -SR04 ultrasonic sensor || Arduino Project

Поделиться
HTML-код
  • Опубликовано: 3 июл 2024
  • Hello friends,
    In today's video I am going to show you how to make a distance meter using Arduino Uno & HC -SR04 ultrasonic sensor. The distance meter is used to measure very accurately the distance to different objects. The range of measurement is also very high upto 4 metres. This can also serve as a range finder.
    In this video, I am also showing the comparison of the measured distance using the distance meter and a standard measuring tape.
    Link to download code:
    drive.google.com/file/d/1LtlI...
    Link for purchasing components used:
    1. Arduino Uno board : amzn.eu/d/iH03OHj
    2. SSD 1306 OLED Display : amzn.eu/d/japtXGj
    3. HC-SR04 Ultrasonic Sensor : amzn.eu/d/i5OkXM7
    4. 9V Battery with connector : amzn.eu/d/iDuP5cx
    5. Rocker Switch : amzn.eu/d/hfcMMYP
    🎵 Song: 'Markvard - Dreams' is under a creative commons license license.
    ruclips.net/channel/UC8zg...
    🎶 Music promoted by BreakingCopyright:
    • 🛀 Soothing & Chill Out...
    Please share, like the video and SUBSCRIBE to my channel for watching more interesting videos in future. Thank You...❤
    #arduinoproject
  • НаукаНаука

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

  • @zuss
    @zuss 6 месяцев назад +1

    Great project, good detailed description. I really like the comparison you did with the ruler to test the accuracy of the ultrasonic sensor. Keep up the great work! I subscribed to your content, looking forward to more of your innovative videos.

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

      Thank you dear friend. Words of appreciation like these are the motivation to do more such projects and share with everyone.Thanks a lot once again.🙂❤️

  • @gokilagokila3793
    @gokilagokila3793 4 месяца назад +1

    Super bro

    • @Science_4U_
      @Science_4U_  4 месяца назад +1

      Thank you dear friend..🙂❤️

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

    Super😊👌

  • @royalnavghan2406
    @royalnavghan2406 3 месяца назад +1

    It doesn't show 0 and 1cm, it shows some random no like 1191cm, what should we do?

    • @Science_4U_
      @Science_4U_  3 месяца назад +1

      Hi friend. That is most probably because the ultrasonic sensor that you have used is faulty. Replacing the sensor should solve the problem..

  • @user-xx5vq6mf3f
    @user-xx5vq6mf3f 4 месяца назад +2

    why does it give me an error?

    • @Science_4U_
      @Science_4U_  4 месяца назад +1

      Hi friend. What is the error that it is showing?

    • @user-xx5vq6mf3f
      @user-xx5vq6mf3f 4 месяца назад

      im all right but it doesnt give me an out put
      @@Science_4U_

  • @user-zk9tv9qs9f
    @user-zk9tv9qs9f 5 месяцев назад +1

    const int ledPin = 13; // You can connect an LED to pin 13 to simulate a clock ticking
    void setup() {
    pinMode(ledPin, OUTPUT);
    Serial.begin(9600);
    }
    void loop() {
    static unsigned long lastMillis = 0;
    const unsigned long interval = 1000; // Update every 1000 milliseconds (1 second)
    unsigned long currentMillis = millis();
    if (currentMillis - lastMillis >= interval) {
    // Update the clock every second
    lastMillis = currentMillis;
    // Simulate the clock ticking by toggling the LED
    digitalWrite(ledPin, !digitalRead(ledPin));
    // Print the time to the Serial Monitor
    printTime();
    }
    }
    void printTime() {
    // Get the current time
    unsigned long seconds = millis() / 1000;
    unsigned long minutes = seconds / 60;
    unsigned long hours = minutes / 60;
    // Print the time to the Serial Monitor
    Serial.print(hours % 24); // Use % 24 to keep the time within a 24-hour format
    Serial.print(':');
    printDigits(minutes % 60);
    Serial.print(':');
    printDigits(seconds % 60);
    Serial.println();
    }
    void printDigits(int digits) {
    // Add leading zero if the value is less than 10
    if (digits < 10) {
    Serial.print('0');
    }
    Serial.print(digits);
    }

    • @Science_4U_
      @Science_4U_  5 месяцев назад +1

      That is correct friend. That light blinking according to clock ticking will make it more interesting. .