Skip to content

Unidirectional communication protocol through ultrasonic audio waves (~20 kHz) from a master device and performing FFT on the slave (TM4C123 - ARM Cortex M4)

Notifications You must be signed in to change notification settings

DevanshV/Ultrasonic-Audio-Communication

Repository files navigation

Ultrasonic-Audio-Communication

Unidirectional communication protocol through ultrasonic audio waves (> 20 kHz) from a master device and performing FFT on the slave (TM4C123 - ARM Cortex M4)

Click for Demo Video Diagram

Goal

Send data through audio! I wanted to set up a system to send ultrasonic audio, this was largely inspired by the "Sonic" Screwdriver in Doctor Who.

Initially, I simply wanted to send binary commands, however, I ended up adding onto to the project to send full ASCII messages.

Setup and Required Hardware

The receiver code is written for a TivaC microcontroller. However, any device with a microphone can be used to transmit the high-frequency data. This could include a smartphone, computer or microcontroller.

Protocol Setup

Each bit consists of 5 frames, while each frame contains 1024 samples (20ms) for which frequency is determined. As a result, it takes 100ms to transmit 1 bit. Since 5 frames are used per bit, we can avoid erroneous transmission and limit the effect of drifting due to clock inaccuracies.

Out-of-band signaling is used to determine the start of transmission. The start sequence consists of alternating bits (0b10101010), that is transmitted at a different frequency than the rest of the data.

The stop condition is a 0 byte (0b0). In ASCII, 0 is the NULL character, as a result, we can take advantage of this as an end condition.

Limitations and upcoming changes

Although this was greatly resolved through synchronization and hardware optimization, during testing, it was apparent that the clocks drifted. This resulted in the frames coming out of alignment with the receiver/transmitter. The transmitter used was an Arduino board where there are known inaccuracies since an RTC was not used. As a result, accuracy may decrease over long transmissions. On the TivaC receiver, a Ping-Pong uDMA is used to ensure a continous flow of data, this allows us to process data, while the next frame's samples are being collected in hardware. I plan to add resynchronization every 100 bits to avoid such issues.

About

Unidirectional communication protocol through ultrasonic audio waves (~20 kHz) from a master device and performing FFT on the slave (TM4C123 - ARM Cortex M4)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published