Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
BeagleBone Robotic Projects

You're reading from  BeagleBone Robotic Projects

Product type Book
Published in Dec 2013
Publisher Packt
ISBN-13 9781783559329
Pages 244 pages
Edition 1st Edition
Languages
Author (1):
Richard Grimmett Richard Grimmett
Profile icon Richard Grimmett

Table of Contents (18) Chapters

BeagleBone Robotic Projects
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Getting Started with the BeagleBone Black Programming the BeagleBone Black Providing Speech Input and Output Allowing the BeagleBone Black to See Making the Unit Mobile – Controlling Wheeled Movement Making the Unit Very Mobile – Controlling Legged Movement Avoiding Obstacles Using Sensors Going Truly Mobile – Remote Control of Your Robot Using a GPS Receiver to Locate Your Robot System Dynamics By Land, Sea, and Air Index

Chapter 7. Avoiding Obstacles Using Sensors

In the previous two chapters, we covered wheeled and tracked movement and then legged movement. 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 project, you'll discover how to add some sensors to help us avoid barriers.

Mission briefing


We've covered creating robots using a wheeled/track base and robots that can move using legs. In this chapter, you will be introduced to some of the basics of sensors, particularly sensors that can help you avoid objects by alerting you to them.

Why is it awesome?

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

Your objectives

In this chapter, you will:

  • Connect the BeagleBone Black to a USB sonar sensor to detect the world around it

  • Use a servo to change the position of your sensor so that a single sensor can view a large field, eliminating the need for additional sensors

Tip

Downloading the example code and colored images

You can download the example code files and colored images for this Packt book you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to...

Connecting the BeagleBone Black to a USB sonar sensor


Now that you have a mobile platform and your robot can move, you will want to check if your robot could run into something. One of my favorite ways to do this is using a sonar sensor. First: a little tutorial on sonar sensors. This type of sensor uses ultrasonic sound to calculate the distance to an object. The sound wave travels out from the sensor, as illustrated here:

The device sends out a sound wave ten times a second. If an object is in the path of these waves, then the waves reflect off the object, sending waves that return to the sensor, as shown here:

The sensor then measures any return. It uses the time difference between when the sound wave was sent out and when it returned, to measure the distance to the object.

Prepare for lift off

The first thing you'll want to do is connect the USB sonar sensor to your PC, just to make sure everything works well. Here are the steps:

  1. First, download the terminal emulator SW from http://www.maxbotix...

Using a servo to move a single sensor


You now have your sensor, but if you want to sense in more than just one direction, you could use several sensors, each mounted to a different side of the robot. However, there is a way to use servos to move your sensor, which allows you to use a single sensor to sense in several directions.

Prepare for lift off

The simplest way to avoid having to purchase and configure several sensors is to mount the sensor on a single servo, then use a servo bracket to connect this assembly to the platform. Using the sonar sensor, the assembly will look something like this:

Make sure you connect your servo to the servo controller; it can fit into any open connection. I am connecting mine to my quadruped that has eight servos to control, so I have connected mine to the eighth connection on the servo controller board. Here is an image:

Engage thrusters

I'll assume you already have your sensor up and working and know how to read data. In this section, you will add the ability...

Mission accomplished


Congratulations! You can now detect and avoid walls and other barriers to your robot. You can also use these sensors to detect objects that you might want to find.

A challenge


One way to use these sensors is to use two sensors to actually "find" an object. This can help your robot actually find the position of specific obstacles. How this is accomplished is detailed on the maxbotix.com website at: http://www.maxbotix.com/documents/MaxBotix_Ultrasonic_Sensors_Find_Direction_and_Distance.pdf. You have all the knowledge you need to add this type of capability to your robot.

lock icon The rest of the chapter is locked
You have been reading a chapter from
BeagleBone Robotic Projects
Published in: Dec 2013 Publisher: Packt ISBN-13: 9781783559329
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}