O'Reilly logo

Getting Started with Raspberry Pi Zero by Richard Grimmett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a sonar sensor

The basic circuit you just built is a wonderful start. Now you'll interface a more complex device, a sonar sensor, with Raspberry Pi Zero. Here is a picture of the sonar sensor that you'll add:

Adding a sonar sensor

The device is an HC-SR04 and they are available at most online electronics retailers. Now let's connect the device to Raspberry Pi Zero. In order to do this, first let's look at the layout of the GPIO pins on Raspberry Pi Zero:

Adding a sonar sensor

You'll need to connect to the 5 volt connection of the Raspberry Pi Zero, pin 2. You also need to connect to the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required