Go Down

Topic: iPod audio to analog input (Read 763 times) previous topic - next topic

ebfoxbat

Hi folks,

My first project, which I think should be simple: when an iPod touch alarm sounds, light an LED an keep it lit until a reset button is pushed. This will be in a noisey environment so the iPod will need to be wired.

I've read the headphone outputs are ~1v but the Arduino can't sample fast enough for analys but that's not what I'm after. I simply need to know if the iPod is playing sound of any kind or not.

Will the analog inputs be sensitive enough for this? Would the digital as inputs?

Thanks!

pylon

I'd use a simple transistor to amp the signal to the 5V of an Arduino and you're fine to put it on an analog input.

You can use a schmitt trigger to convert it into a digital signal but you have to kinda debounce it (don't react too fast to a falling edge) because an audio signal is always some kind of wave. A diode to protect from bigger negative values also might be a good selection.

With your Arduino you get a sampling rate of about 15kHz, which is good to detect sound.

SirNickity

I would use a comparator circuit.

iPod audio through AC-coupling cap, then either biased to 2.5v through a voltage divider and/or through a diode to rectify to positive half only, then to an opamp with no feedback loop.  The other input to the opamp is your reference voltage (another voltage divider, preferably with a pot so you can adjust sensitivity).

When the level is above the voltage reference, the opamp goes high.  When below, the opamp goes low.

Take the output of the opamp, through a diode (for a one-way valve), then add a cap between the output and gnd, with a resistor in parallel, so you can slow down the response.  This will filter peaks, and average the level so it's easier to detect with slower analog reads.  Vary the size of the cap to adjust the averaging speed and peak filtering.  Vary the size of the resistor (bleeds the cap) to adjust decay.  1uF and 10k would be reasonable starting points.

The output can then go to the analog input on the Arduino.

I use this as a level-detector for an auto power-off timer circuit.  It works great.  (In my case, I control a 555 timer and decade counter, then a relay... but it's all still TTL.)

Go Up