Programming the BeagleBone Black with Python    Send article as PDF   

Building a surveillance system with a PIR sensor, the BeagleBone Black and Python.

The BeagleBone Black is an outstanding tool for projects that involve the Internet. Access is easy (simply connect it to the router through an Ethernet cable ), and both Python and JavaScript feature libraries that greatly simplifies matters.

This Article was written by Rui Santos and Luís Perestrelo authors of BeagleBone For Dummies.

PIR sensors are quite neat devices that are able to detect motion. Their output pin, which will be connected to the BeagleBone Black sends a digital signal HIGH whenever somebody passes by, and is LOW whenever else. Automatic lights in public places are built on this concept.

The project sends you an email whenever motion is detected.

beaglebone black pir motion sensor

Parts Required

Here’s a list with everything you need:

This PIR motion sensor is a $2 sensor that is used to detect movement from humans or pets.

I’m currently working on a new project and I needed to make this module operate at 3.3V. By default this module runs at 5V, but it has an on board voltage regulator that drops that voltage to 3.3V. With a quick online search I’ve found a blog post that explains how you can bypass the voltage regulator and use this module at 3.3V, which is exactly what I needed.

Before soldering

Some of these modules come with pins soldered in that top right corner, so you don’t have to solder anything. You would simply connect a jumper wire to that pin that is highlighted in red (see Figure below). With my particular sensor I had to solder a small wire.


After soldering

Here’s how it looks, now if you supply 3.3V through that red wire your module works at 3.3V.




Python Code

NOTE: You can only use this example with Gmail. And don’t forget to replace the example below with your own credentials…



Now you’ve built your own surveillance system that sends you an email when the PIR sensor detects movement!


Previous Post

Programming with BoneScript on the BeagleBone Black

This Article introduces BoneScript, a Node.js library containing functions specially created for the BeagleBone Black. This library simplifies the process of accessing and configuring the pins of your BeagleBone Black. ... Read more

Short URL:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Do NOT follow this link or you will be banned from the site!