Тёмный

How to measure distance with an Arduino and Ultrasonic Sensor // HC-SR04 

Science Fun
Подписаться 6 тыс.
Просмотров 8 тыс.
50% 1

In this video I will show you a relatively accurate way to measure distance using and Arduino and an HC-SR04 ultrasonic sensor. I will walk you through the theory, setup, and coding using an Arduino.
The following are affiliate links for products that I use in this video. Purchases through these links will result in no increase in price for you, but may result in a small commission for me. These commissions will help me continue to make informative and entertaining videos such as this one. Thank you for your support and thanks for watching!
HC-SR04 Ultrasonic Sensor ebay.to/36ZAYva

Наука

Опубликовано:

 

27 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 16   
@kovejiuryu2800
@kovejiuryu2800 2 года назад
For people who are lazy const int triggerPin = 9; const int echoPin = 10; float pulse_width, distance; void setup() { // put your setup code here, to run once: pinMode(triggerPin, OUTPUT); pinMode(echoPin, INPUT); Serial.begin(9600); digitalWrite(triggerPin, LOW); delayMicroseconds(2); } void loop() { // put your main code here, to run repeatedly: digitalWrite(triggerPin, HIGH); delayMicroseconds(10); digitalWrite(triggerPin, LOW); pulse_width = pulseIn(echoPin, HIGH); distance = (pulse_width*.343)/2; Serial.print("Distance = "); Serial.println(distance); Serial.println(" cm"); delay(500); }
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
Thanks for watching.
@anshulmadurwar8132
@anshulmadurwar8132 2 года назад
Thanks Bro :)
@sergiolopez6339
@sergiolopez6339 2 года назад
absolute legend
@GoedBezig2004
@GoedBezig2004 Год назад
Thanks, saved me another 5 min of typing lol
@laurenmcadams2798
@laurenmcadams2798 Год назад
king shit
@ybasyionnamishka8773
@ybasyionnamishka8773 4 месяца назад
will this work on infrared sensor?
@ScienceFunInnovations
@ScienceFunInnovations 4 месяца назад
I haven't used infared sensors, so I couldn't tell you for sure. Sorry!
@sanjogbelose943
@sanjogbelose943 Год назад
will this project work with arduino nano ??
@ScienceFunInnovations
@ScienceFunInnovations Год назад
Yes. Arduino UNO and NANO use the same pinouts, so the code switches over nicely.
@rodhenagujero5144
@rodhenagujero5144 2 года назад
Hello sir...i really appreciate your videos....I would like to know if I can contact you thru email? I would like to ask some advice regarding my project....from the 🇵🇭🇵🇭🇵🇭...thank you in advance...
@ScienceFunInnovations
@ScienceFunInnovations 2 года назад
ScienceFunBiz@gmail.com
Далее
Я ВЕРНУЛСЯ 🔴 | WICSUR #shorts
00:57
Просмотров 2,3 млн
Угадай МОБА 1 🥵 | WICSUR #shorts
01:00
Просмотров 718 тыс.
Fast and Furious: New Zealand 🚗
00:29
Просмотров 5 млн
Laser vs Ultrasonic - TOF10120 vs. HC-SR04
31:09
Просмотров 181 тыс.
Try these 16 Brilliant ESP32 projects!!!
11:18
Просмотров 556 тыс.
The bizarre flashing lights on a smartwatch
13:29
Просмотров 2,8 млн
APPLE дают это нам БЕСПЛАТНО!
1:01
Просмотров 771 тыс.
ЗАБЫТЫЙ IPHONE 😳
0:31
Просмотров 18 тыс.
Новодельный ноутбук Pocket386
1:16:17