68
\$\begingroup\$

I want to connect the output from the audio jack of an iPhone to an Arduino.

What voltage range can I expect to see on the audio lines from the iPhone? I assume that turning the volume up on the phone will produce a large AC voltage, but how large does it go up to?

I want to make sure that it wont exceed the voltage level that an Arduino can read on its input pins. Will I need to provide any circuitry between the iPhone and the Arduino?

\$\endgroup\$
8
  • 1
    \$\begingroup\$ This question makes no sense without explaining what you want the arduino to do with the audio signal. In any case, you probably need to AC couple the audio signal and add 1/2 supply voltage on the arduino side. \$\endgroup\$ Commented Mar 21, 2012 at 13:20
  • \$\begingroup\$ I measured an iPod 3 at about a volt peak to peak. \$\endgroup\$
    – user207421
    Commented Sep 27, 2015 at 22:17
  • \$\begingroup\$ It supplies 5V. at a low amp rate. \$\endgroup\$
    – Alex
    Commented Mar 22, 2016 at 20:40
  • 1
    \$\begingroup\$ @Alex what does that mean? \$\endgroup\$ Commented Mar 22, 2016 at 20:41
  • 5
    \$\begingroup\$ What's a MP3 Jack? Line out (commercial spec, not broadcast spec) drives 1 milliwatt to 600 ohms load (0.77 volts RMS; 2.2 volts peak-to-peak ) \$\endgroup\$
    – PkP
    Commented Mar 22, 2016 at 20:42

6 Answers 6

38
\$\begingroup\$

Commercial line out specification is to be able to drive 1 milliwatt to a 600 ohm load. For a sine wave, this means a voltage of 0.77 volts RMS (2.2 volts peak-to-peak) and a current of 1.3 milliamperes RMS (3.6 milliamperes peak-to-peak).

\$\endgroup\$
4
  • 12
    \$\begingroup\$ Line out levels are very different from headphone levels; headphone impedances range from 600Ω to as low as 8Ω. \$\endgroup\$
    – uint128_t
    Commented Mar 22, 2016 at 20:59
  • \$\begingroup\$ @uint, correct. And that's why there isn't a standard for a headphone out - if you don't take the European Norm EN60065 as such. That norm is for hearing protection and from memory I recall that it limits headphone output to something like 150 millivolts if the properties of the connected headphones are not known. \$\endgroup\$
    – PkP
    Commented Mar 22, 2016 at 21:09
  • \$\begingroup\$ Good answer, but can you cite any source for this? \$\endgroup\$
    – Elliott B
    Commented Mar 4, 2017 at 6:52
  • 1
    \$\begingroup\$ @ElliottB You might want to read en.wikipedia.org/wiki/Alignment_level but the most important thing is: what are you aiming to do? Because the ancient 0dBU (0.77VRMS) line out spec really is ancient and nowadays every manufacturer (outside the field of broadcasting anyway) does it at any of a multitude of semirandom ways, depending on what the analog power voltage level happens to be in that particular product. What do you want/need/like to be compatible with? \$\endgroup\$
    – PkP
    Commented Mar 6, 2017 at 7:36
24
\$\begingroup\$

Unfortunately there is a lot of "audiophile" nonsense around headphone amplifiers and headphone impedance. Probably the top 5 results for "headphone impedance" on Google are just wrong. This site contains some useful information (though a lot of it is wrong too).

But anyway if you look at the graphs which I assume are correct, you can see that in the audio frequency range most headphones have a fairly small reactance compared to their resistance. And most headphones have an impedance around 16-32 Ohms with some crazy "audiophile" headphones having higher impedance (e.g. 300 Ohms). He suggests that 5 mW is sufficiently loud for portable headphones. Audiophile headphones will require higher power.

Power is \$P=V^2 / R\$ so \$V = \sqrt{R*P}\$, so high impedance headphones will need a much higher output voltage because they require more power and have a higher impedance. Anyway, for the Sony MDR-EX51 headphones shown on the page linked above you can see that they are fairly close to a simple 17 Ohm resistor. At 5 mW that would mean a voltage of 0.3 V and a current of 16 mA.

An Arduino can supply this fairly easily but I don't think you can just hook it up to PWM since 5V across 17 Ohms gives 300 mA which is well above Arduino's 25 mA limit. A simple solution may be to insert a 4.7 V / 16 mA = 290 Ohm resistor in series with the pin.

I haven't tried any of this - you'll have to experiment!

\$\endgroup\$
4
  • 11
    \$\begingroup\$ The OP wanted to go from phone to Arduino. Your answer is the other way around. Anyway, that was four years ago. He's probably married now and has ... \$\endgroup\$
    – Transistor
    Commented Feb 20, 2016 at 16:29
  • 10
    \$\begingroup\$ Ah yes I misread. But the information is the same. And who cares if it is 4 years old? There are no good answers and it is highly ranked in Google. \$\endgroup\$
    – Timmmm
    Commented Feb 20, 2016 at 18:16
  • 2
    \$\begingroup\$ Indeed, this is useful answer. I measured similar ~0.2Vp-p from my phone's headphone output with oscilloscope and this answer gave me confirmation that it is a typical value. \$\endgroup\$
    – jpa
    Commented May 4, 2018 at 14:08
  • 2
    \$\begingroup\$ +1, good answer. My biggest pet peeve is finding the exact answer I need on Google to read some guy in a forum saying "Why do you need this? This does not belong in the foo forum, it's more of a bar issue. Also, <I'm projecting my confusion onto strangers>." \$\endgroup\$ Commented Jul 11, 2022 at 18:22
