Hackaday Dictionary: Ultrasonic Communications

Say you’ve got a neat gadget you are building. You need to send data to it, but you want to keep it simple. You could add a WiFi interface, but that sucks up power. Bluetooth Low Energy uses less power, but it can get complicated, and it’s overkill if you are just looking to send a small amount of data. If your device has a microphone, there is another way that you might not have considered: ultrasonic communications.

clipThe idea of using sound frequencies above the limit of human hearing has a number of advantages. Most devices already have speakers and microphones capable of sending and receiving ultrasonic signals, so there is no need for extra hardware. Ultrasonic frequencies are beyond the range of human hearing, so they won’t usually be audible. They can also be transmitted alongside standard audio, so they won’t interfere with the function of a media device.

A number of gadgets already use this type of communications. The Google Chromecast HDMI dongle can use it, overlaying an ultrasonic signal on the audio output it sends to the TV. It uses this to pair with a guest device by sending a 4-digit code over ultrasound that authorizes it to join an ad-hoc WiFi network and stream content to it. The idea is that, if the device can’t pick up the ultrasound signal, it probably wasn’t invited to the party.

We reported some time ago on an implementation of ultrasonic data using GNU Radio by [Chris]. His writeup goes into a lot of detail on how he set the system up and shows a simple demo using a laptop speaker and microphone. He used Frequency Shift Keying (FSK) to encode the data into the audio, using a base frequency of 23Khz and sending data in five byte packets.

https://www.youtube.com/watch?v=H0DKRl8XIcU

Since then, [Chris] has expanded his system to create a bi-directional system, where two devices communicate bi-directionally using different frequencies. He also changed the modulation scheme to gaussian frequency shift keying for reliability and even added a virtual driver layer on top, so the connection can transfer TCP/IP traffic. Yup, he built an ultrasonic network connection.

His implementation underlines one of the problems with this type of data transmission, though: It is slow. The speed of the data transmission is limited by the ability of the system to transmit and receive the data, and [Chris] found that he needed to keep it slow to work with cheap microphones and speakers. Specifically, he had to keep the number of samples per symbol used by the GFSK modulation high, giving the receiver more time to spot the frequency shift for each symbol in the data stream. That’s probably because the speaker and microphone aren’t specifically designed for this sort of frequency. The system also requires a preamble before each data packet, which adds to the latency of the connection.

So ultrasonic communications may not be fast, but they are harder to intercept than WiFi or other radio frequency signals. Especially if you aren’t looking for them, which inspired hacker [Kate Murphy] to create Quietnet, a simple Python chat system that uses the PyAudio library to send ultrasonic chat messages. For extra security, the system even allows you to change the carrier frequency, which could be useful if the feds are onto you. Whether overt, covert, or just for simple hardware configuration, ultrasonic communications is something to consider playing around with and adding to your bag of hardware tricks.

