Transfer data through audio jack cable over two Android devices
Asked Answered
R

2

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.

Ross answered 6/3, 2013 at 4:29 Comment(8)
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!)Behka
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.Behka
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.Ross
Just google "QAM Modem"Behka
I think using audio connectors on mobile devices to transfer data has been solved before on Android. Have a look at these folks - they have sample code too.Pander
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.Bibelot
@Behka 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.Twum
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.Behka
G
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.

Goodard answered 26/3, 2013 at 12:21 Comment(0)
V
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

Volin answered 16/9, 2014 at 14:4 Comment(1)
Link-only answers are deprecated on SOHowdah

© 2022 - 2024 — McMap. All rights reserved.