21
\$\begingroup\$

I have 2 questions. One is simple, the other may be not.

1. What's the official name for the standard headphone jack? It's universal for all brands of phones, so it must have a name (when you want to go shopping for components).

2. Is it using some sort of a communication protocol? I know for a fact that it's not only for headphones. There is a device for scanning credit cards that plugs into the same jack. I believe Nexus also has a TV-out support from the same jack. Basically, can it be used for other I/O applications?

Thank you

\$\endgroup\$
  • 1
    \$\begingroup\$ The credit card scanning application probably works by receiving credit card data as "sound"(with help from a small dongle like thing) and processing it on the phone's computer. \$\endgroup\$ – Earlz Apr 3 '11 at 21:57
  • 3
    \$\begingroup\$ if it is a fact, give a link and we can weigh in. \$\endgroup\$ – Kortuk Apr 3 '11 at 22:14
  • \$\begingroup\$ The credit card scanner is called Square \$\endgroup\$ – Alex W Mar 28 '15 at 2:51
37
\$\begingroup\$

Background on the Jack

"It's universal for all brands of phones, so it must have a name" it actually isn't. There have been many phones over the years that have used various connectors. The "standard" technology is not a formal standard like what you consider things like any of the IEEE standards. The industry has just evolved over time to tend to use what we all know as a audio jack.

The typical audio only jack has 3 rings, usually call Tip, Ring, Sleeve (TRS). These typically map to Left, Right, and Ground. Phone manufactures wanted to make this jack work with existing headphone so they used a connector with 4 rings, called Tip, Ring, Ring, Sleeve (TRRS). These map to Left, Right, and ground just like the 3 ring, but the final connector maps to a microphone. This makes it so that if you plug an audio only cable into it, the microphone input gets connected to ground so nothing is hurt. It also means that if a headset with microphone is connected to an audio only device, the microphone is connected to ground, also hurting nothing. There are similar connectors in 2.5mm (used on some phones to save space), 3.5mm (for phones, mp3 player, etc) and .25" (for larger headphones, guitars, etc).

Data on the Jack

As far as what "data" travels over this, it is purely analog. Some people have reused these cables to pass serial data over them, but they are very application specific. For the case of devices using the jack for other purposes, they can do whatever they want as long as the signal on the line is band-limited, meaning that there isn't any high frequencies being used. The reason for this is that there are filter on the input that block frequencies too high. This frequency will change depending on the device itself but is usually around 12 KHz or so.

The method that people send data over this are usually all pretty similar to how phone line modems work. The general concept is that there is a mapping between the frequencies being transmitted and serial data. If you wanted to reverse engineer a system, you would need to record the line and look at what frequencies there are. The hard part is to figure out what the resulting data is supposed to mean.

2 Way Communication

I would also like to note that 2 way communication is possibly in these systems. The microphone line is used to send information to the phone and the audio out lines are used to send information back to your external device. If you are trying to reverse engineer a device, you will want to look at Mic, Left, and Right to see if there appears to be any bi-directional communication.

Reverse Engineering

I mentioned that reverse engineering would be the difficult part. Here is the method I would go about doing this:

  1. Check to see what lines have data on them. You can use a computers audio jack to capture your data with. This will probably be the easiest method to look at the data.
  2. Determine the symbol rate. Basically when you look at your captured data you should see very specific points that the frequencies change.
  3. Look to see if there are discreet frequencies being used, and how many are used at the same time. For example, there could be 6 KHz, 8 KHz, 10 KHz, and 12 KHz. These could map to 4 bits per symbol. So if you see 6 and 8 at once it may mean 1100 (or maybe 0011). Look a the next symbol and it could be 6, 8, and 12 and could mean 1101. Of course if it is a custom protocol, it could really mean anything they want it to. But this will at least give you a start.
  4. Assuming you collected the data running a card that you know the data for, you can look for patterns. Here is the information included on the cards. You could do things like if your card has a short sequence that repeats look to see if your symbols have a similar repeating pattern. Once you get some of these patterns worked out, you should be able to do a 1 to 1 comparison for the rest of the numbers, You should eventually be able to get a pretty good idea of what is being sent.

There may be some data sent that has nothing to do with your card and you may never know what it means, but as long as you know the position of the data you care about, that is all that is needed. You just have to hope that the hardware manufacture didn't put any "anti-hacking" or "anti-reuse" measures in place. Potentially the designer could have used bi-directional communication to provide encryption. It is also possible for them to just mix all of the data up so it is hard to figure out what is what. I would say it is unlikely that they have done any of this though.

\$\endgroup\$
  • 1
    \$\begingroup\$ I have been trying to find an adapter for PC like dual 3.5mm jack (sound/mic) input to a cellphone 3.5mm headset. I have found some like one at Amazon from Headset buddy, and I've been surprised by their cost -- often about $15 for what would seem to be pretty simple. Can you speculate on why that is? Simple supply and demand? Or is there something tricky about this sort of adapter? \$\endgroup\$ – Jerry Asher Apr 4 '11 at 2:48
  • 2
    \$\begingroup\$ @Jerry Cables are usually overpriced in general, best buy is one of the worst at it. The cable you describe is a rather uncommon cable though so it is likely a supply/demand issue. You might want to check to see if monoprice.com has anything like what you want. \$\endgroup\$ – Kellenjb Apr 4 '11 at 13:19
5
\$\begingroup\$

Phones tend to have 2.5mm TRRS (tip-ring-ring-sleeve) jacks. A normal stereo jack with just 3 connections is called a TRS jack; the fourth connection is of course used for the microphone.

There is a device that lets you use the headphone jack as a modem. It is just a frequency shift keying modem that you'd attach to a UART. The gadgets probably don't use any standard communication protocol; it's all done by recording and playing back audio with the sound device.

TV-out over a headphone jack has nothing to do with the sound card. It is just NTSC or PAL composite video.

\$\endgroup\$
  • 4
    \$\begingroup\$ Computer audio output headphone jacks are 3.5mm. Larger equipment (guitar amps, etc) use 0.25" jacks. \$\endgroup\$ – lyndon Apr 3 '11 at 23:31
2
\$\begingroup\$

Headphones outputs are just pure analog outputs. The fact that some other kinds of ports happen to use the same connector is just coincidental.

\$\endgroup\$
0
\$\begingroup\$

Reverse engineering my ~android phones with TRRS 3.5mm plug: Tip : left phones R1 : right phones R2: common ground ( separate wires to minimize cross talk? ) Sleeve: microphone and controls: High Z = electret microphone (~2.5VDC) 500 Ohms = volume up 220 Ohms = volume down ~zero Ohms = pause/play

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy