Chapter 4. Avoiding Obstacles Using Sensors

You've constructed your biped robot. Now, your robot can move around. But what if you want the robot to sense the outside world, so you don't run into things? In this chapter, you'll discover how to add some sensors to help avoid barriers.

Specifically, you'll learn:

  • How to connect Raspberry Pi to an IR (infrared) sensor
  • How to connect Raspberry Pi to a USB sonar sensor to detect the world
  • How to connect Raspberry Pi and its GPIO to a sonar sensor to detect the world

Connecting Raspberry Pi to an infrared sensor

Your robot can now move around, but you'll want to be able to sense a barrier or a target. One of the ways to do this is with an IR sensor. First, a tutorial on IR sensors is required. An IR sensor ...

Get Raspberry Pi: Amazing Projects from Scratch now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.