Raspberry Pi Tutorial on Connecting the Ultrasonic sensor HC SR04
ฝัง
- เผยแพร่เมื่อ 18 มิ.ย. 2020
- Connecting the Ultrasonic Sensor( HC-SR04) to the Raspberry Pi to measure distance.
Coming Soon:
🔥 Get the latest updates and project guides! Join our newsletter here bit.ly/3TRf3x7
Equipment you need:
Breadboard (amzn.to/3qxb8uk)
Raspberry Pi 3 or 4 (amzn.to/3qA944v)
Ultrasonic Sensor (HC-SR04) (amzn.to/3Ncbpvr)
One 1 kilo-Ohm resistor (amzn.to/3oPorFY)
One 2 kilo-Ohm resistor (amzn.to/3oPorFY)
8 Female-Male Jumper Wire (amzn.to/3NfstAC)
Other Info:
Explore the exciting world of DIY making! Join Mark Frauenfelder’s Skillshare course with a free one-month trial here: skl.sh/3Vv83bB. Start your maker journey today!
Credits:
The steps in this tutorial, including the code, were obtained from the Pi Hut at the link below, with minor adjustments.
Reference:
thepihut.com/blogs/raspberry-...
PS: Some of the links in this description are affiliate links that I get a kickback from
Nice video, thanks :)
very nice and simple work
Thank you very much
bro seems you connected pin 2 to negative railway and pin 6 to positive railway can you please confirm
great thanks
Hi can i ask you please, is there's is a sensor that can present radar sensor ( calculating speed and velocity ) ? if yes tell me and thaak you so much brother
Yes, there are radar sensors that can be used with a Raspberry Pi to calculate speed and velocity. Here are a couple of examples:
• OmniPreSense OPS243-A Doppler Radar Sensor: This sensor was used in a project to build a “speed trap” that uses machine learning to identify vehicles and a radar sensor to measure speed1. The data was then reported to the cloud1.
• HB100 Radar Sensor: This sensor can be wired to a Raspberry Pi to calculate the speed/velocity of an object2.
• A111 Pulsed Radar Sensor: This is a single-chip solution for pulsed coherent radar (PCR) and comes complete with antennae and an SPI interface capable of speeds of up to 50MHz3. Applications for PCR include distance-sensing, gesture, motion, and speed detection.
Check out this links below
wiki.ros.org/Drivers/Tutorials/SpeedMeasurementWithRadarSensorHB100Python
www.tomshardware.com/news/raspberry-pi-mobile-speed-trap
learn.sparkfun.com/tutorials/getting-started-with-the-a111-pulsed-radar-sensor/all
@@raspberrypimadeeasy I just want to know if there's sensor's do the same thing, that i can use in proteus simulation
You can simulate the ultrasonic sensor in Proteus using the Ultrasonic Sensor Library
Can i add 2 more sensor in the same raspberry? volts/amps problems?
I know this is super late but volts are the amount of pressure and won't change unless you either add more power sources change the voltage on the existing one. The sensor needs 5V and the GPIO pins get fried on anything more than 3.3V. Amps shouldn't be a problem either.
i don’t have a 2kohm resistor, but i have lots of 1KOhm. how would i wire it that way?
the resistance can stack
What coding software did u use
The Raspberry Pi comes preloaded with Python which you can use to code
Terminal or thonny that come preinstalled into the pi
@@thefishersfisher2378 idk if you still need it but it's a command line text editor called GNU Nano
working
I'm not getting a continuous output. I need to keep pressing Run on the code in order to get a single reading. Anyone knows how to fix this?
Same here did you find the answer
@@wanderingsaint2659 nope
Yes , You can add “while (True):”
Then put your code after this sentence then it will run continuously
Put your code in a for loop or while loop and that should give you a continuous reading. I have noticed that the sensor gets overheated sometimes, hence make sure that you let it rest for some time using sleep.
im getting waiting for sensors to settle then no reading any idea bro whatwent wrong
did you figure it out
@@marck4039 change TRIG from 16 to 23 and ECHO from 18 to 24 into the code only.
it needs GPIO value not pin number
@@wajadadkarim1708 I have it wired to GPIO pins 21 and 20 and in the code, I assigned the right values to the variables. I don't know what the issue is though.
@@JellyFoxYTdid you figure it out?
Did you film with potato?