Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying BeagleBone By Example
  • Table Of Contents Toc
  • Feedback & Rating feedback
BeagleBone By Example

BeagleBone By Example

By : Prabakar
5 (1)
close
close
BeagleBone By Example

BeagleBone By Example

5 (1)
By: Prabakar

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 (12 chapters)
close
close
11
Index

Motion detection using PIR sensors


Now that we know how a PIR sensors works, let's go ahead and hook it up with our BeagleBone board to detect motion.

First of all, take three berg wires and connect the PIR sensor to the BeagleBone board, as per the following circuit diagram:

As shown in the preceding circuit diagram, connect the PIR sensor's Vcc to the 5V pin on the BeagleBone board, the output pin of PIR to GPIO60 on the BeagleBone board, and the ground pins on both with each other.

Then, we will turn on the BeagleBone board and log in to the Linux shell to start coding it.

Create a new Python program using sudo nano TestPIR.py:

Type in the code shown in the following screenshot:

Once you have typed in the code, you can go ahead and save it using Ctrl + X.

Have a look at the comments in the code to get an idea of how it works. We are setting up GPIO_60 as INPUT PIN, reading the RISING edge from the output coming from the PIR sensor, and printing out text saying Movement Detected every time we...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY