Android Headphone Jack

The magic smoke.

Moderators: phlip, Moderators General, Prelates

Posts: 164
Joined: Thu Dec 17, 2009 5:44 am UTC

Android Headphone Jack

Postby Korrente » Thu Apr 07, 2011 5:36 am UTC

Thought I'd ask this here before I went and registered on a development forum.

I have an HTC Aria and thanks to my AT&T overlords I am now able to sideload apps. I was thinking about cobbling together my own app that would utilize the headphone jack to control my camera's external shutter capabilities. However, I have encountered a problem...

Here's how the headphones are set up. There are three metal rings on a 3.5mm standard male non-mic headphone jack:

wire || 3 | 2 | 1 >

Ring 3 is hot, Ring 2 triggers the auto-focus, and Ring 1 engages the shutter (and auto-focus, if turned on). When I plug my cable into my phone, Android senses that there is a cable plugged in and the camera shutter engages instantly. I can not tell if this is because Android is keeping current flowing through from 3 to 1, or if it is the phone's hardware causing a constant connection. It would seem counter-intuitive if it were the phone because I would think that would cause a short and no sound would come from real headphones...but I can't find anything that says if Android is the culprit either.

I haven't started playing with the SDK yet, maybe there is a way to disable the software trigger if that's what's happening. Hopefully I'm just overlooking something...Does anyone have experience with this?

User avatar
Restorer of Worlds
Posts: 7572
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia

Re: Android Headphone Jack

Postby phlip » Thu Apr 07, 2011 6:46 am UTC

It sounds like the two things you're trying to connect together are very different circuits. In the camera, the pins are floating with respect to each other, and you short them to make stuff happen. In the headphone port, they're not floating - they're held at a specific voltage apart, which is what drives the speaker. When there's no sound playing (or also at regular intervals when there is sound playing) the phone is going to be driving it at 0V, which is effectively a short.

I doubt you're going to be able to get this to work with just a simple cable connecting the two... maybe with some simple electronics between them, but if you're doing that you'd probably be able to use a more flexible output port than the headphones...

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}

User avatar
Posts: 72
Joined: Fri Aug 08, 2008 4:17 pm UTC
Location: france

Re: Android Headphone Jack

Postby diabolo » Thu Apr 07, 2011 7:32 am UTC

I wondered about the same problem not so long ago (but gave up on it due to my lack of basic electronics skills/knowledge).
I guess it's possible to come up with a simple circuit, with a few transistors or something, that would open/close a switch (maybe 2 with the stereo) depending on a sound signal.
You would plug an mp3 player with prerecorded sound files (or a phone with an app generating signals) on one end, and your camera on the switch(es) at the other end.

Something you can, however, plug directly into your headphones jack are IR LEDs.
(Assuming your camera is compatible with IR remotes and you know what signal it expects to receive)

Posts: 164
Joined: Thu Dec 17, 2009 5:44 am UTC

Re: Android Headphone Jack

Postby Korrente » Thu Apr 07, 2011 9:41 pm UTC

I had assumed that it was the hardware at fault since there are no apps that do this already on the market. I think I'll just solder together a toggle switch and be done with it. Thanks for the replies.

Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 3 guests