I'm incredibly lucky to be both healthy and able to work from home during this coronavirus crisis. That means I spend large chunks of my day on video calls.
As a courtesy to my family, all of whom are also working and schooling from home, I've tried to warn them when they risk being broadcast to my colleagues.
Now I have a fun "on air" light to help! And I've put the code online so you can make one, too.
I realized this might be possible when my Quartz colleague David Yanofsky mentioned it was possible to monitor the status of a MacBook's camera using code available on the internet. No matter if I'm Zooming, Bluejeansing, Google Meeting, or FaceTiming, I could programmatically detect whether the camera is on.
Enter a little DIY computer board I've been playing with called a Circuit Playground Express, which is loaded with lights and sensors and is super easy to program in a Python variant called CircuitPython. I knew it would be a breeze to get something bright and pretty going in response to my camera status.
(Adafruit, the maker of Circuit Playground Express, has closed temporarily because of social-distancing efforts in New York City, where it's located. But you may be able to buy one from Digikey.)
The nifty thing about Circuit Playground Express is that, once configured, it plugs into a computer's USB port and shows up as an external drive. To change the lights on the board, I just update a file called "code.py" right on the board. That's pretty slick.
So I wrote a little script in Node that checks the camera every 5 seconds and replaces that "code.py" file depending on whether the camera is on or off. Then I figured out how to get the program running automatically when I start my Mac by adding a line to my crontab file.
For detailed steps, and the code itself, check out my repository on GitHub.
See you on Zoom!