Saturday, February 19, 2011

Underwater ultrasonic data modulation?

I'm currently looking for a bit of a combination hardware and software project to fill the boredom, so I've been thinking about underwater ROV's. Traditionally these use a surface tether for command communication (presumably with some basic protocol) and a feed from the camera and sensors.

I'm wondering what kind of distance I could get with modulated ultrasonic transducers?

I am quite sure how to design a suitable protocol; in fact I can reuse a lot of the bit-message code used in Quake 3 (there are lots of gems in there.) That provides me with compact messages, and with Huffman compression and an optimized table (based on either simulated or real-world packet capture) the compression ratio becomes pretty good. I think it would even be possible to send the surface a low-resolution/low-FPS video feed, while recording the high-resolution real-time feed to a solid-state drive.

The challenging part would be modulating the data; I have no idea how to choose a carrier frequency and modulation scheme for low-frequency (longer range, less ambient noise) ultrasonic transducers.

Furthermore, assuming the ROV and surface use the same frequency, the link would be half-duplex. This should be fine in theory as the protocol could be designed around this, but ultrasonic is still sound, so picking up an echo is a definite possibility (less so in open water.) I don't see this being too much of a problem (famous last words) because the protocol would be designed to be inherently unreliable: packet sequence number checking, CRC check, sanity check on values.

Far more concerning would be the potential to output too much power and thus be damaging to divers ears underwater. I guess that would just be a matter of capping the output power at the maximum exposure limit for the length of the dive, minus an N percent safety margin.

At least those Full Face Mask underwater communication systems seem to work very well for voice, and do not have any exposure limits that I know about. Quick Google search shows one rated for "50 to 500 meters depending on Sea Conditions and noise levels." Of course, this is voice which is much higher bandwidth than a simple command stream and perhaps 640x480 compressed 1 FPS video.

Anyone out there know about modulation schemes? There's a little on Google, but not too much; possibly I don't know what I'm looking for, though.

Just a random brain-dump idea I've been thinking over; at least writing this post breaks the boredom somewhat and might even motivate me to work on code for the sinking ship that is Nokia. Last I checked the stock was down ~20% and dropping since Stephen Elop's announcement. Ah, back to my general state of pessimistic realism.


  1. Interesting to note that a Google search for "ultrasonic data modulation" points to this page as the first listing...

    What the hell, someone must have done research on this prior to my brain-dump post. I know voice can be modulated over ultrasonic (underwater diver communication units exist) so data should not be a far stretch...

    I wonder whether for example, want to keep their technology proprietary, which could explain the lack of available information.

  2. I think that AFSK (Audio frequency-shift keying) should be simple enough to implement on for example an AVR using it's internal timers, then an interrupt to change the frequency when input is received on an input pin.

    Thus the transmitter would begin transmitting a carrier of 40kHz, then switch to a slightly lower frequency when sending a 1 bit.

    Of course this would require a bit of trickery because the receiver has to listen to silence, then pickup the 40kHz preamble, then listen for the real data packet, then the transmitter becomes silent again.

    The receiver then sends back an ACK in the same way, and performs whatever action specified by the protocol packet.

    Most of the professional underwater transducers I've seen operate around 200kHz. I don't think I can over-drive a 40kHz transducer quite that much and expect usable data.

    Anyway, AFSK seems like a viable modulation scheme. I would just need to brush up on analog electronic design for demodulation. Although maybe an ADC chip could handle these frequencies...

    Oh, too bad oscilloscopes and hardware to properly work on such a project are expensive; at least it was interesting to research.

  3. Ouch! Looking at ~$130 USD per transducer for the "underwater" models. I honestly don't expect there is any real difference between these and normal transducers (which are about $5 USD) other than a fancy plastic case, and having the leads potted in epoxy; which is probably required for conductive water (i.e. sea water.)

    It's also about a 15 min DIY job (excluding epoxy drying time.)

    Hmm. I really wish I had an oscilloscope and a couple of transducers; actually I believe they are matched pairs: TX/RX) so that would be 4 total. However two would be enough for testing a single link.

    Oh, and an EE workstation (components through-hole and SMD, breadboard, access to PCB prototyping facilities, bench power supply, soldering station, etc.)

    That should just about do it...

  4. Hi! Found here when you asked things on ##electronics. I guess I'll post the main points here, just because this is so high on google results now :)

    I think this transducer looks promising:

    Those seem to oscillate for 2-3 cycles after the incoming pulse, so maximum bandwidth with phase shift keying would be around 10kbps.

    Also audio (speech quality) is not necessarily so high bitrate. For example Codec 2 takes just 2400bps.

  5. Hi jpa,

    Yeah, I was amazed that I'm the top result for "underwater ultrasonic data." Not complaining. ;-)

    Thanks for the info, both here and on ##electronics. I didn't take into account possible oscillations after the initial pulse which could be problematic.

    Anyway, they look like decent units to prototype with and figure out the best modulation scheme. There is surprisingly little data (at least that I have been able to find) on the subject, so I expect the best place to start would be a water tank, oscilloscope, and try different modulations.

    Perhaps moving to the local swimming pool if they would allow; of course it's not as conductive as sea water but should give an indication of what works well, and what doesn't.

  6. Here are some results that I measured today (I needed the same data for my own use anyway :)

    See also the test setup.

    The transducer oscillates quite long afterwards.. I count 14 strong pulses received even though I transmit only 10.

    That is partly why I thought PSK might be useful. If you shift the phase 180° then the next pulse would zero out any remaining oscillations.

  7. Hi jpa,

    Thanks again for the test results (for some reason, BlogSpot marked it as spam so I had to login and correct that.)

    I would have to do some research into phase-shift keying because this is something I've never done before; in fact, my analog electronics knowledge is quite rusty. I've been spoiled by digital microcontrollers etc.

    I agree though, killing any remaining oscillations would be a good idea, so PSK is worth investigating.

    It seems that this transducer will work underwater quite well (although for long-term use I would put some epoxy on the exposed leads.)

    Of course the sound wave is transmitted much faster underwater, which could perhaps be an advantage for me; although it may make the receiver circuit more difficult.

    Now buying an oscilloscope is starting to look very useful. :-)

  8. As per our IRC discussion, maximum data transfer rate if you use these transducers seems to be quite low. However I'm still trying to use PSK for pulse compression, so I might as well keep you posted :)

    I made a new, more advanced RX/TX amplifier last weekend. I can finally both send and receive on the same channel.

    This is my first successful PSK pulse, transmitted in air to floor 1 meter below and reflected back:

    A few points of interest:
    - I transmitted 10 cycles, switched polarity and transmitted another 10 cycles.
    - Phase is indeed reversed midway, if you check it against the tick marks.
    - Second pulse is weaker because it had to undo the oscillations of the first pulse.
    - Phase changes slowly over a span of ~8 cycles (200 µs).

  9. Hi jpa,

    Thanks for the update. Unfortunately I haven't had time to setup my own EE workbench and try some of these things yet.

    I've been crazy busy lately. :-(

    Please do keep me in the loop on your experiments though, it's very useful and I'm learning a lot; it seems that maybe there would be enough bandwidth for control packets (few byte messages) but perhaps not enough for an image...