Chapter 7. Avoiding Obstacles Using Sensors

In the previous two chapters, we covered wheeled and tracked movements and then legged movement. Now your robot can move around. But what if we want the robot to sense the outside world so that it doesn't run into things? In this chapter, we'll discover how to add some sensors to help us avoid colliding into barriers.

Your robot will take quite a beating if it continually runs into walls or runs off the edge of a surface. Let's help your robot avoid these so that it looks intelligent.

In this chapter, we will cover the following topics:

  • Gathering the hardware
  • Connecting Raspberry Pi to an IR (infrared) sensor in order to detect the world
  • Connecting Raspberry Pi to a USB sonar sensor in order to detect the ...

Get Raspberry Pi Robotic Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.