Raspberry Pi Pico W LESSON 106: Measuring Distance With Ultrasonic Sensor HC-SR-04

Поділитися
Вставка
  • Опубліковано 29 січ 2025
  • This is a link to the Oscilloscope I was using in today's lesson. It is not required for the class, but is a pretty cool piece of lab gear to have:
    amzn.to/3DIDhF2
    (Affiliate Link)
    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 class we will be using the Sunfounder Raspberry Pi Pico W Keppler Kit. It will make things a lot easier if we are working on identical hardware. the link below is to amazon, and is for the identical hardware I will be using in this entire class.
    amzn.to/3ubMRs1
    In this video, I will show you how to teach you about echolocation, the mechanism bats use to fly in the dark, and submarines use to navigate the ocean floor. We will use the HC-SR04 ultrasonic sensor, and will learn how to use this sensor to measure distance. Enjoy!
    More great content at:
    toptechboy.com
    [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. ]
    #raspberrypipicow
    #HC-SR04
    #echolocation

КОМЕНТАРІ • 25

  • @AntonioVukšić-g3c
    @AntonioVukšić-g3c 8 годин тому

    best teacher ever❣

  • @nigelworwood8530
    @nigelworwood8530 17 годин тому

    The penny dropped when I saw the 'scope ping signal jittering. He has led us up the garden path to ... State Machines. Very cunning!

  • @Dubot-f1v
    @Dubot-f1v 4 години тому

    These got me using the pico.👍

  • @edSabio572
    @edSabio572 День тому

    Thanks Paul! You have raised the bar...And I am grateful that you go beyond the "normal' expectations...I will attempt the homework...

    • @paulmcwhorter
      @paulmcwhorter  3 години тому

      Glad you're enjoying the deeper dive!

  • @КирПро-х7н
    @КирПро-х7н День тому

    Paul, you are the best!

  • @patrickfox-roberts7528
    @patrickfox-roberts7528 День тому

    Thanks Paul.

  • @perfectscotty
    @perfectscotty День тому

    Awesome video Paul, Thank you.

  • @perfectscotty
    @perfectscotty День тому

    Just ordered the oscilloscope using your link.

  • @keithlohmeyer
    @keithlohmeyer День тому

    I posted a video showing my more accurate PIO HC-SR04 code.
    Thanks Paul for all you do.

  • @jyvben1520
    @jyvben1520 День тому

    So several sensors combined with a pir (to sense activity and activate 6 ultrasonic sensors using crossed beams ?) could simulate a touch screen as circuitpython can simulate a mouse
    might do a grid of 5 wide - 4 high

  • @BerndRenzing
    @BerndRenzing 18 годин тому

    The Echo PIN Signal ist also much longer than the original Trigger, Signal due to the distance of the Sound ? But in the Code you wait until the Signal went down. So in my opinion you are waiting much longer than needed. Wouldn‘t it make Sense to wait until the Signal rises or isn‘t there an so much difference? I’ve no osci in the Moment.

  • @alistaircook1997
    @alistaircook1997 День тому

    I enjoyed your lesson 106, I have the oscilloscope you recommend but are unable to get it to work on this project, can you do a video to shown the setup for this scope to show how you get the outcome you show on the lesson. My screen is full of noise and no square wave.

    • @paulmcwhorter
      @paulmcwhorter  День тому

      No, the purpose of the lesson was to learn to think and write code. Loading a library you have not achieved that same level of learning. Think of what I taught, use that to write the code. Then check my solution.

  • @larryplatzek9017
    @larryplatzek9017 День тому

    SOMEONE asked about This item: ElectroCookie Large PCB Prototype Board Kit amazon or others will have similar if not same.. Hope this helps.

  • @HaterOfSirPent
    @HaterOfSirPent 2 дні тому

    TOP G

  • @peterdegraff8032
    @peterdegraff8032 День тому

    sorry I missed the class, Problems

    • @paulmcwhorter
      @paulmcwhorter  День тому

      Hope to see you back in the live chat soon.

  • @charlotteswift
    @charlotteswift День тому

    My comment got eaten. Maybe I should have said that it was about cats and chocolate cake🐈🎂. Here it is again: I've made a video called 'My video for Paul McWhorter's Pico W Lesson 104 - Toggling LEDs with buttons using PIO'.

  • @keithlohmeyer
    @keithlohmeyer 15 днів тому

    I show how I created a PIO solution for reading the HC-SR04 in these 2 videos
    ua-cam.com/video/se1ypDUaHcA/v-deo.html
    ua-cam.com/video/aYpHELaMZbg/v-deo.html
    Thanks Paul for all you do.

    • @paulmcwhorter
      @paulmcwhorter  15 днів тому +1

      Keith, I think the HC-SR04 is a great practical example of use of the state machines. More complex python code can begin to affect the accuracy of the measurements, if state machines are not used.

  • @320mb
    @320mb 17 годин тому

    This stuff is so Fascinating, *** Keep in mind, IF your sensor is not reading Properly, you may Need to use Pin 40 (the 5 volt pin) as some of these sensors won't work on 3.3 volt *** If anyone is interested here is the Formula to measure in Inches instead of Centimeters......... 767.27 mph * 5280 ft * 12 in / 3600 / 1,000,000 and it works great....