This project is just for fun. It lets you show others that you are busy with an audio or video call by lifting a flag. Yes, a real flag. It works with Skype, Zoom, Teams, etc.
This project is designed for Linux users and has been tested on Ubuntu only.
- Build Arduino device
- Upload device.ino to device (make sure to set correct pins for led and servo)
- Plug in your device into USB port
- Clone this repository
git clone https://github.com/igorzel/narada.git
- Check Arduino's Vendor and Product using
lsusb, for example Vendor is1a86and Product is7523 - Set Vendor and Product in 95-narada.rules file
- Locate Arduino device serial port in this directory
/dev/serial/by-id/, for example it can be/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0 - Set serial port in narada.sh and narada.service files
- Disconnect device from USB
- Run
sudo ./install.sh
- Plug in your device into USB port again
- Make an audio or video call
- Disconnect device from USB
- Run
sudo ./uninstall.sh
The project consists of two components:
- A Bash script that runs on Linux and detects whether the microphone is in use or not and sends commands to Arduino device using serial port
- An Arduino device that controls a servo motor to raise or lower a flag accordingly
narada.sh is a script that detects whether the microphone is in use or not.
High level logic:
- Setup serial device using
stty - Every 10 seconds check if any of microphone device is in RUNNING state using
catandgrep.
All the magic is here:
cat /proc/asound/card?/pcm*c/sub0/status 2>/dev/null | grep -q "state: RUNNING"
- If any of the microphones is in RUNNING state then send command
ONto serial port, if not - sendOFF
narada.service systemd unit runs the bash script as a service. Service starts automatically when device is plugged in (see udev). After device is disconected service stops.
95-narada.rules is an udev rule to set permissions for Arduino serial device and start systemd unit service if device is plugged in.
drawn in https://www.circuito.io/
High level logic in device.ino:
- Setup serial port
- Set Led pin mode to OUTPUT
- Listen to serial event
- When command received attach servo
- If command is
ON:- Move servo to lift a flag with step 1 and delay
- Set Led pin to
HIGHto turn it on
- If command is
OFF:- Set Led pin to
LOWto turn it off - Move servo to lower a flag with step 1 and delay
- Set Led pin to
- Detach servo