Hey there, human — the robots need you! Vote for IEEE’s Robots Guide in the Webby Awards.

Close bar

Power Your Holiday Displays With the $25 PocketBeagle

This Linux board uses two dedicated subprocessors for real-time control

3 min read
Photo: Srihari Yamanoor
Photo: Srihari Yamanoor

imgPhoto: Srihari Yamanoor

The BeagleBoard.org Foundation is a nonprofit dedicated to developing open-source embedded hardware and software. The foundation’s latest creation is the PocketBeagle, a single-board computer that runs Linux. The PocketBeagle debuted at the World Maker Faire this past September in New York City, and we were lucky enough to be there and win one of the first boards.

BeagleBoard.org makes a number of boards designed for different applications, such as robotics. These typically sell in the US $60 to $125 range. At $25, the PocketBeagle is designed to be a low-cost variant. But it’s not just a stripped-down version of the other boards, as the PocketBeagle offers some interesting features of its own. So we immediately started thinking of projects that we could try out with the board, settling on a light controller for a festive village diorama for the coming holiday season.

The PocketBeagle runs Debian Linux, and hence it is possible to develop applications in different programming languages, including Python, Ruby, or BoneScript. The latter is a library built on top of Node.js that was developed for the Beagle family: It allows you to program and control devices using Web pages and JavaScript. What’s really interesting about the PocketBeagle is that in addition to a primary CPU that runs the Linux operating system (an ARM Cortex-A8 running at 1 gigahertz), the processor at the heart of the PocketBeagle also has two programmable real-time units (PRUs).

These are, in essence, independent 32-bit microprocessors that run at 200 megahertz and are designed to communicate with external hardware. Debian Linux is not a real-time operating system (which would guarantee the precise timing of running code), but suitably programmed PRUs allow the system as a whole to handle real-time applications, such as flying a drone. The PRUs are typically programmed using the C programming language, but the BeagleBoard community is working on projects that should enable programming the PRUs using Python or an Arduino-like integrated development environment (IDE).

Setting up the PocketBeagle to run Linux was a straightforward process that would be familiar to any reader who has set up similar single-board computers, such as the Raspberry Pi. However, we quickly ran into problems trying to use higher-level tools, such as BoneScript, to create our own control software. We also ran into difficulties trying to compile code for the PRUs and were eventually forced to abandon them. After some investigation, we realized that the common cause of these problems was that the supporting BeagleBoard tool chain had still only partially been ported over to the new board. Because the BeagleBoard is a popular platform with an active user base, we expect that this will soon be remedied with open-source contributions.

But for now we had to find an alternative, so we settled on writing software exclusively for the main processor in C, using Jack Mitchell’s libsoc library. This library provides basic hooks in the kernel of the operating system for controlling peripherals, such as the general-purpose input/output (GPIO) connections on the PocketBeagle. (You can find our code at https://github.com/sai-y.)

Our goal was to control lighting that fell into three broad categories: low-power LED ornaments that run on 5 volts; analog RGB LED strips that run on 12 V and are controlled by adjusting the voltages for the red, green, and blue strands that make up the strip; and conventional string lights that run on 110 V from a wall socket.

The PocketBeagle’s GPIO connections operate at 3.3 V, so we built a transistor-based switching circuit to control the low-power ornaments and the RGB LED strips using pulse-width modulation to vary the effective voltages. We decided to use off-the-shelf hardware that is designed to operate AC appliances. This hardware uses optically isolated relays that can be switched using a 3.3- to 5-V trigger signal, allowing us to control two power circuits that are normally on and two that are normally off.

We ran into a small wrinkle in actually connecting these switching interfaces to the PocketBeagle: As did the creators of the Raspberry Pi Zero and Pi Zero W, the makers of the PocketBeagle kept costs down by omitting headers for the 36-hole double row of GPIO connections on either side of the board. We had a surprisingly hard time finding suitable female headers to solder onto the board. It would be nice if the BeagleBoard.org Foundation could provide some links to sources for purchasing the headers.

It’s also worth noting that, in another sacrifice that appears to have been made to control costs, the PocketBeagle has no wireless or Ethernet network capability. If, for example, you want to control the computer via the Internet, you will have to either tether it via USB to a host computer that is connected or purchase some add-on hardware such as a MikroElektronika click board.

All that aside, we soon had our little festive village glowing and blinking under PocketBeagle control. Regardless of its current shortcomings, we love this new board.

This article appears in the December 2017 print issue as “DIY Digital Decorations.”

This article is for IEEE members only. Join IEEE to access our full archive.

Join the world’s largest professional organization devoted to engineering and applied sciences and get access to all of Spectrum’s articles, podcasts, and special reports. Learn more →

If you're already an IEEE member, please sign in to continue reading.

Membership includes:

  • Get unlimited access to IEEE Spectrum content
  • Follow your favorite topics to create a personalized feed of IEEE Spectrum content
  • Save Spectrum articles to read later
  • Network with other technology professionals
  • Establish a professional profile
  • Create a group to share and collaborate on projects
  • Discover IEEE events and activities
  • Join and participate in discussions