#17 Ultrasonic HC-SR04 for your Arduino (Easy!)

  Рет қаралды 2,750

Ralph S Bacon

Ralph S Bacon

Күн бұрын

You can connect an ultrasonic HC-SR04 (or similar) module to your Arduino UNO with just two wires (plus power, of course) to get really accurate distance measurements.
Here we have some ultra-simple code to do this plus a mechanism to control the power to the ultrasonic module to save power when running on battery, for example.
Initially, we roll our own code to do this but a description of the de-facto industry standard ultrasonic library NewPing is also covered.
You can do this entire project in about 30 minutes, no kidding.
You can support me by buying me a coffee!
buymeacoffee.com/ralphbacon
Links to the code is posted below, just copy it to a folder of the same name and use the Arduino IDE to open it.
www.dropbox.com/sh/5nrniyjan5...
And my channel is here:
/ ralphbacon

Пікірлер: 5
@gfodale
@gfodale 4 жыл бұрын
Greetings! First, I want to say thank you for replying to everyone, myself included, it's greatly appreciated. Second, regarding the HC-SR04, I'm giving you a link to another you-tuber, who has added an DHT-22, to make it more accurate. kzbin.info/www/bejne/bHeUc5KEa7Gogdk On a side note, I tried to use an Arduino micro as a keyboard/joystick interface to the computer. On my first attempt, I failed miserably and could not re-program it as it started sending input before it could be put back into program mode. I ended up setting up the Uno as programmer option which uses SPI, and was able to recover the board through that. I'm happy and content, now that I fixed my screw-up. So, back to screwing up and learning more. :) Have a good day.
@RalphBacon
@RalphBacon 4 жыл бұрын
Thank you. for your kind words - and the link too; that DHT22 is so much better and is what I replaced the DHT11 in Benny's cat run with too (mainly because the DHT11 can't go below zero, how stupid is that?) I laughed at your predicament with your Arduino constantly typing stuff before you could reprogram it, I wonder how many makers have done that. No, not me, never, honest. Oh, alright, yes me too, whilst I was creating my video switching unit! Glad you got it sorted. Lesson learned (for us both)!
@sstamoulos
@sstamoulos 6 жыл бұрын
where is the code?
@RalphBacon
@RalphBacon 6 жыл бұрын
I've updated the video description, Stelios, you'll find it here: www.dropbox.com/sh/5nrniyjan5cqh7y/AACzeBVCzHKeymU91kZGIYhIa?dl=0 Thanks for pointing this out!
@loptica62
@loptica62 4 жыл бұрын
@@RalphBacon link is dead ---> leads to a 404 page.....
#BB11 Create an Arduino Library😨 - A Real World Example (Easy)
25:54
50 YouTubers Fight For $1,000,000
41:27
MrBeast
Рет қаралды 202 МЛН
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 14 МЛН
No empty
00:35
Mamasoboliha
Рет қаралды 3,9 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 36 МЛН
Waterproof Ultrasonic Distance Sensors - JSN-SR04T & A02YYUW 💧☔
32:11
DroneBot Workshop
Рет қаралды 177 М.
#263 Using WhatsApp with  your ESP32 (and other μControllers)
18:31
Ralph S Bacon
Рет қаралды 12 М.
Using an EEPROM to replace combinational logic
25:22
Ben Eater
Рет қаралды 1,4 МЛН
Calibrate your Resin 3D Prints with a Sword!
12:59
Uncle Jessy
Рет қаралды 11 М.
#257 Wireless Serial Comms⚡for your Arduino (or other μController)
29:40
What is Arduino and can I use it for my project? [Beginner Friendly]
9:52
Programming Electronics Academy
Рет қаралды 141 М.
Diameter of Binary Tree - Leetcode 543 - Python
7:26
NeetCodeIO
Рет қаралды 293
Solving the problem EVERY robot has (with ros2_control)
24:36
Articulated Robotics
Рет қаралды 78 М.
Radar Arduino ultrasonic sensor hc-sr04
0:37
Forbidden Bit
Рет қаралды 7 М.
Xiaomi SU-7 Max 2024 - Самый быстрый мобильник
32:11
Клубный сервис
Рет қаралды 513 М.
low battery 🪫
0:10
dednahype
Рет қаралды 698 М.
iPhone 15 Pro в реальной жизни
24:07
HUDAKOV
Рет қаралды 460 М.
Rate This Smartphone Cooler Set-up ⭐
0:10
Shakeuptech
Рет қаралды 4,9 МЛН
НОВЫЕ ФЕЙК iPHONE 🤯 #iphone
0:37
ALSER kz
Рет қаралды 278 М.