Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read/send data using the Android Devices 3.5mm headset jack?

I was just stumbling around EE Stack and found this post: What protocol does a headphone jack use. And it sparked some curiosity in me, and I figure, if the iPhone can do it, I want to as well.

Does any one know of any projects that are doing this now or whether or not it's even possible?

UPDATE

RIP

like image 907
ahodder Avatar asked Oct 28 '11 15:10

ahodder


People also ask

Can you transfer data with 3.5 mm jack?

You can connect your iPod Shuffle to any tablet, desktop or laptop computer to charge and transfer data at the same time - simply connect the 3.5mm connector to your Shuffle and the USB plug into your Mac, PC or laptop.

How do you use a 3.5 mm jack?

The 3.5mm headphone jack is an industry standard audio plug. Most commonly used for connecting a pair of stereo headphones to your smartphone or 'piping' your audio from your phone to an external amp either in your home or your car. Dependent on the number of connector rings, headphones can also include a microphone.

How do I use my headphone jack input and output?

Right click Volume icon in System Tray at right end of task bar, Open Sounds Settings, in dropdown menus at top make sure Headphones are selected and Connected for both Playback and Recording Default Devices.

How do I use my headphone port as an input?

In the 'Sound' window, click the 'Input' tab. Your headset should be visible in the 'Select a device for sound input' section. Make sure to select your chosen input device. “Sound” window with “Input” and “Select a device for sound input” highlighted.


1 Answers

You are basically asking how to turn the microphone input into a modem input. A variant of this clever technique is used commercially by Square for their magstripe readers on both iOS and Android devices.

To do so requires getting access to the raw PCM stream from Android and decoding the input. Luckily for you, someone has already done it and thrown the source out there. See this Hack a Day linked project for sample Arduino and Android code for transmitting only.

I couldn't find example Android code to receive, but there are rather extensive notes on doing FSK with iOS in this Arduino forum post.

(Though it wasn't your question, an easier way to get data in and out of an Android device is the new USB Host and Accessory support. It requires a newish phone and OS, so not as flexible as the audio route.)

like image 72
mik3y Avatar answered Oct 06 '22 13:10

mik3y