Georgi Gerganov's Ggwave Offers Air-Gapped Comms Between Microcontrollers, Smartphones via Sound
Operating at ranges of a little over three feet, ggwave comes with a range of application demos including device pairing and file sharing.
Bulgarian developer Georgi Gerganov has developed a compact library designed to bring wireless communication capabilities to microcontrollers and smartphones, but in a somewhat unusual way: using sound.
"This library allows you to communicate small amounts of data between air-gapped devices using sound," Gerganov writes of the software, dubbed ggwave. "It implements a simple FSK [Frequency-Shift Keying]-based transmission protocol that can be easily integrated in various projects. The bandwidth rate is between 8-16 bytes/sec depending on the protocol parameters. Error correction codes (ECC) are used to improve demodulation robustness.
With a microphone at one end and a speaker at the other — or both at both ends, if you're hoping for bidirectional communication — it's possible for ggwave to transmit data at a range of a little over three feet. "It is relatively robust towards background noise, although not perfect," Gerganov admits. "For example, a song running in the background or people talking in a room does not affect the transmission significantly, especially for the higher-frequency communication protocols."
As well as enabling communication between microcontrollers, the software also works with a smartphone — and at a higher data rate, thanks to high-quality microphones and more powerful processing capabilities. Using a smartphone as the receiver also unlocks an additional feature: ultrasound support. "Ultrasound is supported by ggwave, although you cannot use it with a microcontroller because you would need sampling rate of 48,000kHz, which is too much to analyze in real-time," Gerganov explains. "You can ultrasound with the phone app for example."
Gerganov offers a range of demonstration use cases for the library: A serverless one-to-many broadcast of a small file using a tool dubbed "wave-share;" transmitting data from a PC speaker or recording and sending commands via "talking buttons" for the Internet of Things (IoT); broadcasting clipboard contents to nearby devices using "audio QR codes" published to Twitter; pairing devices via sound alone; and authorization.
Gerganov has published ggwave to GitHub under the permissive MIT license, with support for Arduino-compatible microcontrollers and precompiled binaries for Apple's iOS, Google's Android, and Canonical's Snap Store. "The next step," the developer writes, "is to make this library available in the Arduino IDE library manager so that it is easy for anyone to add data-over-sound functionality in their projects."