O'Reilly logo

BeagleBone Cookbook by Jason Kridner, Mark A. Yoder

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

Introduction

In this chapter, you will learn how to sense the physical world with BeagleBone Black. Various types of electronic sensors, such as cameras and microphones, can be connected to the Bone using one or more interfaces provided by the standard USB 2.0 host port (as shown in Figure 2-1).

USB Host Port
Figure 2-1. The USB 2.0 host port

The two 46-pin cape headers (called P8 and P9) along the long edges of the board (shown in Figure 2-2) provide connections for cape add-on boards, digital and analog sensors, and more.

Cape Headers P8 and P9
Figure 2-2. The P8 and P9 cape headers

The simplest kind of sensor provides a single digital status, such as off or on, and can be handled by an input mode of one of the Bone’s 65 general purpose input/output (GPIO) pins. More complex sensors might be connected using one of the Bone’s seven analog-to-digital converter (ADC) inputs or several I2C buses.

Chapter 3 discusses some of the output mode usages of the GPIO pins.

All these examples assume you know how to edit a file (Editing Code Using the Cloud9 IDE) and run it, either within Cloud9 or from the command line (Getting to the Command Shell via ssh).

Choosing a Method to Connect Your Sensor

Problem

You want to acquire and attach a sensor and need to understand your basic options.

Solution

Figure 2-3 shows many of the ...

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