O'Reilly logo

Mastering BeagleBone Robotics 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 distance sensors

If your robot is to appear intelligent, gathering information about the world around it will be crucial. So, let's add some sensors that can provide you information about the distance and location of barriers.

There are basically two kinds of distance sensors, IR and sonar sensors. Both send out a signal and then measure a response to calculate the distance of the object from themselves. You can use either sensor, so you'll learn how to add both to your project. Let's cover sonar sensors first.

Sonar sensors

A sonar sensor uses ultrasonic sound to calculate the distance of an object. The sound wave travels out from the sensor, as illustrated here:

The device sends out a sound wave 10 times a second. If an object is in the path ...

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