Part 1 Microsoft Teams Status Tally Light: A Raspberry Pi Project from Concept to Creation


The Backstory


In March 2020, the UK Prime Minister at the time, Boris Johnson, addressed the nation to announce the stay-at-home mandate in response to the COVID-19 pandemic. This turning point marked a significant change in my work life, as it did for countless others. What I didn't foresee was the transformation of remote work from a temporary or occasional arrangement into a permanent fixture.

The shift to working from home had both its advantages and challenges. Among these challenges was the all-too-familiar scenario of being on a call while family members inadvertently made appearances, either visually or audibly. Initially, I relied on simple hand gestures to communicate my "on a call" or "not on a call" status. While effective to some extent, this approach sparked the idea that there must be a more sophisticated method to convey this information to family members.
What I needed was one of those red illuminated "on air" box things that are positioned outside of broadcast rooms! These things, also known as 'Tally' lights, are a simple way to visually indicate status
At first, I looked around at commercial offerings and found a few options, but they were either expensive or problematic.  One example is this gizmo from Luxafor. Plug it into your USB, install some custom software, give this company permission to read your team's status from Microsoft and hand over some cash.


Or how about this Kickstarter 'On Air', which comes in a nice wooden display box?
They fit the bill, but where's the fun in that! And I thought, How hard could it be to hook up an LED to my team's status and fairly quickly realised that with parts I literally have lying around, I could probably make something myself.

The Hardware


Recently my daughter had asked for a strip of LED lights to jazz up her bedroom, which I installed and had quite a bit left over, the kind that comes on a reel with multicolour LEDs spaced about an inch apart and you can cut to length. The LED's can be any RGB colour. They are not settable individually, nor is there a white, and they are all the same one colour, rather than the type which can be set individually. This makes them ideal for a status indicator. The strip has four contacts, a +12v, and three separate RGB contacts. A PWM signal is sent down each RBG trace with varying duty cycles to indicate relative brightness for that colour. That does mean I need 3 PWM signals, and even though I suspect I could find a simple IC which could do that, I do have Arduino's and Raspberry Pi's lying around that can do that job.
I decided to see if I could use the PI since I knew that would give greater flexibility on the software side. The first step would be to draw up a schematic of what the circuitry would need to look like, and there's a great free application called Fritzing  which allows for these simple mockups.


On the left are the headers which will connect to the Pi. To the right, three mosfets are used essentially to step up the 5v Pi PWM signal to 12v  and a capacitor to smooth out power drops. On the far right, a buck converter to step down the 12v needed for the lights to 5v for the Pi, and along the bottom from left to right, 2 LED connectors, a fan connector and a power connector.
I decided to have 2 LED indicators because why not? I can cut up the leftover LED strip into dozens of small strips if needed, so why not have one large strip outside of my home office room and a small one inside so I can see the status it is showing. I'll also need to include a fan since PIs can get hot, hence the fan connector.
After testing this out on a breadboard, I decided to wire up something a little more permanent. For these cases, I like to use an Adafruit Perma-proto board. These things are designed to make it easy to transfer wiring on a breadboard onto a more permanent board.
(the DuPont connectors used for prototyping in breadboards are not durable and aren't meant to be, so soldering up something more reliable was certainly needed.
An unintentionally steampunk-looking circuit board.


The board looks a little messy compared to a real PCB, but it should be reliable and has a similar enough footprint to the Pi that it can just sit on top with a couple of stand-offs on one side for support. As I usually do, I choose to use JST - Japanese Solderless Terminals - for connectors, I love these things. They're solderless, obviously. They're locking, so they won't back out and are quick to throw together. I do add a blob of hot glue on the end to provide a little strain relief, as the wire's are very thin.
For the runs of 4 wires from the board to where I want the LEDs situated, I stripped a spare ethernet cable and removed all eight wires, two lots of four needed for each run. It doesn't look all that pretty, but it works (much like myself in that regard). For now, I've connected a 40mm Noctua fan and an inline resistor to keep it spinning at a modest level. I the found an old 12v 5amp power supply - from the box of old electrical bits and bobs that every household is mandated to have - to which I put a JST connector on the end and added an inline switch. The PI needs 2.5 Amps maximum, so that should have enough headroom for a couple of small strips of LEDs and a small fan.
  
 

The Software

We have the hardware in place, but how do we control it? A simple restful API would give all the flexibility options I was looking for, so I thought that since the PI supports Python, I could probably create a simple enough script that runs a web server hosting a couple of endpoints. That way, I could control the LEDs from anywhere on the network. Inside each endpoint, I would just need to configure appropriate PWM duty cycles on the PI's header pins that the MOSFETs are connected to.
Ultimately I decided on the following endpoint.

/leds?r=0&g=0&b=0&desc=HelloWorld

About as simple as it gets. One endpoint taking four arguments, r, g and b, indicating a brightness between 0 and 255 and a description mainly for logging/debugging purposes.
It was simple enough to create a script to support this using FLASK for the webserver and PIGPIO for the GPIO and PWM control. You can find the script on my GitHub if you're interested.  

Gif showing a call to endpoint lighting up LEDs


Part 1 Wrap up

So that's it for part 1. We've explored the process of building a simple Tally light system using LED strips and a Raspberry Pi. We've learned how to wire the components, create a compact design to accommodate the LED strips, and set up a simple RESTful API to control the LEDs. In part 2, we'll build upon the work we've completed, build out our Teams integration, and make some significant hardware improvements.