Arduino Tutorial 54: Measuring Speed of Sound With HC-SR04 Sensor

  Рет қаралды 53,527

Paul McWhorter

Paul McWhorter

Күн бұрын

Пікірлер: 343
@rileypowis5319
@rileypowis5319 4 жыл бұрын
Paul has taught me more in a week than my teacher does in a year
@hemitpatel4758
@hemitpatel4758 3 жыл бұрын
faxs
@SciencewithRishit
@SciencewithRishit 2 жыл бұрын
He makes it so much interesting and the subject is also interesting
@sapnasinghal2997
@sapnasinghal2997 7 ай бұрын
Totes
@geralddrake4617
@geralddrake4617 4 жыл бұрын
I bought the Elegoo kit before I knew you existed. I bought it because I wanted to learn coding for micro controllers. Elegoo comes with a disk full of lessons (which I started doing), but I was not learning how to write the codes because I was only copying theirs. Then I searched the internet and found Paul McWhorter's most excellent tutorials and I am so glad. . Your teaching style does not endorse copying the codes, so I'm am learning to write them on my own while referring to your videos to check and correct myself. Thank you for doing these. Coding is becoming easier. I'm continuing until I run out of your lessons. Loving every minute.
@lancek2536
@lancek2536 4 жыл бұрын
Hello Paul, Just finished this tutorial #54 and having had a career in the US Airforce and flew for a few civilian airlines I was trained as a "Flight Engineer". We were taught about subjects having to do with altitude and the density of the air varies depending on primarily, temperature and altitude. So the speed of sound(or Mach) changes as these two variables change. Sea Lvl standard day(59 deg F, Sea Lvl) equates to a speed of sound of 761 mph as you stated. As altitude increases the speed of sound decreases. I really enjoyed this one, I finished my program before watching you tutorial and was pointing the sensor everywhere to get measurements. Quite accurate.
@waynedoman4165
@waynedoman4165 Ай бұрын
Paul, you have an amazing gift - not only do you manage to explain how to use the HC-SR04 sensor, guide us into the realisation we are measuring the speed of sound, but you also throw in the procedure for dimensional analysis - whilst keeping a smile on you face - Boom!!!!
@leebasham1107
@leebasham1107 2 ай бұрын
Hi Paul, just thought I would let you know, I have always struggled with maths (English), my maths tutor once said to me " the others get it, don't waste my time", basically I never understood how the maths worked, I just memorised formulae.This managed to get me through school and college and I went on to become a mechanical engineer for 10 years and an electronics engineer for the past 38 years. in doing this course I have not only learnt Arduino coding but also started to understand the maths at the root Level and for this, I am incredibly thankful. if only all teachers were as good as you.Once again Thank you.
@flyingsalmon
@flyingsalmon 3 жыл бұрын
Invaluable! Patience. Persistence. Critical thinking. When you get our math brain and the real-world empirical thoughts to collaborate, you can solve anything. Thank you Paul for your patience and genuine passion.
@willemwieriks4053
@willemwieriks4053 3 жыл бұрын
I did my homework and also used the LCD to show the distance! You Rock Paul!
@thomasmaxwell4396
@thomasmaxwell4396 2 жыл бұрын
same here
@Rtech98
@Rtech98 4 жыл бұрын
Figured out what was wrong with the calculation before you stated it, realized I made the same mistake as you did. Easily one of the best Arduino tutorials on KZbin.
@yigitpar6492
@yigitpar6492 2 жыл бұрын
There are so many so called teachers out there who tells you download their library, and sketches,maybe let you type 3 words, ( not even type, copy-paste) and they make you think that you do some stuff. Total BS... With your lessons, for the first time I really understand the logic&math behind it. And like that's not enough, for the first time, before this lesson everything was set on my LCD, measuring and showing distance :) because after I watched your previous video, I had extra time for tinkering. Had to pause a while and pushed myself a little. [ To be honest metric system made it easier :) ] Can't thank you enough, again... Thanks a lot
@leebasham1107
@leebasham1107 2 ай бұрын
Hi Paul, yes, I managed to do the homework. I even went a bit further and incorporated an I2C LCD display to the project to give user feedback. with the PSU board and PP3 battery, mine is portable, I used it in a simple mode (just swapped the Serial.prints to lcd.print commands to see the ping readings then doing the tests again, albeit with a longer delay to smooth the readings, I then re-worked the maths in metric and calculated my speed of sound at 776 @22Degrees C. I then re-worked the code to give me a readout in CM and formatted it to read nicely on the screen across both lines. Your teaching technique is superb and I have learnt so much since starting this course. keep up the great work and I shall now go and watch lesson 55. Cheers.
@tiberiumihaescu7348
@tiberiumihaescu7348 4 жыл бұрын
Did the same mistake while doing my homework :D. The ping is travelul the distance twice. Thank you for the lesson! A math refresher is always most welcome :D
@rbonari
@rbonari 4 жыл бұрын
Hello Paul, Another really amazing lesson. I love the math explanations in all of your lessons. No one explains these concepts in other tutorials and you not only explain, it but very clearly and in great detail, step by step !!!!!! Simply extraordinary and amazing !!!!! Please, You and Yours take care and GOD bless and be very safe and well !!!!! Rick
@jasonvictor9542
@jasonvictor9542 Жыл бұрын
This lesson blew my mind, i actually measured the speed of sound within 5% on my table and was able to see the signals on my cheap oscilloscope!!! Thank you so much, i love science, math and electronics and this is just incredible you are a great teacher!!!
@michaelredmond722
@michaelredmond722 Жыл бұрын
Hi Paul, Have been following your "most excellent" tutorials and just now calculated the speed of sound at near sea level in Queensland to be 334 m/s. The atmospheric pressure here right now is 1009.6 hP. I am really happy with that result. Thank you so much for your time and effort in publishing these videos.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Excellent!
@jeantorres3293
@jeantorres3293 3 жыл бұрын
Sorry I haven't been studying! Summer classes started and C++ is what we're learning, surprisingly your coding has helped me out a lot already!
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Great to hear!
@ravishankarkumarparibrajak4754
@ravishankarkumarparibrajak4754 3 ай бұрын
20:06 365 miles/hour means ultrasonic frequency is going to object and hitting it and coming back that total or average speed of whole path is measured
@BoasOpcoes
@BoasOpcoes Жыл бұрын
not only I did the homework, but I also displayed the information not on the serial screen, but directly on the LCD. Very very happy with this. THANK you very much, Mr. Paul, for your teaching!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@Ribiero
@Ribiero 4 жыл бұрын
This was a good lesson, i'm a computer science student doing this as a module, this was a good look back at my Physics A-Level.
@parthib.1555
@parthib.1555 Жыл бұрын
The mistake at 20:08 is that the ping time is the total time taken by the ping to cover twice the distance between the sensor and the obstacle, but we have either consider the distance only one time or we need to divide the ping travel time by 2 so that we get the actual speed of the ultrasonic wave in the air
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Exactly!
@robertmckelvey3091
@robertmckelvey3091 7 ай бұрын
I have learned more off of this KZbin channel than I ever did in school
@darthdaenerys
@darthdaenerys 3 жыл бұрын
8:51 m is the velocity of sound measured in inches per microseconds
@mr.manmon6367
@mr.manmon6367 4 жыл бұрын
No! This was not boring me, I've been studying physics thinking that it'd one day be handy with robotics and BAM. This video totally validated the studying, Thanks!
@scottshaffer70
@scottshaffer70 4 жыл бұрын
This was my favorite lesson so far. I was having trouble getting my measured travel time stable. It was driving me nuts. I was able to get smoother results by logging the last 15 readings and taking an average to use as my travel time. Using this technique, I was able to calculate the speed of sound to 771.1039 MPH. I find that I learn the most when I encounter problems that require troubleshooting on my own. Thanks Paul, you're great keep up the good work.
@samilnaml7636
@samilnaml7636 4 жыл бұрын
We gotta double the distance since ping goes and backs same distance twice. Paul, I love the way you doing mistake to show common errors. They become so useful for us.
@robhallquist1140
@robhallquist1140 4 жыл бұрын
First of all. Thank you for all of the excellent content. Instead of doing the homework, I did something a little different. I work at a job where my PC has to be locked every time I leave my desk. I occasionally forget to do this. That is when I had an idea. I can use the sensor to determine when I leave my office and automatically lock my computer. I wrote a C# program that will communicate to the Arduino via the serial port and when the distance of a certain range is detected it will automatically lock the computer.
@robertschuldenfrei2402
@robertschuldenfrei2402 Жыл бұрын
Once again, I did it in metric. It worked like a champ. The distance from my PC to the wall is 1.56m :). I am breaking for Christmas 2023. See you all in the New Year. Bob
@abdullahmuslim280
@abdullahmuslim280 4 жыл бұрын
You just got to love Paul and how he explains things. I do not get it all, but I do get enough to become a better Arduino Builder. Just 5 months ago or so, I started the Tutorials, and I was so happy to print out "Hello World" . That was 50+ Tutorials ago!!! Now only 14 more Tutorials to go!!!
@Zpheme12
@Zpheme12 4 ай бұрын
This was an amazing video, what you said at 9:15 is very true, wish you had more projects like this with math showing us. Hopefully you do more
@Zpheme12
@Zpheme12 4 ай бұрын
I wish you had more of these kinds of videos, this is like a full college course
@alexm.4720
@alexm.4720 2 жыл бұрын
*Edit @ 19:20 we calculated the Speed of Sound but we made a mistake when we measured with the ruler by not taking into account that the Sensor Pulse is actually traveling twice the distance. So, by doubling the measurments the final result would have been 730 mph which is close to the actual speed of sound which is 767 mph. @ 8:50 this number represents a distance per unit of time. In this case distance per μs.
@electronichome1153
@electronichome1153 2 жыл бұрын
Did my homework - the slope in the eastern hemisphere is 0.1786 [mm/usec] or 0.007 [in/usec]. Can't wait to see Paul's solution!
@tonygolden8622
@tonygolden8622 2 жыл бұрын
This was a terrific lesson. It makes one want to do backflips, well mental backflips any way. Such an amazing result with simple tools, math, and a little thinking.At first I thought the results would be way off looking at the data, but after plotting it and using least squares I got a result of 76O miles per hour. It got me thinking about so many things-sound waves vs light waves. Eyeballing a line was darn near as good as calculating the equation of the line.You are a terrific teacher. It was almost like a Sonic boom this time when you said BOOM.
@kevhopkins984
@kevhopkins984 4 жыл бұрын
I like the explanation of the maths, what we are looking at is the speed of the sonics (sound).
@Jim-mn7yq
@Jim-mn7yq 4 жыл бұрын
Very fun lesson. I ended taking two different measurements thinking I must have made a mistake. Then I realized I was off by a factor of 2, which clued me in. I also did it in meters per second, initially getting a value of 168.87 meters per second * 2 equals 337.74 , against a reported value of 324 meters per second at mean sea level. Again, great lesson, Paul, and well worth the effort.
@fatoumatabintadiallo6369
@fatoumatabintadiallo6369 2 жыл бұрын
These lessons are fun, and they really boost my self-confidence. I am seeing the world with a different set of eyes; thank you for making me realize that I can help make a better future for everyone by simply learning how to solve problems. There is nothing more important than understanding the magic behind how things work, in my opinion, and I am here for it. Thank you, You are the teacher every student should have.
@jalopyjones6460
@jalopyjones6460 4 жыл бұрын
You sir, are the best at explaining things in a manor that only someone who was deliberately trying not to learn... would still learn. Keep up the great work and be safe in your travels.
@hughpatterson1480
@hughpatterson1480 3 жыл бұрын
Yes, I found the problem early on, we missed the return trip. When correcting that, I got as close to the speed of sound in my calculation as you could, using the sensor. This was a great lesson and you can't do this stuff unless you are willing to do the math. If you don't do the math, you will not be able to troubleshoot the problems that come up. This video is going to be mandatory homework for my students. Thanks again Paul. I work through these videos, one a night, after teaching my classes and before dinner.
@hughpatterson1480
@hughpatterson1480 3 жыл бұрын
I ended up with 772, which was decent considering no matter how hard I tried to set up an accurate experiment, I ended up with some minor issues.
@xroppa5290
@xroppa5290 4 жыл бұрын
A nice example why i prefer the metric system. Thanks for your best Tutorials Mr McWhorter, greets from GER.
@zaidahmed6167
@zaidahmed6167 3 жыл бұрын
It's funny how Paul talks about people copy pasting the code and not learning while I was searching for someone to teach me and not just upload the code in the description.Thanks Paul .I want to learn. I am 15 by the way.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Good job! Keep learning and working hard and you will go very far in life.
@panzerblitz8226
@panzerblitz8226 2 жыл бұрын
Was able to dial in accuracy by playing with y=mx+b slope values by adj after measuring again. original calc had m=0.006. tweek it to use m=0.0069 and used a -0.18 for b value. It is now spot on down to 1" away. Interesting that the distance values increase when target is brought closer than 1", probably because ping and echo are too close to resolve? Very interesting lesson Paul, thank you again.
@dcpowered
@dcpowered 4 жыл бұрын
Hey Paul, thanks for keeping up with your video tutorials. I hope you stay safe during the pandemic. We need you to survive and continue to help and enlighten us with more Arduino knowledge!
@hiowei
@hiowei Жыл бұрын
I did it, I got the slope m=0.181 mm/microsecond, transferred to 7.13E-3 inch/microsecond, thanks Paul
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Well done!
@bokax1995
@bokax1995 2 жыл бұрын
Teacher that any student can just wish for. Thank you for good explaining.
@redneckwarriors1
@redneckwarriors1 3 жыл бұрын
i did the homework for this lesson in the previous lesson, i was ready for this one
@adnan.khuzema396
@adnan.khuzema396 4 жыл бұрын
I am a doer by the way I love your videos and I have learned a lot from you so all I want to tell you is thank you for your time.
@turatsell
@turatsell 3 жыл бұрын
I suspected that this is the case and Paul confirmed ("times two" error) I did my measuring in mm/μs (0,18625), which gave me 372,5 m/s. A bit too much but results are wavering +/- , around 360 m/s (must be 330, error around 9%). Uncertainty in measurements...Very interesting lesson! Thank you Paul! Love it!
@metoliusdad
@metoliusdad 4 жыл бұрын
"The key to being successful...in LIFE in general is knowing how to do dimensional analysis". Love this!! I wanna embroider this on a pillow, and I don't even embroider! (Honestly, I'm an ICU RN of 40years and used D.A. for drug infusion calculations before smart pumps came along).
@paulmcwhorter
@paulmcwhorter 4 жыл бұрын
And as a nurse then, you understand how important it is to get the math right EVERY time. I tell my students, that when you are school, get the math right 9 out of ten times you get an A and are a hero. In the real world, getting the math right 9 out of 10 times would be disaster. That would be like two dead people a day probably.
@souvikmandal1919
@souvikmandal1919 3 жыл бұрын
I uderstood that it was the speed of the sound but completely missed that the ping had to travel twice. Beautifully explained Paul. And yes , these math refreshers are interesting and very well explained.
@jimlabissonniere7400
@jimlabissonniere7400 4 жыл бұрын
Thanks Paul, another great project....can't wait to tackle it
@terryhoward986
@terryhoward986 3 жыл бұрын
Hi Paul did the homework but like a good engineer in Australia and most of the world I used SI units so was surprised to see you used imperial units and decimal inches at that, no big drama just a few quick conversions to get the same results. thanks again for another informative tutorial.
@andrewblack4100
@andrewblack4100 2 жыл бұрын
To be precise, all the world except USA, Liberia and Burma. And the last two are in the process of changing over. Still a very helpful video, though, as always.
@wendygrant2735
@wendygrant2735 2 жыл бұрын
Mr McWorther, why would this be boring? If it is, this is not your place to be. Right? I loved it.
@deivydchile
@deivydchile 4 жыл бұрын
Very good to touch the dimension analysis to this lesson
@lawrencex5745
@lawrencex5745 4 жыл бұрын
Great work Paul. If anyone is having the same problem as me I have a solution but there's sometimes more than one reason why something doesn't work. My Arduino Uno worked fine with this project but my Nano wouldn't upload. I had to change Tools>Processor from ATMega328P to ATMega328P(Old Bootloader). Then it worked fine. :-)
@richardwells2687
@richardwells2687 4 жыл бұрын
Hi Paul, your tutorials are fantastic, thank you. I've sent the Distance result to the LCD and with the press of a button select Temp and humidity...Boom..... waiting for my Nano to arrive. This has been so much fun. Cheers
@iank2615
@iank2615 4 жыл бұрын
Was just about to give up when I realised I'd left a zero out of my multiplier. I've been doing a lot of maths lately, and it's nice to have a real world application for it. Thanks Paul
@laxmanrao4554
@laxmanrao4554 4 жыл бұрын
I did my homework and I knew what i was trying to find out ( how much does the sound travel in inches for every unit of time in microseconds) . Thank you Paul. This channel is epic !
@pointer333
@pointer333 2 жыл бұрын
Not bored. Not angry. Excited because my homework was perfect with the exception of not remembering that slope is delta y/ delta x or dy/dx or VELOCITY. Truly cannot this AUDIO "ENGINEER" missed that! I knew we were using speed of sound to calculate distance, but somehow this connection hadn't occurred. So silly.
@cival919
@cival919 3 жыл бұрын
I love your teachings Paul and I want to definitely meet you someday😭❤️
@klrwhizkid
@klrwhizkid 4 жыл бұрын
I learned that way of ensuring units come out correct before considering the math back high school in 1971. The value of 365 is 1/2 of the speed of sound because the ping traveled twice the distance measured in the time measured, and the speed of sound is affected by air temperature; V(m/s) = 331.4 + .6(TempC), so results may vary.
@JoeV2257
@JoeV2257 3 жыл бұрын
I did it using the metric system and did it right, next thing I'm gonna try to make a radar using the servo motor and the sensor! (I know you love feet and inches in USA Paul, but no one else use them xD). Best lessons ever, thank you.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Nice work!
@SarkarMotion
@SarkarMotion 4 жыл бұрын
This sensor responds linearly with distance, but my dog becomes sadder exponentially the farther I go.
@filipegameiro4344
@filipegameiro4344 Жыл бұрын
I want to thank you for your videos. I learn a lot from your videos. The explanations that are given in the Arduino kits are very basic and poorly explained. A big thank you.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Glad you like them!
@vamer4926
@vamer4926 3 жыл бұрын
I did this in physics class this year, and I was lazy to find my ruler that keeps disappearing, so I just used the avg velocity as a constant to find the distance. Didn't expect to do the next video.
@marinehm
@marinehm 4 жыл бұрын
I love your videos. They make you think! I wish I had a teacher like you when I was growing up! Come to think of it. I did, she got married and moved away, replaced by an old monotone drab with zero excitement in what he was doing.
@dougnash6316
@dougnash6316 4 жыл бұрын
I did my measurements twice and found that the colour of the block made a difference. I used a white block for my second test and the numbers were higher than a box with some mixed brown colours on it. My speed came out to 830 mph with both sets of numbers so it must be that there is some inherent problem with the sensors that causes the error. Great lesson.
@aynursunagatullin7029
@aynursunagatullin7029 4 жыл бұрын
Thank you Mr.Paul! So cool! Didn't know about the *2 part of it haha. But it's still so cool that we can measure something as abstract as sound with a simple arduino.
@gilnasty82
@gilnasty82 2 жыл бұрын
The ping has to come back so the distance is doubled. Libraries and codes are great, but I want to understand what's going on, and you sir, are a master of explaining things!!
@PedroLuis-yp9ed
@PedroLuis-yp9ed 3 жыл бұрын
I didn't quite get what you meant by what m stood for but now it makes sense. As for the hw I was able to build a distance measurer but I did it using cross multiplication with the measurements I got. The slope formula just wasn't working for me but cross multiplication gives me accurate readings. Wrote a serial output to tell me the distance in cm, in, and ft. Its really cool how this works.
@nio_ng
@nio_ng 3 жыл бұрын
v=s/t => m is speed Again, thanks for those masterpiece lessons, Sir.
@nelsonvanwyk226
@nelsonvanwyk226 3 жыл бұрын
I am so glad that i am not the only one making mistakes .Thanks you are a great teacher
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
You are welcome!
@laserfixer
@laserfixer 4 жыл бұрын
Your explanations are perfect. I prefer to know how to things work so that I can figure out the problems for myself, since you will not be there forever to solve everyones problems. BTW I did figure out this problem on my own before your video.
@ericcinsalant9525
@ericcinsalant9525 4 жыл бұрын
Paul, cant say this enough, YOU ROCK
@opalprestonshirley1700
@opalprestonshirley1700 4 жыл бұрын
As long as you have lessons I'll be here. Always learn from your lessons. I forgot about the distance being double. Thanks Paul.
@caltech-wirewizard
@caltech-wirewizard 2 жыл бұрын
I took a 2-pronged approach to solving this. 1st, I used the Arduino to give me the travel times. where I got almost the same result as Paul and many of the followers below. So I thought let me confirm that by using my DSO Oscilloscope to capture the HIGH's of pin 11. I took the same measurements as using the Arduino. Turns out. My O'Scope was a more accurate. Example: my 2.25" measurement was 265uS on the O'Scope vs. My Arduino at 213uS. Using all measurements on the O'Scope, after the math I was at 756.58mph. Arduino was at 740.12mph. (Speed of sound is 761mph - depending a various factors, Temperature, Humidity, and elevation). In short, I find my O'Scope more accurate.
@Yousif_Maksabo
@Yousif_Maksabo 11 ай бұрын
the slope of this lines means that: increasing pingTravelTime by 1 microsecond is caused by increasing the distance between the object and the ultrasonic sensor by 0.00643 inches. I interpret the meaning of the slope by this expression, because in my opinion I see that the distance is the independent variable which we control ourselves, while the time is the dependent variable because it is caused by the change in the distance.
@opalprestonshirley1700
@opalprestonshirley1700 4 жыл бұрын
I have the circuit measuring the distance. Finally bought a oscilloscope. Love watching the pulse width increasing and decreasing.
@tobygibbes2111
@tobygibbes2111 3 жыл бұрын
10:59. the inches per microseconds is the velocity
@KoewachtDynamics
@KoewachtDynamics 4 жыл бұрын
Just love the fact that you explaine everything. Keep goïng!!!
@adeoguninioluwa192
@adeoguninioluwa192 2 жыл бұрын
I love you mc.paul ,i came across your video last month,you are amazing 💯💯💯. I wish you could be my real class teacher. I also do your homework.
@mikecollins6217
@mikecollins6217 4 жыл бұрын
Hi Paul, I have followed all your tutorials, and think you, and they are great. I hope you don't mind, but I took this turoial, and added the LCD screen to it, so I didn't need the serial port. With Corona virus, and being home working, I will work with my 10 year old submit a project to school on measuring the speed of sound. Thnaks agin so much, Mike
@noelomeli1520
@noelomeli1520 3 жыл бұрын
Your videos are amazing! You are giving us the tools we need to be successful engineers in the real world!
@Givegenerously24
@Givegenerously24 2 жыл бұрын
That's pretty cool! I'm really enjoying all these arduino lessons. Thank you for sharing your knowlege, Paul!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
My pleasure!
@idan4848
@idan4848 4 жыл бұрын
Thanks Paul, I did the homework - 0.0343(cm/microseconds).(time) = distance.
@CodingScientist
@CodingScientist 4 жыл бұрын
Very nice Paul keep going do not stop
@glennlindstrom9080
@glennlindstrom9080 4 жыл бұрын
Hello Paul! Just finished my homework with a little help. Found a way to save data from Arduino to a file. Open a command-window in Windows. At the prompt type the following command: type com6: >> dataLog.txt To stop logging use: ctrl-c The figure (6) may differ between computers. Take note of the filepath ( or write it into the command). Use notepad to read the results afterwards by opening the file. With regards Glenn
@richardwells2687
@richardwells2687 4 жыл бұрын
Glen, Thanks for that i'll be using that command a lot in the future, FYI my PC uses Com port #7
@KartihkCg80
@KartihkCg80 4 жыл бұрын
you are teaching how things work. Grate job sir respect you
@arseivan
@arseivan 2 жыл бұрын
Did the homework. My calculations are: given sos = 343 m/s, the formula is [distance = 343e2 * pingTravelTime/2/1e6] to get the distance in cm. e2 because we get cm from m by multiplying by 100, /2 to get half the travel time and /1e6 to get s from microseconds. Got the LCD printing out the results too.
@ledogu
@ledogu 3 жыл бұрын
Great lesson, loved it! My calculations came out 770mph. On to flip flopping the math.
@grelca
@grelca 2 жыл бұрын
the calculated slope means the sound waves are traveling at 0.00643x2 inches per microsecond. the times two is because the sound waves will actually reach the distance in half that time, and spend the other half traveling back to the sensor.
@grelca
@grelca 2 жыл бұрын
or about 326 m/s which is the standard unit for speed of sound
@grelca
@grelca 2 жыл бұрын
aaand i feel like i kind of already answered the second question when i answered the first... 365mph is HALF the speed of sound because it has to cover the distance between sensor and object twice. i wouldn’t call anything to this point a mistake, personally. it takes 365mph for the sound to travel there and back is just not the final answer for the final speed of the sound waves :) also absolutely no judgement from me on using mph vs m/s! they both work!
@paulbarrett1372
@paulbarrett1372 4 жыл бұрын
Thanks Paul, another great lesson in math, Thank you
@iqbalarabian7425
@iqbalarabian7425 3 жыл бұрын
Tried, Tried but could not succeed so came back to watch this Tutorial and PHEW, it seems i was doing somewhat 85% correct but in the way got my self in to converting time to hours but speed to KM's per hour hence all answers were wrong, Thank you Mr. Paul. (Minds Clear Now)=:)
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Trying and failing is as good as succeeding. If you try and fail before you watch me, then understand, that is true success. It is called LEARNING!
@always_broke_LOL
@always_broke_LOL Жыл бұрын
Good analytical explanation, thanks
@keithbrown162
@keithbrown162 11 ай бұрын
Another excellent video. I think the explanation about the travel distance being twice the measured distance could have been more compressed and the same time maybe used to explain how the speed of sound also varies with temperature. A good homework would be for the class to look up how that speed varies with sound and use the DHT11 to build and code a system to compensate for that. Lesson 54A maybe? Once again, thank you for your lesson!
@michelfeuiltault4013
@michelfeuiltault4013 4 жыл бұрын
fyi also i had placed the print command after the delay ans all sort of strange things happened. Great lessons Paul thanks
@bottledwater4212
@bottledwater4212 2 жыл бұрын
Really appreciate the in-depth videos. :)
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Glad to help!
@orchardenterprises3667
@orchardenterprises3667 Жыл бұрын
This is another awesome video! I wish he was my math teacher!
@roshandesilva1800
@roshandesilva1800 4 жыл бұрын
Mr. Paul you are doing grate about Arduino... I like to learn about Arduino so much, I'm a Electronic lover
@roshandesilva1800
@roshandesilva1800 4 жыл бұрын
thanks for your quick response
@mrktm65sx
@mrktm65sx 10 ай бұрын
Fantastic video, thank you Paul!
@dswilliams7543
@dswilliams7543 3 жыл бұрын
Great Lesson Still enjoying the math lesson
@Szienz
@Szienz 4 жыл бұрын
Good explainer again, and I know we shouldn't bash the imperial system, but thank god I'm on metric :-)
Arduino Tutorial 55:  Measuring Distance With HC-SR04 Ultrasonic Sensor
31:19
Arduino Tutorial 53: Understanding and Connecting the HC-SR04 Sensor
40:32
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 158 МЛН
Arduino Tutorial 60: Add a Go Button to your Distance Sensor
24:32
Paul McWhorter
Рет қаралды 34 М.
Fun with Transistors
24:33
HackMakeMod
Рет қаралды 647 М.
How the Clock Tells the CPU to "Move Forward"
14:22
Core Dumped
Рет қаралды 137 М.
Arduino Tutorial 37: Understanding How to Control DC Motors in Projects
31:25
Imaginary numbers aren't imaginary
13:55
Ali the Dazzling
Рет қаралды 231 М.
How to Make a Real Diamond - (Not Clickbait)
8:51
JerryRigEverything
Рет қаралды 754 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН