HC-SR04 Ultrasonic Distance Sensor and Arduino (Lesson #9)

  Переглядів 58,124

Science Buddies

Science Buddies

День тому

Science Buddies Electronics Kit for Arduino: www.homesciencetools.com/prod...
Learn how to use the HC-SR04 ultrasonic distance sensor, also called a sonar sensor, to measure the distance to a nearby object using an Arduino. We have a separate video that covers the PING))) ultrasonic distance sensor: • PING Ultrasonic Distan... . See our complete playlist of Arduino tutorials here: • How to Use an Arduino and the Science Buddies website for cool science projects you can do with an Arduino: www.sciencebuddies.org/search....
0:00 intro
0:48 Arduino connections
1:05 datasheet
2:00 code
4:35 comparing the HC-SR04 and the PING
Science Buddies also hosts a library of instructions for over 1,500 other hands-on science projects, lesson plans, and fun activities for K-12 parents, students, and teachers! Visit us at www.sciencebuddies.org to learn more.
#STEM #sciencebuddies #arduino #electronics #programming
*******************************
Connect with Science Buddies:
TWITTER: / sciencebuddies
FACEBOOK: / sciencebuddies
INSTAGRAM: / scibuddy
PINTEREST: / sciencebuddies

КОМЕНТАРІ: 27
@hazelfunnehfangirl5hamburg805
@hazelfunnehfangirl5hamburg805 6 місяців тому
thank u helped me before getting killed in the program class dude for forgetting to save the process
@maximarkhipov2186
@maximarkhipov2186 Місяць тому
Thanks for the detailed and easy to understand video helped me a lot !!
@thesuitedsaltshaker8388
@thesuitedsaltshaker8388 Рік тому
thank you man, helped me a lot
@k0rnluvr
@k0rnluvr Рік тому
Great vid! thanks
@motomichinakamura6413
@motomichinakamura6413 2 місяці тому
Is there any enclosure or casing available for this setting?
@Pet-vk3ig
@Pet-vk3ig Місяць тому
Nice, good job
@Studs_Studio
@Studs_Studio 2 місяці тому
this is amazing! i made it so if youre too close a buzzer starts beeping. i want to use this on an rc car to automaticly stop
@Science.Buddies
@Science.Buddies 2 місяці тому
Check out the rest of our tutorials and videos on our channel, we have instructions for autonomous/RC robots as well!
@yehonatankalandarev6343
@yehonatankalandarev6343 4 місяці тому
I want to make a disc shooter that can be attached to the arm, and I want to add a control system to it, basically when the palm "blocks" the shot, the disc shooter will not fire. So I thought to connect this sensor to perform this operation, do you think it is correct? Does it suit my needs?
@Science.Buddies
@Science.Buddies 4 місяці тому
This sensor would work to detect when an object is within a certain distance. Please see our other Arduino tutorials linked in the description of this video.
@CoolOjas02
@CoolOjas02 11 місяців тому
Code? Can you give doc
@adityamandal2456
@adityamandal2456 Рік тому
In your Automatic Braking project using Ultrasonic sensor, I have changed the PING))) sensor to HCSR04. But there's a line in the code saying distance = readUltrasonic(pingPin) Now how to change that👆
@Science.Buddies
@Science.Buddies Рік тому
The program in that project uses a function to read the ultrasonic sensor instead of putting all of the code directly in the loop() function. So, you would need to change the function to use two pins instead of one. For example, the call to the function could be distance = readUltrasonic(trigPin, echoPin) and then the first line of the function would be long readUltrasonic(int pin1, int pin2). You would then change the code in the function to use pin1 (corresponding to trigPin) and pin2 (corresponding to echoPin). We're glad that you asked about this because I realized there is actually an error in the existing example program - the way it's written now, the readUltrasonic function should use the "pin" variable inside the function, not "pingPin." so for example the line pinMode(pingPin, OUTPUT); should be pinMode(pin, OUTPUT). Hope that helps! We will update the example code.
@adityamandal2456
@adityamandal2456 Рік тому
@@Science.Buddies Thanks for the information 👍
@joshhallwatp3783
@joshhallwatp3783 17 днів тому
Also saying pinmode was not declared in this scope
@MotomichiStudio
@MotomichiStudio 2 місяці тому
How far can the sensor work in terms of distance?
@itsnd64
@itsnd64 Місяць тому
~400cm
@imahumanbe1ng
@imahumanbe1ng 19 днів тому
does this work with arduino maker uno x???
@Science.Buddies
@Science.Buddies 19 днів тому
We haven't used the Maker Uno X but it is listed as fully compatible with the Arduino Uno R3, so it should.
@joshhallwatp3783
@joshhallwatp3783 17 днів тому
When writing the exact same code it comes up with trigpin was not declared in this scope pinmode
@Science.Buddies
@Science.Buddies 16 днів тому
The Arduino code is case sensitive, make sure your code matches the example exactly (pinMode and trigPin)
@joshhallwatp3783
@joshhallwatp3783 16 днів тому
@@Science.Buddies yeah forgot the capital for M
@Sabbir-ln3bx
@Sabbir-ln3bx 20 днів тому
how do you use it with LEDs?
@Science.Buddies
@Science.Buddies 19 днів тому
Please see our Arduino tutorial playlist which covers LEDs: ukposts.info/slow/PLlBVuTSjOrclb0iCMSRpS_H1lSrlSVeEm&si=cyCw5jX3CNvyX5me
@gauthierwouters2593
@gauthierwouters2593 11 місяців тому
how to do the lights?
@Science.Buddies
@Science.Buddies 11 місяців тому
If you check out our Arduino tutorial playlist (linked in the description) you will find other videos about controlling LEDs.
Control a Positional Servo Motor with an Arduino (Lesson #10)
8:28
Science Buddies
Переглядів 31 тис.
Kitten has a slime in her diaper?! 🙀 #cat #kitten #cute
00:28
I PUT MY ARMOR ON (Creeper) (PG Version)
00:19
Sam Green
Переглядів 6 млн
КИРПИЧ ОБ ГОЛОВУ #shorts
00:24
Паша Осадчий
Переглядів 5 млн
PING Ultrasonic Distance Sensor and Arduino (Lesson #8)
5:14
Science Buddies
Переглядів 16 тис.
Arduino Ultrasonic Motion Sensor: Motion Sensor and LED project
17:20
Arduino Tutorial 53: Understanding and Connecting the HC-SR04 Sensor
40:32
Paul McWhorter
Переглядів 110 тис.
Sensors - which one to use
17:06
Electronoobs
Переглядів 1,3 млн
Laser vs Ultrasonic - TOF10120 vs. HC-SR04
31:09
DroneBot Workshop
Переглядів 175 тис.
Уроки Ардуино. ПИД регулятор
28:57
Заметки Ардуинщика
Переглядів 446 тис.
Ultrasonic Sensor HC-SR04 and Arduino Tutorial
5:16
How To Mechatronics
Переглядів 1,4 млн
Distance Measurement / Ultrasonic Sensor / AJ-SR04M
6:11
0033mer
Переглядів 2,6 тис.
Kitten has a slime in her diaper?! 🙀 #cat #kitten #cute
00:28