windows-phone-7serial-portarduino.net-gadgeteer

How to use the headphones jack to send data to a circuit board in WP7 or WP8


I just wanted to know if there is a way to send data through Headphones Jack to a circuit board like arduino or a custom circuit board that handles serial communication or something like that.


Solution

  • IF?

    This is possible, but there are quite a few caveats - all of these grouped around the fact, that audio playback, and by extension the headphone jack are not exclusive resources.

    Additionally, sinve the connection is simplex, you should consider idempotency and send every command twice or more to increase reliability.

    HOW?

    Just play back the correct sounds in the correct sequence to send a command (maybe idempotently repeating), have the receiving board decode the sounds and act accordingly.

    We did this successfully with Android, but I don't think there should be any difference with WP, as playing a sound file is a very basic operation.

    Four our implementation (On/Off for N devices), there were N+4 different precreated sounds:

    All of these can be repeated without side effects.