O'Reilly logo

Mastering Arduino by Jon Hoffman

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

Ultrasonic range finder

The third sensor that we will be using is a MaxSonar EZ1 Ultrasonic range finder. This sensor is one of my favorite sensors to use. I have used it in almost every autonomous robot that I have built to determine the distance to nearby objects. The following is an image of the EZ1 Ultrasonic range finder:

For the example, in this chapter, we will be using pins 3,6, and 7 on the sensor. Pin 3 is used for analog out, pin 6 is for VCC and pin 7 is for ground. Pins 4 and 5 are for serial RX/TX connection and pin 2 is for a pulse-width output, however, we will not be using those outputs in the example for this chapter.

An ...

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