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
best teacher ever❣
The penny dropped when I saw the 'scope ping signal jittering. He has led us up the garden path to ... State Machines. Very cunning!
These got me using the pico.👍
Thanks Paul! You have raised the bar...And I am grateful that you go beyond the "normal' expectations...I will attempt the homework...
Glad you're enjoying the deeper dive!
Paul, you are the best!
Thanks Paul.
Awesome video Paul, Thank you.
Just ordered the oscilloscope using your link.
Nice, that’s a great tool!
I posted a video showing my more accurate PIO HC-SR04 code.
Thanks Paul for all you do.
LEGEND!
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
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.
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.
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.
SOMEONE asked about This item: ElectroCookie Large PCB Prototype Board Kit amazon or others will have similar if not same.. Hope this helps.
TOP G
sorry I missed the class, Problems
Hope to see you back in the live chat soon.
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'.
LEGEND!
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.
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.
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....