Turn on/off led via headphone jack in iPhone

I have an iPhone project , I need to turn on and off a led powered with a battery using iPhone via 3.5 mm jack.

there is some examples what I need

http://www.ipinlaser.com

• Are you developing the app yourself? It looks like the guy in the video pretty much bought something that is no more than an LED soldered to a TRS plug. – Nick Williams Sep 10 '15 at 12:46
• Yes i will develop the software. Actually these samples creates a sine sound wave and activating the led. I made a research, some of them used some resistors and transistors in the circuit. I just need a circuit diagram to complete this project – Memik Sep 10 '15 at 12:51
• And you are using a battery external to the iPhone that is intended to power this LED? I'm just trying to get a feel of what your exact expectations are. – Nick Williams Sep 10 '15 at 13:03
• Yes led is powered by an external power source, i will use iPhone like a switch that to turn off and on the led – Memik Sep 10 '15 at 13:48
• This topic has been covered here before although the answer there was also tentative (but looks more promising than the one below.) – Fizz Sep 11 '15 at 3:58

I'm not that great with Android App development so I'm assuming you can make the headphone jack output a voltage in reference to the "common" ring. This guy got his android to output a waveform that was dependent on the accelerometer device readings.

Most smartphones have TRRS jacks on them, where the breakdown looks like this:

So if you can control the voltage difference between "Left" or "Right" and "Common", then you could exploit that.

Have the voltage difference feed into a transistor, while your external battery drives your LED. This is a much better method because you don't really want your phone to drive your LED, you just want it to say "OK, turn on, now turn off" etc.

simulate this circuit – Schematic created using CircuitLab

So it's just a really simple circuit, where the phone activates/deactivates the transistor. When the voltage of "LEFT or RIGHT" goes HIGH, current will travel from the battery, through the transistor and through the LED. Setting the voltage to ground will stop any current from flowing.

• You cannot send a DC voltage out the earphone jack. Doesn't work. You would have to send out and audio signal. Best case, your LED blinks real fast - if you put out a high frequency (>100Hz) tone then you wouldn't see the blinks. You'd have to use full volume, though, and put the transistor below the LED instead of above it. The way you've done it, the signal from the phone has to be higher than V1. – JRE Sep 10 '15 at 16:08
• Yeah, I was kind of thinking he could output some sine waveform and get a sort of PWM effect; however I tried to ignore that thinking because I wanted to abstract the android end from what the circuit end could be. – Nick Williams Sep 10 '15 at 16:12
• @JRE: Maybe the one on the iPhone can! (joke). More seriously, you need to rectify the AC sound signal before feeding it to the transistor's base. Since efficiency isn't really a concern, a half-wave rectifier should do it. – Fizz Sep 11 '15 at 0:45
• Come to think of it a bit more, you probalby need to amplify the audio signal a bit first (with another transistor), because there probably won't be enough voltage left after rectification otherwise, even with a Schottky. Measuring my non-iPhone Android phone, it maxes out at 0.68V peak on audio... Alternatively, build a charge pump and charge the capacitor one more than one cycle. – Fizz Sep 11 '15 at 1:22
• – Fizz Sep 11 '15 at 4:18