Raspberry Pi, RS232 & OAuth

Just after the new year, my son’s preschool will be having a fundraiser with an outer space theme and we’re are trying to find new and interesting ways to announce the winners of the raffle prizes. I’ve been looking for a reason to start a Raspberry Pi project ever since these cool little boards were first announced. This seemed like the perfect opportunity to dig in.

I have an old LED message board laying around from one of my company’s decommissioned phone systems. It seemed time to press it back into service, but it needed a new computer brain in order to make the messaging work. Enter Raspberry Pi, the Python programming language, and a little help from Twitter. For the upcoming fundraiser, we’ll connect the board to its own Twitter account and announce prize winners by mobile messaging in addition to calling them out manually. In the meantime, it will be hanging in my Garage of Awesomeness and displaying the latest tweets from the people that @SeansGarage follows.

I really enjoyed burning a few late nights hacking this together. It gave me an opportunity to play with a few new technologies; namely serial communications, the Twitter API, OAuth and the Raspberry Pi. I am amazed, every day how a community of makers can work together to create a whole new culture around a piece of silicon. We truly live in exciting times when one can spend a few late nights banging on a keyboard and then emerge with their dreams in physical, blinking, beeping form! I had a lot of help from other makers out there to get this project to work. I could not do this without the people who have open sourced their code and hardware. The least I can do is share the lessons I learned so as to help someone else. Below is the code and the parts I used to make this LED sign come back to life:

Components of this project

  • One Raspberry Pi, model B, micro-computer.
  • CuteDigi’s UART to RS232 RPi Shield
  • An Old Spectrum 4160C LED Sign board or any other board that uses the Alpha Protocol.
  • Python with the following libraries: python-serial, python-setuptools, Mike Verdone’s Python Twitter API
  • One hand-made RJ12 to DB9 serial cable with the following wire mapping:
    • RJ12 PIN 4 connects to DB9 PIN 2 (RX)
    • RJ12 PIN 3 connects to DB9 PIN 3 (TX)
    • RJ12 PIN 6 connects to DB9 PIN 5 (GND)

Python Code for accessing my twitter timeline and printing it on the LED Sign Board:

Code to print a list of trending topics on the LED Board