27 thoughts on “Hackaday Dictionary: Ultrasonic Communications

    1. My masters thesis in ’01 was M2M sub-audible communications. Sub-audible meaning its technically in the audible range but the average person couldn’t hear it (using psychoacoustics). Though people with acute hearing (typically younger people and/or female) could hear it if they were directly in the path.

      In practice it has limited utility because high frequencies are very directional in nature meaning the if the emitter isn’t pointed directly at the receiver there was a huge drop in dB. Compensating this with better equipment make the price and physical dimensions go up (I ended up using a professional omni-mike, a 24bit 128ksps digitizer (~$500 at the time) and a 4″ tweeter horn). Even with this setup anything > +/- 30degrees became difficult to pick up.

      The more interesting application was digital fingerprinting audio (at the time mp3 file sharing was a huge concern), where the mechanics of mp3 encoding are exploited to encode data in the stream that isn’t audible. The university sought to patent this but I went to work for the USPTO and was barred from participating in the application. I have since since similar applications that would be used as prior art against any new applications.

  1. You can get a surprising amount of sound pew mW, especially at high frequencies, but that’s besides the point. If you already have a system with a speaker, using ultrasound gets you an extra communication channel for free.

    1. I recieved an ultrasonic signal from Australia, by moon-bounce and venus-bounce mode. TX power only 1 microwatt, CW frequency 10 khz. (I think this may have happened, possibly just a dream but not really, though……and.)

  2. “outside of hearing range” is a bit of a misnomer. People do hear it, but you need a louder sound to be heard at higher frequencies. There’s experiments with people recognizing and understanding voice that is transmitted at ultrasound frequencies if it’s directional and loud enough.

    Furthermore, the non-linearities in the transmission of sound cause some of the signal to be “heterodyned” down to lower frequencies, which can make it audible in practice.

    1. I don’t know why, but I think they can make you feel a little sick. When we were testing our accelerometers and amplifiers at ultra-sonic-ish frequencies (~14-20kHz), we could definitely see how hearing degraded with age, however, independent of age, we didn’t like how we felt with the high frequencies bouncing away.

      1. You know the squeaking logitech mice that emit a sound at some multiple of the 12 Mhz USB clock. I can’t hear those things anymore -except- when I press my ear to it. It definitely creates an ambience, and when the sound bounces off of some corner in a shelf or a flat wall, I can feel it.

        1. On another thought, I remember when I was about 11-12 and we built a “mosquito repellent” device in shop class, and it operated by sounding a tweeter at 25 kHz, and we all definitely heard it. You could turn it on in another room and the kids in the other room could shout when they heard it.

    2. It’s not a misnomer at all. The reason it needs to be louder is precisely because your hearing is diminished at that frequency. It’s just that not everyone has the same cut off frequency. “Ultrasound” is just a range. It doesn’t mean that as soon as you get to 20,001 Hz that it is undetectable to the human ear, just that that’s the region where most peoples frequency response is rolling off.

      1. “outside” implies that it’s beyond human perception entirely, not just “poorly percieved”. Almost everyone can hear a sound at 20 kHz if you play it loud enough.

      2. Correct – have you ever entered a department store and perceived a very high pitch tone? It’s deliberate and is modulated with speech. You won’t believe the content. Something about suggestions to not steal?

        Also most adults can hear the fly-back transformer of the old CRT TV sets. They ran at 15,750,000 Hz. How about someone transmitting Slow Morse at 20KHz to teenager HAM radio enthusiasts. Secret marketing technique like at HAM RADIO OUTLET (USA)? try it yourself and find your limits: http://plasticity.szynalski.com/tone-generator.htm

        1. “Also most adults can hear the fly-back transformer of the old CRT TV sets. They ran at 15,750,000 Hz. ”

          No. Most adults *can’t* hear that. It’s pretty much the domain of sub-30 year olds. Standard hearing thresholds also indicate that definitely by 55, 15 kHz is basically gone (40 dB higher threshold level).

          But the flyback doesn’t just emit at 15.75 kHz, and your ear, even at youth, is *way* more sensitive to anything emitted at lower frequencies, so you hear those, and think you’re hearing the 15.75 kHz pitch.

          Random test data basically shows 15.75 kHz becoming inaudible around 35 or so.

          1. Pat – you’re right. I should have said “felt” or “sense” not direct “hear”. Us old-timers can sense them but no one uses fly-backs anymore in this flat screen LCD world. But older electronic camera flashes still give off a very high pitch signal on recharge. And some older CCTV cameras still emit detectable pitch signal.I tried that program I posted here somewhere and I noticed a definite reduction in my sensing of 15.75 KHz but I could still “sense” it’s presence.

  3. Let’s broadcast ultrasonic over speakers not designed to reproduce ultrasonics that are driven by amplifiers not designed to run into the ultrasonic frequencies.
    People will hear that as distortion, especially if something else is going on at the same time because that’s just the result of trying to reproduce ultrasonics on regular home items. Oh and it’s why 192kHz recording is actively a bad choice.

  4. My grandfather did have a TV with a remote that worked without battery. The remote had few buttons (maybe just 2 or 4). Pushing a button charged a spring mechanism that hit on a rod making a sound and the TV changed channel.

    1. Zenith Space Command. The hammer hits the end of an alloy rod held loosely by the center in a groove, It’s a longitudinal vibration not hit the way one would hit a xylophone bar. They went up to 4 tones 14-22kHz.
      Happy legal dogs and jingling keys would make the set change anything it could.

      1. Somewhere around a year ago I had a reel to reel machine that had ultrasonic remote control. It’s called “Маяк 001 стерео” (this one: http://www.rw6ase.narod.ru/00/mg_kat/majak001_00.jpg). I mean, I didn’t have the remote itself, but I do remember playing around with piezo transducer and a signal generator to trigger things on it. I remember all 4 tones being somewhere in the range of 40…50KHz.

        Remote was electronic, though. 5 buttons, signal gen, battery and a piezo…

      2. And the TV had to be unplugged when using a vacuum cleaner, or the TV would turn on and crank itself up to maximum volume, every time. A TV repairman in the family would do a “TV tuner cleaning” whenever he was called out to repair a TV that just needed to be plugged in again, to prevent irate customers getting charged for an embarassing service call.

  5. i always have a good laugh when people tell me they can hear 16KHz or more when they CLEARLY have never ever heard 15.75KHz NTSC horizontal scan from a CRT flyback :D

    ive only ever met two or three people that could hear it, and they knew EXACTLY when i change channel on built-in analog tuner because it temporarily upsets the horizontal osc. as it tries to lock on, more modern sets smoothly blank the (H-SYNC) signal until after “digital lock”. some sets go WILD when set to line-in with nothing connected.

    i remember having to tell the teacher to turn off the tv during a test, had to explain that it was so loud it was distracting from the other side of the room.

    i can find my way down a hall and around the corner and point out the tv thats on merely by sound and a flick of my head to judge direction … back in the day, if your watching while on the job, i will know, and i will find you. ditto for LCD :P

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.