Patching into Android music control

Here’s a look at the TRRS cable that Android phones use. [Rich Kappmeier] want to control the music player on his Nexus One while driving. It’s not necessarily a safe endeavor if you’re staring at the screen and poking away with one hand while trying to stay in your lane. A little bit of research helped him figure out how the hardware in a headphone controller worked and he decided to incorporate that into a connector cable for the car.

The control signals rely on a specific resistance between the TRRS function ring and ground. Once he worked out the chart above and targeted the correct resistance values he built a rocker switch for Fast Forward and Reverse, as well as a Play/Pause button into the connector cable. You should be able to use this for more than just music control. Take a look at our Android Development tutorial and see what else you can come up with.

[Thanks Alastair]

Comments

  1. Josh says:

    Awsome. I’ve been waiting for this!

  2. biozz says:

    hm … great!
    is function also mic?

  3. cde says:

    Not Android, Nexus One. This won’t work on all phones, most likely just htc phones with builtin audio out, if that. The Nexus One has alot of hidden goodies like this, and usb-host, etc.

    So title is wrong.

  4. onaclov2000 says:

    Crap, I hope this works for the G2, I have been looking for this kind of solution, now I just need to figure out the can bus on my car and I’m golden.

  5. The iPhone uses basically the same circuit in its headphones, albeit I haven’t checked what resistance values. I’m sure most assumed that, as well as that ring 4 is the mic port as well. But here’s a fun trick: if you insert a normal headset, the phone needs to know that there’s no mic present. It does so by sensing a short from 4 to ground on insertion. Which (on the iphone) is also accomplished by holding the play/pause/skip button. If you hold that button while you plug the headphones in, the mic and buttons are all disabled (ring 4 is disregarded). I have no idea if this works on the nexus one, but I can only assume that it does.

  6. Nomad says:

    @Alex: yeah i’d bet it works on the Nexus one. That thing also has got to check if theres a mic or not.

    PS: the last time i “played” around with audio jacks, i wasted 3×2.5mm stereo jacks…don’t want to know, what will happen if i try to build this control for my phone.

    PPS: doesn’t the Nexus One support at least double-tapping the play/pause-button as a “next-song”-command? At least it works on my HTC Wildfire. The iPhone also supports this, but it is also capable of triple-tapping for previous song.

  7. M4CGYV3R says:

    I have a Moto Droid and had no idea these things even worked on it.

  8. I check out his article on it. He says that it was originally a fix for stuttery music – now I know what’s wrong with my phone! :)

  9. Toby says:
  10. edude03 says:

    @Alex Whittemore
    I’ve been trying to use my apple in ear headphones (w/ remote) since purchasing the Xperia X10 a few months ago. I tried this trick and it works if I continuously hold the play pause button, letting go of it makes the audio sound like its under water.

    That said if anyone else has a similar issue, using a right angled 3.5mm adaptor or 3.5mm splitter should resolve it as it grounds the 3&4 pin together. Obviously the buttons won’t work but at least you can salvage the headphones.

  11. Whatnot says:

    So are you telling me google keeps this stuff a secret? Would not a simple note to google give you the data? Did anybody even try?

  12. Dr bob bob says:

    Where do people get the 4 conductor 3.5mm jacks? I have a HAM radio that has a 4 conductor for headphones / mic / ptt and I would like to hack something together. The headphone port is also used for programming so I would like to build a programmer.

  13. Whatnot says:

    I got my 4 connections jackplug at a normal electronics parts store, there are quite a few devices that use them and have used them in the past so they must not be that hard to find, although I also know stores that do not have them, but then you might be able to get a cheap item that uses them and just cut it off for your own use.
    Many cheap radio handsets also come with 4 pin ports for instance, so they might have hands-free headplugs for those available.

  14. cde says:

    @DrBob, best source would be a dollar store for a video+audio 3rca to 4 conductor cable that you can hack up (Some even have retractable ones).

  15. futaris says:

    This is the same for the HTC HD2.

  16. Santiago says:

    I have and aplication can do this, the name is “DroidShuffle”, this aplication run as service at start and can configure everything, check it out.

  17. atrain says:

    Just built this, and I’m loving it! Thanks!

    I used a 510ohm resistor in place of the 600, and it works fine on my HTC MT3G slide.

  18. Tomaaaaaaaa says:

    Would it be possible to wire the microphone into this circuit. Thus making a car handsfree kit and music controller?

  19. RL says:

    Hi,

    You’re giving me something else to try out to solve my problem on connection my N1 to my helmet.

    http://www.nexusoneforum.net/forum/nexus-one-accessories/11669-help-helmet-handsfree-wiring.html

    But just in case, do you happen to a have a diagram for connecting two TRRS plug? :D

    Thanks!

  20. T.v Serials says:

    Here’s a look at the TRRS cable that Android phones use. [Rich Kappmeier] want to control the music player on his Nexus One while driving. It’s not necessarily a safe endeavor if you’re staring at the screen and poking away with one hand while trying to stay in your lane. A little bit of research

  21. serialsking says:

    I used a 510ohm resistor in place of the 600, and it works fine on my HTC MT3G slide.

  22. Just built this, and I’m loving it! Thanks!

    I used a 510ohm resistor in place of the 600, and it works fine on my HTC MT3G slide.

  23. iljo says:

    Hi, I know this is quite old, but I built this, instead of 600 ohm i used 620. But the functions are a bit different, instead of next/previous song, it makes volume go up/down.

    Now I have to test what resistors to use for next/previous song. Also, thanks for this.

    • Masowai says:

      I just built one as well. It doesn’t skip ahead/back. Instead, it changes the volume on my GS3. Maybe it’s because I haven’t added any speakers yet. I just made it super quick on a breadboard.

  24. Yochay says:

    Hi,

    I have Samsung Galaxy s2. In this phone one click is play/pause, 2 clicks are for next, 3 clicks are for prev. So only one switch is needed.
    I made this nice hack, without the resistors and switch 2. The problem is that every click produce a terrible “ccrrkkk” noise in the speakers (I think it also damages them).
    Can you assist? what is wrong?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,354 other followers