BeagleBone Black Interfacing
Hardware and Software
By Yury Magda
Copyright 2014-2015 by Yury Magda. All rights reserved.
The programs, examples, and applications presented in this book have been included for their instructional value. The author offer no warranty implied or express, including but not limited to implied warranties of fitness or merchantability for any particular purpose and do not accept any liability for any loss or damage arising from the use of any information in this book, or any error or omission in such information, or any incorrect use of these programs, procedures, and applications.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the author.
Contents
Introduction
The popular BeagleBone Black miniature computer besides being used as a low-power general-purpose desktop computer can form a basis for building measurement and control systems by both professionals and hobbyists. This is due to the general purpose input/output port (GPIO) and analog channels available on the BeagleBone Black board; each GPIO pin or analog channel can be accessed through the P8 or P9 headers.
This book describes projects which may be used as templates for building various measurement and control systems. Each project includes both hardware and software accompanied by the detail description of what is doing.
Note that Debian OS is a true Linux operating system, so developers cannot develop applications for measuring and control system operating i n real-tim e without writing or using specific kernel drivers. Nevertheless, it is possible to develop numerous applications that dont require fast responses and short time intervals. Using an additional library developed for Python allows to measure relatively slow analog (continuous) and digital signals coming from various (temperature, humidity, pressure, light, etc.) sensors. The programs written in Python can also drive external loads (motors, relays) by bringing digital signals on GPIO pins.
Part of the material is dedicated to use of the BeagleBone Black in network measurement and control systems. A few projects illustrate building the network systems where the BeagleBone Black is used together with the popular Tiva C Series Connected LaunchPad board from Texas Instruments. The BeagleBone Black can be easily fitted into wireless systems using the Wixel Programmable USB Wireless module from Pololu Corp., so the readers can explore a couple of projects presented in this guide. Several projects illustrate the design of wireless measurement and control systems using a popular Bluetooth interface.
This book is thought as a highly practical guide for building measurement and control systems. The material of the book assumes that the readers are familiar, at least, with basics of designing and assembling electronic circuits. For most projects having some basic skills in electronics will serve the readers well and allow them to understand what is going on behind the scenes. Each project is accompanied by the brief description which helps to make things clear.
All projects were designed using the BeagleBone Black Rev.C board running Debian Linux. All of the source code for the BeagleBone projects was developed in Python. A few projects used Arduino Uno and Arduino Due development boards. Most projects described in this guide can be easily improved or modified if necessary.
Disclaimer
The design techniques described in this book have been tested on the BeagleBone Black Rev.C board without damage of the equipment. I will not accept any responsibility for damages of any kind due to actions taken by you after reading this book.
BeagleBone Black GPIO pins
Development platforms like BeagleBone provide an environment for software and hardware experimenting. This is possible because availability of General Purpose Input/Output pins (GPIO) on the BeagleBone Black board.
The BeagleBone Black is equipped with the two sets of headers labeled P8 and P9. These headers run along the edges of the board. Each of them has 46 pins with pins 1, 2, 45, and 46 labeled on each header. To identify pin numbers in the middle, youll have to count off from the pins on the end.
The GPIO pins can be employed in various control and measurement systems for reading sensors, communicating with other electronics, and much more. Most pins can operate in different modes thus accommodating different possible functions. Note that digital pins must be either high or low.
Basically, GPIO pins may be put in input or output mode. When output, a pin can be pulled either low (log.0) or high (log.1) by the program code; this allows to control external circuitry connected to this pin. The logical level 0 corresponds to the voltage level close to 0 volts, while the log.1 is about 3.3 volts.
Reading the state of a loose pin returns the unpredictable result. Each GPIO pin can individually be configured either as input or output. All the GPIO pins can also be reconfigured to provide alternate functions, SPI, PWM, I C and so.
Note that GPIO voltage levels are 3.3 V and are not 5 V tolerant. The 3.3 V logic level of the BeagleBone Black assumes that a developer has to use only 3.3 volt logic components when connecting an external circuitry.
The BeagleBone Black board has no over-voltage protection the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.
Chances are that external circuitry could be poorly assembled and have short circuits, so I highly recommend you to employ a standalone DC 5V/3.3V power supply for powering your electronic circuits to prevent the permanent damage of the BeagleBone Black.
Another aspect of interfacing the BeagleBone is maximum allowable current through an GPIO pin. The current has to be less than 8 mA, so any load that draws more current can damage the board. The best solution when connecting external circuits to the BeagleBone Black is to employ some CMOS buffer IC (for example, 74HC00, 74HC08, 74HC14, etc.) which isolates the external circuitry from low-current GPIO pins.
Be very careful when wiring the GPIO pins before probing P8 or P9 pins, it's a good idea to strip short pieces of insulation off a wire and push them over the 3.3V pins so you don't accidentally short them with a probe.
When attaching your electronic circuits to the BeagleBone GPIO pins use short wires (10-12cm long) so that to ensure minimum distortion of digital signals. Using long wires may cause your circuit to stop functioning properly.
Powering external circuits
The low-power external circuitry driven by the BeagleBone Black can be powered using power supply +3.3V located on the board. This, however, poses a risk of damaging the BeagleBone board if external circuitry comprises a short circuit. For that reason, it would better to power such circuits from a stand-alone DC voltage source.
When both +3.3V and +5V voltage are needed, we can take some DC power supply +5V and connect its output to a low-dropout regulator (LDO) chip providing the steady +3.3V output. The following power circuit was used for powering all projects from this book ( Fig.1 ).
Fig.1
Next page