14
\$\begingroup\$

Check out: http://en.wikipedia.org/wiki/Line_level

The most common nominal level for consumer audio equipment is −10 dBV, ... Expressed in absolute terms, a signal at −10 dBV is equivalent to a sine wave signal with a peak amplitude of approximately 0.447 volts, or any general signal at 0.316 volts root mean square (VRMS). ... There is no absolute maximum, and it depends on the circuit design.

This is however for the "Line out" plug which, apparently, carries a signal at a fixed amplitude and lets the receiving end determine the volume.

In most cases changing the volume setting on the source equipment does not vary the strength of the line out signal.

For a speaker-driving headphone plug I believe things might get more complicated, since that signal is really rather a current signal (used to drive the coil of a speaker).

In contrast to line level, there are ... those used to drive headphones and loudspeakers. The strength of the various signals does not necessarily correlate with the output voltage of a device; it also depends on the source's output impedance which determines the amount of current available to drive different loads.

I guess your best bet might be to look at the wave with an oscilloscope, which should have a high-impedance input like the Arduino's analog input (ADC).

(I'm no expert, take with a grain of salt and feel free to edit)

Edit: The Wikipedia article I used as a source has been edited a lot since I originally posted this answer. Among other changes, the qouted pieces above have been removed/changed. Therefore I'm striking most of this answer out and recommend referring to the Wikipedia article linked at the top.

\$\endgroup\$
4
  • 3
    \$\begingroup\$ Awesome answer! I didn't know it was called line level, nor the difference between a preamp and an amp :) \$\endgroup\$
    – clabacchio
    Commented Mar 22, 2012 at 10:18
  • \$\begingroup\$ @clabacchio: Nor did I know line level "carries a signal at a fixed amplitude". Hmm... \$\endgroup\$ Commented Sep 27, 2015 at 4:32
  • 2
    \$\begingroup\$ Could you clean up your answer @GummiV? It's primarily a wall of strikethrough text \$\endgroup\$ Commented Aug 6, 2017 at 17:00
  • 2
    \$\begingroup\$ You could always link to the specific edit of the wiki page. \$\endgroup\$
    – Passerby
    Commented Aug 14, 2020 at 18:46
11
\$\begingroup\$

This is in addition to PkP's answer.

While "line level" audio is typically 1 mW into 600 Ω, and this comes out to 1.1 V p for a sine, audio is far from a sine. Even if the spec is adhered to and you only get 775 mV RMS on average, the peaks can be considerably higher than 1.1 V. It is generally good to accept and handle without distortion peaks up to ± 5 V at least.

\$\endgroup\$
2
  • \$\begingroup\$ Olin is correct. And for broadcast equipment you must accept even considerably higher levels. \$\endgroup\$
    – PkP
    Commented Mar 22, 2016 at 21:11
  • \$\begingroup\$ @PkP: Yes. commercial gear typically uses +/- 15 V power supplies for line-level interfaces. \$\endgroup\$
    – Dave Tweed
    Commented Mar 22, 2016 at 22:37
8
\$\begingroup\$

There is no hard-and-fast rule for headphone jacks; be it a laptop, MP3 player or a regular stereo system.

I would say that a typical headphone output adheres to Line Level specifications, although for headphones they become more of a guideline than a stringent set of figures.

As you have already discovered, different devices have different output levels.

The power that can be provided by your PC is, for example, X milliwatts. As the PC power supply can give up 12V to the soundcard, the XmW could well be generated with an emphasis on the voltage rather than the current. Some top end motherboards (the latest Asus ROG boards, for example) boast a headphone-jack output of over 2V rms.

A portable MP3 player may only have a 3.7V lithium battery. Its output power could be the same XmW as the PC, but at a lower voltage therefore higher current - without some boost convertors it would be impossible to match the voltage of the aforementioned high-end motherboard.

A fundamental difference between a 'headphone output' and a 'line out' is that the latter isn't designed to power a low impedance load. I tend to assume that the input impedance of a generic audio device to be 50kOhms; if it's ever critical to know then it's typically stated by the device manufacturer. Headphones or earphones can be as low as 32 Ohms, meaning that plugging headphones into a Line Out socket could result in both poor volume and poor quality. There is not generally the same problem with connecting a line-level device to a headphone output unless you consider a dedicated headphone amplifier; an audiophile might argue that the output would become unbalanced.

Thus there is no correct answer. Perhaps start with 1.4V RMS as a maximum and then increase or decrease as you work through your prototype.

\$\endgroup\$
1
  • \$\begingroup\$ Also, the output voltage of a heaphone jack will depend on the volume setting, and on the nature of the sound at the time you measure it. \$\endgroup\$ Commented Mar 22, 2016 at 22:39
4
\$\begingroup\$

The arduino would need a higher voltage.

Use an non inverting OP amp on the line which should bring the voltage to about 2ish Volts, something which is better for the arduino.

:)

http://www.instructables.com/id/Arduino-Audio-Input/step3/Non-Inverting-Amplifier/

\$\endgroup\$
1
  • \$\begingroup\$ The Arduino probably needs a DC offset added, but that is easily accomplished via passive means. Depending on what the functional goal is, there's likely to be enough voltage swing to measure substantial differences with the Arduino's ADC, or even digitally threshold for an NRZ protocol. However, yes, for highest analog fidelity a pre-amp could well be needed to utilize the entire ADC range, and is probably cheaper or at least easier to source than an audio transformer these days. \$\endgroup\$ Commented Feb 11, 2014 at 20:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.