Connecting a sonar sensor to Arduino

Here is an image of a sonar sensor, HC-SR04, which works well with Arduino:

Connecting a sonar sensor to Arduino

These sonar sensors are available at most places that sell Arduino products, including amazon.com. In order to connect this sonar sensor to your Arduino, you'll need some of those female-to-male jumper cables that you used in the previous chapters. You'll notice that there are four pins to connect the sonar sensor. Two of these supply the voltage and current to the sensor. One pin, the Trig pin, triggers the sensor to send out a sound wave. The Echo pin then senses the return from the echo.

To access the sensor with Arduino, make the following connections using the male-to-female jumper wires:

Arduino pin

Sensor pin

5V

Vcc

GND

GND

12

Trig

11

Echo

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.82.154