RaspberryPi + GPIO + Asterisk + Staples red light

One day I was walking around Staples and I saw a cool red light that really had no application.  It was a simple red light with a switch that woudl turn it on and off.  Right away I thought that it would be cool to do something with the light but at the time wasn’t sure what.  Stupid impulse shopping bins… I bought one.

Then one day I was talking with a co-worker and realized that the person at the next desk was on the phone.  I immediately thought we needed some sort of notification system to alert others that someone was on the phone.   The problem was directly related to the fact that many at the office use soft-phones to the PBX instead of using the standard handsets.  As a result, it is often not obvious if someone is on the phone or just listening (and singing along) to streaming music.


So I dug out my old K8055 controller board and started trying to figure out ways to control the light through software. Originally I was looking at an Arduino solution but around this time I started hearing about the RaspberryPI devices and how cool there were.

Raspberry PI Device
Raspberry PI Device

Needless to say I had to get one of these devices to see how great they were and if there was any way I could program it to do my robot bidding..  yes, I still dream of creating a robot, just haven’t found the right pile of electronics yet (ask my wife, and she’ll tell you I have too much electronics crap already..  😉

Once My PI arrived, I immediately started tinkering and looking into cross platform toolchains.  Originally I was developing on a Ubuntu VM as it proved to be easier to setup than Windows (I now use Windows for development). The K8055 was great as a first run at my call notification system.  I had some of the code still kicking around from some of my old projects and it converted nicely to the RaspberryPI.

During the development and staging I realized that I didn’t like the fact that I was going to have to give up my K8055 and one of my PI’s.  I also didn’t like the idea of the light running off of 3 AA batteries.  I could see the light eating batteries on a regular rate.

I started reading about GPIO and how I could control the world directly with the PI…  This meant that I wouldn’t have to give up my K8055 board, but it mean that I was going to have to learn about GPIO and more importantly switching electronics.

Ener in my latest project which was a great learning exercise.   I learned about transistors and GPIO switching.  Managed to burn out a PI in the process, but the reward at the end was worth it.

This video demonstrates how all the pieces came together…  I plan to post the details and code when I have a chance…

The source code is a C++ project compiled under Eclipse on Windows 7 with the RaspberryPI tool chain.

RaspPIController.zip