Book Image

BeagleBone By Example

By : Pei JIA, Jayakarthigeyan Prabakar, Alexander Hiam
Book Image

BeagleBone By Example

By: Pei JIA, Jayakarthigeyan Prabakar, Alexander Hiam

Overview of this book

BeagleBone is a low cost, community-supported development platform to develop a variety of electronic projects. This book will introduce you to BeagleBone and get you building fun, cool, and innovative projects with it. Start with the specifications of BeagleBone Black and its operating systems, then get to grips with the GPIOs available in BeagleBone Black. Work through four types of exciting projects: building real-time physical computing systems, home automation, image processing for a security system, and building your own tele-controlled robot and learn the fundamentals of a variety of projects in a single book. By the end of this book, you will be able to write code for BeagleBone in order to operate hardware and impart decision-making capabilities with the help of efficient coding in Python.
Table of Contents (17 chapters)
BeagleBone By Example
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Advanced project – Motion-based home security alert system


In this section, we will build a home surveillance security alert system, where we will have a BeagleBone board to which a PIR sensor is connected. A USB camera is connected to it, and the BeagleBone board is connected to the Internet. So basically, the system will capture an image from the camera whenever some movement is detected in front of the PIR sensor.

Follow these steps:

  1. Set up the PIR sensor with the BeagleBone board, just like we did in the motion-detection topic of this chapter, connect the USB web camera to the BeagleBone board and, log in into the system. The setup looks as shown in the following picture:

  2. Create a new directory for this project with sudo mkdir HomeSecurity:

    Use cd HomeSecurity:

  3. Create the Python script for the project using sudo nano EmailAlert.py:

Type the following code into the file. The code contains comments on most of the lines to give you a clear explanation of how it works.

Once you have typed the...