Arduino Tutorial 53: Understanding and Connecting the HC-SR04 Sensor

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 มิ.ย. 2024
  • You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
    / paulmcwhorter
    IN this lesson we begin to explore the HC-SR04 Ultrasonic Sensor, and show how you can connect and program the sensor. We will get our first sketch, which will measure the ping travel time.
    You can get the kit I am using for this series at the following link:
    amzn.to/2I7N4Ek
    I strongly suggest picking up an arduino nano, since it can plug directly into the breadboard, making a portable system more practical. You can pick one up here:
    amzn.to/2WXTC2M
    As projects get more complicated in these lessons, you guys really need to get a set of breadboard jumper wires which allow you to make neater connections on the board in your projects. You can pick a pack of these wires up here:
    amzn.to/2XrY5Kq
    In addition as projects get more complicated, you are going to need a bigger breadboard. This is a reasonable one here:
    amzn.to/2IY4d3M
    Check out our lessons on our WEB site;
    toptechboy.com/arduino-tutori...
    [Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. This means if you visit the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.]
    #Arduino
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 407

  • @stephenmarshall1286
    @stephenmarshall1286 4 ปีที่แล้ว +50

    No-one hates you Paul, keep producing these LEGENDARY videos !!!

    • @aaronmilliman7685
      @aaronmilliman7685 ปีที่แล้ว +6

      Paul is amazing, no wait, he is definitely Legendary. I never finished college and had to work and raise my 2 children. Now that they are off to college I can start my education. Thank you very much Paul.

    • @simontopley4771
      @simontopley4771 6 หลายเดือนก่อน

      if anyone hates on you, it says more about them, i really struggle with the maths, it is what it is, i can't get it, after 50+ years in academia, i simply don't get that type of maths. As humans we have strengths and weaknesses, it's better to make the best of your strengths. I try, i do.

  • @blainecarvalho8368
    @blainecarvalho8368 3 ปีที่แล้ว +12

    The concept of "we are not going to use canned codes" are exactly why I have watched ALL of these videos, moved on to your python videos and have come back to c++ between video releases. I will definitely have to check out the rest of the coding subjects. the knowledge you are sharing here is priceless.

  • @sobhitdas3071
    @sobhitdas3071 4 ปีที่แล้ว +32

    Our new, our epic, our legendary Arduino tutorial series

  • @g0fvt
    @g0fvt 4 ปีที่แล้ว +26

    With the current lockdown a fellow radio ham in our village has been playing with an arduino (he is over 80). He messaged me when he had a problem with it, he had been following one of your earlier tutorials. I was able to get him back on the right track but have also ordered an arduino for myself. I already have a selection of compatible sensors. I have a background in electronic design but have steered clear of microprocessors in my projects. Your videos have been very helpful already and I am already planning some practical applications. Thank you for the huge effort in making the videos, extremely useful.

  • @aungphyokyaw4475
    @aungphyokyaw4475 29 วันที่ผ่านมา

    slope of the line is m=0.00757. Thank you for pushing and making us to think independently. In life, we need to solve our own problems, we are responsible for our lives . The teachers and coaches are only to help us guide. We have to walk our own path.

  • @DeeGeeDeFi
    @DeeGeeDeFi 3 ปีที่แล้ว +68

    I want to make a tee shirt, of Paul cringing and holding his breath when uploading the sketch to the arduino.

    • @barbaraorzechowska6479
      @barbaraorzechowska6479 3 ปีที่แล้ว +2

      I would buy it ;)

    • @flyingsalmon
      @flyingsalmon 3 ปีที่แล้ว

      I actually have! But kept couple of the designs to myself...I think I should ask Paul about that ;)

    • @killsme6957
      @killsme6957 2 ปีที่แล้ว

      I like the" don't let the smoke out, once it's out it's hard to get it back" HAHAHA

    • @emporersteve
      @emporersteve 10 หลายเดือนก่อน

      Definitely would buy

    • @emporersteve
      @emporersteve 10 หลายเดือนก่อน

      ​@@killsme6957so hard

  • @ricklawitzky8311
    @ricklawitzky8311 2 ปีที่แล้ว +6

    I love how you connect these lessons with math! I have found the slope "0,0175" for cm and the slope "0,007" for inch.

  • @gilnasty82
    @gilnasty82 2 ปีที่แล้ว +3

    I got a slope of 0.006. I do believe the important fact you are getting at, is the speed of sound! Great project!! Anyone that hates you for doing the math and explaining how things work can just skate by in life and keep doing it the easy way! There are plenty of us that enjoy learning from you!! Thank you, Paul!!

  • @scenicwild
    @scenicwild 3 ปีที่แล้ว +4

    Hi Paul, thanks for all the tutorials, they are great. Here in Austria, the equation is y = 0,0174x + 0,365 [y in cm] // or equals y = 0,0069x + 0,1437 [ y in inches]
    thanks for the good work!

  • @Gallardo6669
    @Gallardo6669 7 หลายเดือนก่อน +2

    PAUL: thank you from my heart for all these fantastic videos!!!!!!!!!!!
    Pls continue this series ❤❤❤

  • @ronkline8726
    @ronkline8726 2 ปีที่แล้ว +2

    No haters are allowed in this house. I REALLY appreciate the use of the oscilloscope in the video. It took me a while to observe the changes in pulse with. I recently purchased a small handheld oscilloscope so this is helping me learn the Arduino side of things and also how to use a new piece of test equipment. Thank you !!

  • @libbytardalo2071
    @libbytardalo2071 3 ปีที่แล้ว +1

    I ended up with .126, but after I read some of your comments (Thanks, gang!), I realized I had to divide for the two way travel and ended up at .063, which is perfect for my distance.
    Thanks again for all of this, Paul!

  • @lawrencex5745
    @lawrencex5745 4 ปีที่แล้ว

    Here from the UK. My slope came in at .064inch/microsecond.After your last lesson glad to see my kit is working. Great work Paul. :-)

  • @stevesykes295
    @stevesykes295 2 ปีที่แล้ว

    Love this lesson. We use these sensors to detect the thickness of paper in my equipment. My ruumba also uses them to turn from stairs and not fall down them. I will update on my success with the homework assignment.

  • @matthewcollins1858
    @matthewcollins1858 ปีที่แล้ว +2

    Present. I really do love your tutorials and the fact that you're actually teaching me how to do it on my own. I plan on using the knowledge you have provided in order to build my own toys and inventions, kind of hard to copy and paste if it's somewhat original. So yea thank you very much.

  • @rolandberendonck3900
    @rolandberendonck3900 3 ปีที่แล้ว +1

    Oh my God, I am enjoying your tutorials so much!!!

  • @mohsenr4434
    @mohsenr4434 2 ปีที่แล้ว +1

    The accuracy of the slope of the line is very important for converting the time data to distance. I did the homework assignment and attached an lcd which shows distance on display. Works perfectly! 👌🙏

  • @banerz
    @banerz 3 ปีที่แล้ว +1

    these lectures are made with love

  • @SarkarMotion
    @SarkarMotion 4 ปีที่แล้ว +1

    Hello, hope you are perfectly happy and healthy! Your video is a great relief, since I have been unduly stressed by the ongoing world drama. I have never been so emotionally negative before. So I pray that you remain in high spirits.

  • @hughpatterson1480
    @hughpatterson1480 2 ปีที่แล้ว

    Great lesson. Most people never think about how this type of sensor works! I have to set up my sensor circuit on a flat surface and use an appropriate object to bouce the signal to in order to do the calculation, but I will. I'll report back. Again, great lesson!

  • @carolinedion5126
    @carolinedion5126 3 ปีที่แล้ว

    The slope I got for inches by µseconds is y = 0,0071x + 0,4424 and for cm by µseconds : y = 0,0179x + 1,1238. Thanks for the tutorials, I really learned a lot since lesson #1. Two thumbs up!

  • @idan4848
    @idan4848 4 ปีที่แล้ว +1

    thank you! I enjoy from your videos, you make it clear and comprehensible.

  • @LennyTheRed
    @LennyTheRed 4 ปีที่แล้ว +2

    I'm using these working with my first arduino project and they work pretty good. Next im gonna try the HY-SRF05 Ultrasonic Sensor which is supposedly superior in terms of reliability. We'll see how it goes. Love your videos. Your boomer energy has me in awe.

  • @kevhopkins984
    @kevhopkins984 3 ปีที่แล้ว +5

    Enjoyable tutorial and I'm slowly getting there, at last!!! Slope = 0.007 I intend to stay with it to the last, so please keep them coming. Many thanks

  • @bigsmokemelvinharris
    @bigsmokemelvinharris 4 ปีที่แล้ว

    Crystal clear explanation as always.
    Big thumbs up👍👍👍

  • @daveharkin4731
    @daveharkin4731 4 ปีที่แล้ว

    thankyou Paul, please keep these videos coming.

  • @anujsaini9353
    @anujsaini9353 4 ปีที่แล้ว

    I have resolved the issue. I think, you have taught so many techniques and I applied and resolved the issue. Thank you

  • @dieseltinus6680
    @dieseltinus6680 3 ปีที่แล้ว

    You are an excellent teacher; If you explain the imperial system the world might adopt it.

  • @matteoetchart7060
    @matteoetchart7060 4 ปีที่แล้ว

    Thanks for making these classes!!!

  • @DeeGeeDeFi
    @DeeGeeDeFi 3 ปีที่แล้ว

    This is a great job for not the Serial Monitor, but the Serial PLOTTER. it gives you a good graph of readings, you can follow the shape, instead of trying to catch numbers scrolling past.

  • @gghutton
    @gghutton 4 ปีที่แล้ว +3

    I just appriciate your style of mistakes. Yes, I yell out when I see your mistakes, but I make mistakes also. So then I have to trouble shoot one line at a time. It is comforting to know how to handle errors.

  • @thysdelport6782
    @thysdelport6782 ปีที่แล้ว

    slope = 344 m/s or 155 cm/450us if we divide the time by 2 due to the bidirectional travel time. Thanks Paul. Another great session!

  • @AhmedMohammed-kz6ej
    @AhmedMohammed-kz6ej 3 ปีที่แล้ว

    I found the slope after fitting a straight line in MATLAB. The slope equals 0.0181 cm/us which means that the distance traveled in 1 micro second equals 0.0181cm. Thank you, you are a great instructor

  • @cbrombaugh
    @cbrombaugh 3 ปีที่แล้ว +2

    Slope is 0.0070 in/microsec. This is 2-way round trip speed. My measurement of the speed of sound becomes 2x583 feet/second = 1166 feet feet second. This was a good lab experiment. Thanks Paul. Keep up the most excellent work.

  • @eladioh3858
    @eladioh3858 3 ปีที่แล้ว

    thankyou Paul, please keep these videos coming.
    yes I agree a Scope is a great tool to have

  • @VocalVibes1440
    @VocalVibes1440 3 ปีที่แล้ว

    Awesome Lesson. Very detailed and the story line helps a 4th grader like me hooked

  • @stephanvb5561
    @stephanvb5561 3 ปีที่แล้ว

    Northern hemisphere (germany) Slope in cm. m=12,7cm/700ms
    Was able to calculate it the right way and display distance in cm on the serial monitor. Thanks to the fact that you have been repeating this kinda calculations over all your previous lessons and i can asure you, i aint´t a math pro.
    Thanks a lot

  • @priyaaj8106
    @priyaaj8106 3 ปีที่แล้ว

    I got the slope as 0.193.. An absolutely perfect and clear explanation...

  • @killsme6957
    @killsme6957 2 ปีที่แล้ว

    Thankyou so much sir Paul for teaching us this lesson, I now can have sensor to detect altitude from the ground for my drone.

  • @chrisingram7277
    @chrisingram7277 4 ปีที่แล้ว +3

    Wow, I got to play with my cheap usb hantek scope and got some nice square waves on it. Enjoyed the homework. My slope came in at .064 inch/microsecond, which will give the speed of sound there and back.

  • @gurupadmanabhan9238
    @gurupadmanabhan9238 ปีที่แล้ว

    Thank you for your efforts ..I love watch your videos

  • @nahuel3256
    @nahuel3256 3 ปีที่แล้ว

    The slope of graph Distance vs Time gives you the Velocity.
    If we divide the time by 2 we can obtain the time it takes the sound to travel one way.
    Then we can take the integral over time of that new graph to obtain the distance!!!!
    This is AWESOME!!

  • @junesiaheng1097
    @junesiaheng1097 3 ปีที่แล้ว

    Thank you for your kindness Mr Paul..🙏🙏

  • @martinlewis645
    @martinlewis645 3 ปีที่แล้ว

    Thank you so much Paul. I got y= 0.006m + 0.497. Outputting distance to my LCD display.

  • @KingsleyTart
    @KingsleyTart 11 หลายเดือนก่อน

    You know, you've just made me understand how I could use an Arduino to know when the dog wants to come back inside.

  • @robertjennings5558
    @robertjennings5558 2 ปีที่แล้ว

    Paul, if people hate you due to your content and making them think then they really aren't trying to be an engineer.

  • @physics_n_maths_nerd4204
    @physics_n_maths_nerd4204 3 ปีที่แล้ว

    the slope i got was 0.0075 Inches per Microseconds😁😁, and the slope means Speed. Mr Paul you make Math and Physics look exciting. WE NEED MORE TEACHERS LIKE YOU!!
    and i'm in the eastern hemisphere 😊

  • @antrikshfulwani7087
    @antrikshfulwani7087 ปีที่แล้ว

    I programmed it to measure the distance:
    distanceIN=(1./148.)*pingTravelTime; //in inches
    distanceCM=(1./59.)*pingTravelTime; //in cms
    Great lesson, thank you for this excellent series.

  • @426F6F
    @426F6F ปีที่แล้ว

    With my previous message being said, I'm finally getting a reading from my Ultrasonic sensor!! Thanks for another great video Paul! I'm going to run through all of these series in due time!
    Maybe sometime in the future I'll acquire enough skill to start building some awesome, useful, real-world projects. Hopefully some day I'll get hired somewhere where I can use the programming and electronics experience I will have attained to build some neat systems, because this is so enjoyable and fascinating to me!! 🤞

  • @richardalexander633
    @richardalexander633 2 ปีที่แล้ว

    Hi Paul,
    The slope that I worked out was 0.00679 inches per microsecond. It looks about right compared to some other comments.
    Proper science experiment. Love it... :-)

  • @FRUITPUNCH2609
    @FRUITPUNCH2609 3 ปีที่แล้ว

    wow, thank you so much for this video, keep them comin'!

  • @gogeta414
    @gogeta414 4 ปีที่แล้ว +20

    I'm 12 years old and me and my dad are so happy that we are learning this, and this helps me become smarter......?!

    • @farrelmachmoed3045
      @farrelmachmoed3045 4 ปีที่แล้ว

      meh i'm 11

    • @gabrielstrong2186
      @gabrielstrong2186 3 ปีที่แล้ว

      I disagree, I think it is bringing the smartness that was already there before an outlet to show itself.

  • @mubinahmed97
    @mubinahmed97 2 ปีที่แล้ว

    Slope of the best fit line = 0.0061 inches/microS = 508.33 ft/s. We are measuring outgoing distance but measuring outgoing + incoming ping travel time. So, the slope is the half of the velocity of ultrasound. Velocity of ultrasonic sound in this experiment is 2*508.33ft/s = 1016.67 ft/s which is slightly less than the reported speed of 1120 ft/s, probably because of the measurement inaccuracy. Still it is quite impressive. Thanks for the great lessons again.

  • @internetmoney5983
    @internetmoney5983 2 ปีที่แล้ว

    who make unlike ? I am sure they are abnormal humans. the way you explained is perfect. you are the best teacher I have ever met. thank you sir.

  • @laxmanrao4554
    @laxmanrao4554 3 ปีที่แล้ว

    Awesome! It's fun!! I got slope value as 0.0059. so it is 0.0059 inches / microseconds (speed of pulse) . Thank you Sir ❤️

  • @suramyadidwania623
    @suramyadidwania623 2 ปีที่แล้ว

    The slope according to my readings is 50. And so my formula to calculate distance becomes;
    Distance=PingTravelTime/50
    And then I verified my distance using a ruler and VOILA! It's all correct. Thank you for the lesson SirJi.

  • @micahhoffman7818
    @micahhoffman7818 ปีที่แล้ว

    I got a slope of about 0.006833 inches per microsecond. I think this is half the speed of sound because the sound has to travel there and back. I'm really loving these tutorials. Thanks Paul!

  • @kamranibadov9415
    @kamranibadov9415 4 ปีที่แล้ว

    Slope= 0,0175 for sm
    Thanky for tutorial.
    You are the best arduino teacher.

  • @lorisrobots
    @lorisrobots 2 ปีที่แล้ว

    Using the metric system, I got a slope of 0.018 cm/uSec. If I do the math, my estimate of the speed of sound came out to 357 m/sec versus the actual value of 343 m/sec. Not too shabby. FYI ... I got a slope of 0.007 inches/uSec. But I measured using cm, so I just did the conversion here to share my value in inches/uSec. Great lesson!

  • @donaldwang6924
    @donaldwang6924 2 ปีที่แล้ว

    Thanks a lot Paul! The eqution I got by linear interpolation is 0.017x + 0.288 ( cm). So the slope would be 0.017.

  • @axelthieser4712
    @axelthieser4712 2 ปีที่แล้ว

    After doubling the distance (away and back) and converting to SI base units, I get a gradient (slope) of 355 m/s (we dont use inch in germany). So roughly the speed of sound. I like your way of teaching, a nice experiment. Thank you

  • @paulrowe7755
    @paulrowe7755 8 หลายเดือนก่อน

    Slope (metrical) 0.1648 => slope for one way distance 0.3296 => speed of sound 329.6 m/sec = an AHA moment for me, thank you Paul!

  • @user-dh5hv3lo5h
    @user-dh5hv3lo5h 2 ปีที่แล้ว

    Hello paul. i like your lessons..every one of them...I think this sensor is most sencitive in about 4"

  • @melplishka5978
    @melplishka5978 2 ปีที่แล้ว

    Hahaha I like that that don’t let the smoke out comparative lol. Reminds me of my transmission repair instructors examples lol.

  • @purvagn
    @purvagn 3 ปีที่แล้ว

    I think the slope here in South Australia is 4.76 ms/mm (?) cant wait to watch the next video to find out if it is within ballpark. Thanks PM, you rock!

  • @oljeitulkhagva6288
    @oljeitulkhagva6288 3 ปีที่แล้ว

    great video

  • @joematarc5245
    @joematarc5245 3 ปีที่แล้ว

    great video again!
    you should make a tutorial, about this sensor, using a minibot with collision avoidance .
    I've been researching that for sometime now, and all info out there, is just useless. only your tutorials are good to learn something.
    thanks in advanced.

  • @jimlabissonniere7400
    @jimlabissonniere7400 3 ปีที่แล้ว +5

    From Montreal, Canada my calculation for the slope is 0.0067 and the values for time and twicie the distance (ping must come back) seem to represent the speed of sound.

  • @humphreydavis2729
    @humphreydavis2729 4 ปีที่แล้ว

    Hi, I'm way behind everyone else watching these videos, so you probably won't even read this but I am working my through them and learning a lot. I have previously used the HC-SR04, following an exercise provided by Elegoo. Other than how to wire it up and take a reading, it taught me absolutely nothing. Once again, you have provided a clear explanation of what's going on. Did the homework here in the UK and got a slope of 0.006557143, which, allowing for some pretty inacurate measurements, is roughly half the speed of sound.

  • @tyl2el
    @tyl2el ปีที่แล้ว

    Hey Paul,
    Thanks for these! Going through them a couple years after you put them out! But mu slope for my line was 0.007142 in/mcs.

  • @user-ob3qd6to1f
    @user-ob3qd6to1f หลายเดือนก่อน

    Hi Paul tanks for all these math homework love them! My slope of the line is 0.0166 here from South Africa. Tanks Paul and have a great day!

  • @Noseassapo9053
    @Noseassapo9053 2 ปีที่แล้ว

    Peru present Paul! My slope of the line was: 0.016 [cm / μs]
    Please keep doing videos I enjoy them a lot. If you could make another course about python and Arduino (updated) would be great.
    All the best! 🇵🇪💪

  • @believer3759
    @believer3759 2 ปีที่แล้ว +1

    The slope of the line that I found was 16/28 or .679 in decimal. For me the meaning of the line represents the ability of the sonic sensor to calculate the distance from itself to any object it is aimed at.

  • @callmeandoru2627
    @callmeandoru2627 3 ปีที่แล้ว +8

    "Once you let the smoke out, it is very hard to get the smoke back in" (Paul McWhorter, 2020)

  • @alanfairclough8879
    @alanfairclough8879 2 ปีที่แล้ว

    It works. My distance =( pingTravel * 0.0069 )+0.134; I added an LED to fire off every time it sends a pulse, delay increased a bit, I also added an if statement that prints out "TOO CLOSE, BACK OFF!" when the distance

  • @tameraziz2104
    @tameraziz2104 4 ปีที่แล้ว

    Thanks Paul.

  • @harrison4687
    @harrison4687 3 ปีที่แล้ว

    i got a slope of 6.78 x 10neg3 per microSecond or 6.78 inches per milliSecond. it means that it takes one millisecond for the ping to travel to the object and back so the ping is actually travelling double the distance or 13.57 inches in one milliseconcd. Double checking with the speed of sound at 1100ft/sec gives 13,200 inches per second or 13.2 inches per millisecond. I hail from Bay Area, California. Happy Holidays.

  • @aynursunagatullin7029
    @aynursunagatullin7029 3 ปีที่แล้ว

    I did it Mr.McWhorter, I got a slope of (15-2)/(868-147)=13/721 I'm using cm and microseconds, Hello from Russia~!

  • @jabber2824
    @jabber2824 หลายเดือนก่อน

    i found my slope (m) to be 0,006 (inch/uS). It's quite hard to get consistent readings from the sensor and its often off by +-100uSeconds. Since the signal travels to the object and back we need to calculate with half the travel time : slope would then be 12 inch/micro second. Close enough to the 13,5 inch per microSecond which is the speed of sound. Great lesson! and much better than the ELEGO tutorial which don't really explain anything.

  • @alexzhukovsky8361
    @alexzhukovsky8361 ปีที่แล้ว

    I love your joke about the smoke "these chips don't work without their smoke" 😄

  • @hussainalramadan7517
    @hussainalramadan7517 4 ปีที่แล้ว

    You made my day! :)

  • @NoCaminhoDele
    @NoCaminhoDele 2 ปีที่แล้ว

    Greetings from Brazil! My slope was 0.0175, measuring in centimeters.

  • @tntragan
    @tntragan 2 ปีที่แล้ว

    I came up with answers that seem to be close to others. My slope was m=4.437/700 = .00634. Using the point slope value formula that you taught us earlier I came up with a Point Slope Value of y = (4.437/700)(P.T.T) - 1.688, which should give us a "Y" value of distance at any pingTravelTime that is generated by the sensor. (I hope).

  • @neilgavins8852
    @neilgavins8852 ปีที่แล้ว

    I see there are different versions of the Nano; which should I buy to follow your EXCELLENT video series?

  • @rafaelangeltorresgomez4507
    @rafaelangeltorresgomez4507 2 ปีที่แล้ว

    m=0.0175cm/us (Germany) thanks Paul is always fun to learn with you :)

  • @martinhebben2072
    @martinhebben2072 4 ปีที่แล้ว

    Looking forwards to the next lesson, i have troubles thit this slope thing.
    But (pingTravelTime/2) * 0.0343 (speed of sound in cm) works for me.

  • @makeqwd7199
    @makeqwd7199 4 ปีที่แล้ว

    first one to comment on this video , love ur videos , the way u teach its cool , u explain each step and why these steps , , I didn't reach this video yet im still in video 39 , but i will catch u , ,,great job

  • @amayerstatue
    @amayerstatue ปีที่แล้ว

    I got a slope of 0.0077. This is the extra distance traveled by the ultrasonic sound in inches to reach the wall for every microsecond in delay. Multiplying this value by two gives an estimate for the speed of sound in inches/microsecond!

  • @MarvPerk3
    @MarvPerk3 3 ปีที่แล้ว +2

    Hi, Paul, I incorporated this project into the DHT11/LCD/9vPower project, as I figured we'd eventually want to hook it up to the LCD and make it portable. I also couldn't help but calculate off the know speed of sound, rather than observed values, so 1125 ft/sec=13500 inches/sec = .0135 inches/microsec. So, after multiplying the microseconds by .0135, I then divided by 2 to compensate for out-and-back travel distance. Interestingly enough, that .0135/2 comes very close to the .007 range that many people reported... .00675 to be exact. Do I get a fail for using the speed of sound, or a star? My LCD displays microseconds on the top line and inches on line two. Walking around the house, it seems pretty accurate, but I don't know the limits of distance it can measure, as when I point down a long hall, the distance is under-reported. maybe it is bouncing off doorknobs or other closer objects. Anyway, another fascinating lesson and exercise... and I loved incorporating it right in with the previous projects (using the Nano and the jumbo breadboard). Thanks, as always.

  • @tdc485
    @tdc485 3 ปีที่แล้ว

    The slope is the speed of sound, but you have to double the distance you measure since the sound wave has to go out and back in the time we measure. I did mine in metric units and got 371.67 m/s, with the actual speed being 344 m/s under a standard atmosphere. Within 8%. Not bad considering the way I measured it.

  • @MrBrotherchris65
    @MrBrotherchris65 3 ปีที่แล้ว

    I came up with 200 microseconds for each 1.4 inches from the sensor with the card i was measuring against. The distance would actually be double since it has to travel from the sensor to the card and back to the sensor again. About .007 inches per microsecond gives the distance from the sensor and then .014 is the actual distance the sound travels (roundtrip) in a microsecond.
    BTW - I am loving this series!!!

    • @paulmcwhorter
      @paulmcwhorter  3 ปีที่แล้ว

      Well saddle up and get ready for the Jetson Nano series when you get done with this series.

  • @EFoxVN
    @EFoxVN 10 หลายเดือนก่อน

    I have intuitively switched it over to [m/s], and I got a reading of 346 m/s, which is really not bad. 😊 Of course I also first made the mistake of not realizing that I need to use twice the distance, but I am proud to say that I caught my mistake. 🎉

  • @jangirrajan
    @jangirrajan 4 ปีที่แล้ว

    Good evening sir☺️

  • @soup2ru433
    @soup2ru433 3 ปีที่แล้ว

    As clean as you are with cables I was shocked you had the USB issue. haha Had sprinkle salt over the wound on that one.

  • @stefannilsson7692
    @stefannilsson7692 3 หลายเดือนก่อน

    No, it's good when you explain so you understand and keep up with the tasks, they do but sometimes it doesn't go quite as you want BOOM

  • @midnightrizer
    @midnightrizer 4 ปีที่แล้ว

    I read somewhere you can use the serial Monitor as an approximation of a scope kind of a magnifier glass in place of a microscope but it would be better than nothing at all. :)

  • @olegvelichko1659
    @olegvelichko1659 4 ปีที่แล้ว

    Okay, so I got this idea. An unnecessarily convoluted oscilator. You base your next PING on the ECHO return. So basically you send out a PING, wait for the PONG, then use that to trigger the next PING. Set up in such a way the frequency of your PING-PONG will be defined by the distance between the target and the sensor. Right? Granted this will be a very inaccurate oscillator, what with all the factors that can have an effect on the speed of sound (read "air density" - temperature, humidity etc). But would be a fun experiment nonetheless... On a serious note - PERFECT timing for this video. I have been contemplating a parking assist system for the garage for a while now, and now I may actually have the time to build one. The idea is an enclosure with the HC-SR04, a few different colored LED lights, which will light up depending on the distance to the target. A car's bumper is a perfect target for ultrasonic sensor, being a hard surface and all that. Thank You, Paul! Excellent content as always!

  • @klrwhizkid
    @klrwhizkid 3 ปีที่แล้ว

    Using inches, got .0068in/µs and using cm, I got .015cm/µs in KC, Mo. The slope represents the speed of sound in the two different measurement systems.

  • @jaya.rajeshhanni3071
    @jaya.rajeshhanni3071 3 ปีที่แล้ว

    hi sir, i went through your tutorial and thats great.. i would be happy to know if there are any ways to calculate output of sensor in terms of voltage ??

  • @CodingScientist
    @CodingScientist 4 ปีที่แล้ว

    Very nice lesson Paul, how can we use ultrasonic sensor in Jetson Nano ? may be you should cover some of these Arduino lessons using Jetson Nano