O'Reilly logo

Raspberry Pi: Amazing Projects from Scratch by Richard Grimmett, Matthew Poole, Arush Kakkar, Ashwin Pajankar

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

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 ...

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