Take the 2-minute tour ×

I am looking at a project where we send information from a peripheral device to an iPhone through the microphone input.

In a nutshell, the iPhone would act as a voltmeter. (In reality, the controller we developed will send data encoded as voltages to the iPhone for further processing).

As there are several voltmeter apps on the AppStore that receive their input through the microphone port, this seems to be technically possible.

However, scanning the AudioQueue and AudioFile APIs, there doesn't seem to be a method for directly accessing the voltage.

Does anyone know of APIs, sample code or literature that would allow me to access the voltage information?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The A/D converter on the line-in is a voltmeter, for all practical purposes. The sample values map to the voltage applied at the time the sample was taken. You'll need to do your own testing to figure out what voltages correspond to the various sample values.

share|improve this answer
Just to add to this - the acceptable voltage to send to the audio port is 1volt peak to peak - if you go over this you stand to blow something. Basically all you'd be doing is reading the voltage as if it were a dynamic microphone's audio input. –  amergin Aug 5 '11 at 19:04

As far as I know, it won't be possible to get the voltages directly; you'll have to figure out how to convert them to equivalent 'sounds' such that the iOS APIs will pick them up as sounds, which you can interpret as voltages in your app.

If I were attempting this sort of app, I would hook up some test voltages to the input (very small ones!), capture the sound and then see what it looks like. A bit of reverse engineering should get you to the point where you can interpret the inputs correctly.

share|improve this answer

Your Answer


