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 Наука
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.
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.🙂❤️
Super bro
Thank you dear friend..🙂❤️
Super😊👌
Thank you..🙂
It doesn't show 0 and 1cm, it shows some random no like 1191cm, what should we do?
Hi friend. That is most probably because the ultrasonic sensor that you have used is faulty. Replacing the sensor should solve the problem..
why does it give me an error?
Hi friend. What is the error that it is showing?
im all right but it doesnt give me an out put
@@Science_4U_
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);
}
That is correct friend. That light blinking according to clock ticking will make it more interesting. .