40

I'm researching on transferring text data over male-to-male audio jack cable.

I'm testing this on HTC one V and on PC, which supports male-to-male audio jack for data transfer as mentioned in this Wikipedia article. It says:

The first, which places the return signal on the second ring and the microphone on the sleeve, is used by Apple's iPhone line, HTC devices, latest Samsung, Nokia and Sony phones, among others.

You can see my code here.

Problems I face during transfer: if I generate tone by entering any value from 0-31 at sender side, receiver will get actual value in 2-3 try due to the wrong type of FSK modulation/demodulation. Would you suggest the best error correction code that will help me out for correcting the input received from another Android device?

If anyone has done this type of data transfer before, please suggest a code reference or some basic guidance regarding technical aspects, so I can complete this and make it open source for everyone.

Guru
  • 21,652
  • 10
  • 63
  • 102
Dipali
  • 374
  • 2
  • 5
  • 22
  • 4
    I would imagine you have all sorts of issues, due to mismatched impedance and gain. The FSK issues you're seeing are likely due to reflection; try a shorter cable. Aside from that, since you're essentially writing a modem, look into using QAM rather than FSK, and turn down the gain if you can, to eliminate cable reflection (or better yet, match impedance!) – 323go Mar 06 '13 at 05:41
  • 8
    On a personal note, while this is an interesting project, it seems that between Wifi, WifiDirect, Bluetooth, NFC and AndroidBeam (which combines the previous), device-to-device data-transfer is a problem that has been solved. I admire your enthusiasm. – 323go Mar 06 '13 at 05:43
  • You are right @323go, But i confused with FSK & QAM, so can you please provide any kind of links which gives me clear idea about what exactly FSK & QAM technique used for? so i can select appropriate method for my project. – Dipali Mar 06 '13 at 06:18
  • Just google "QAM Modem" – 323go Mar 06 '13 at 15:02
  • I think using audio connectors on mobile devices to transfer data has been solved before on Android. Have a look [at these folks](http://pressurepen.us/pages/faq) - they have sample code too. – halfer Apr 29 '13 at 10:37
  • Sad to see the severely mistaken comment about "cable reflection" multiply upvoted. Such issues do not become noticeable until the cable length is a significant fraction of a wavelength, which would be kilometers of cable even at the highest audio frequencies the device can handle. – Chris Stratton May 07 '13 at 20:40
  • @323go I'm about to design hardware device that connects with android phone. Manufacturers disable USB-OTG and bluetooth is complicated to deal with - connection via audio cable is ideal for me. I came here from google. – Tomáš Zato Dec 26 '14 at 23:16
  • Bluetooth isn't difficult, @TomášZato. You can get a BLE modem on a chip with an ARM Cortex M0 for less than $3 in quantity. Works with any BLE capable Android, and on top of that, you get iOS compatibility thrown in. Comparatively, you'd deal with variant audio hardware, inconsistent lag, possible jitter, gain pre-amps with of doubtful performance, etc... What you might save in hardware cost, you'll spend many times over in support. – 323go Dec 27 '14 at 03:36

2 Answers2

15

I'm looking for the same, I got one awesome explination about Transfering data using audio signal in android by Sudar , go through once that may be helpful to you.

Community
  • 1
  • 1
LOG_TAG
  • 19,894
  • 12
  • 72
  • 105
0

The slides here are even more detailed: Showing how to communicate with an Arduino and reading a light signal and convert it A/D.

http://de.slideshare.net/wolfpaulus/android-arduino-and-the-headphone-jack

Phlogi
  • 379
  • 3
  • 7