Monday, March 20, 2017

Makers most popular HC-SR05 ultrasonic sensor



Intro

If you're starting with Arduino, you won't get past this sensor. It's a cheap, easy-to-use ultrasonic distance sensor. If you ever wanted to build your own obstacle avoiding robot, you'll need at least one of these sensors.

How it works

In simple words. There is a speaker that emits an ultrasonic impulse. The pulse is not audible for the human ear. The pulse travels with the speed of sound. And when it hits a target, it's reflected back to the sensor, where a microphone can detect it. And because we know how fast sound travels, we can calculate by the duration of the impulse to came back, the distance to the object.



Wiring

Wiring is easy. The sensor works with 5V. And both data pins are also 5V tolerant. So fist the usual 5V to 5V and GND to GND.
I attached the trigger pin to Digital 2 (D2) and the echo pin to Digital 3 (D3). But you can use any digital pins.Although I wouldn't recommend using Pin 0 or Pin 1, cos' it would probably interfere with the serial monitor.


Video


Watch the video. It probably will answer all your questions.

No comments:

Post a Comment