Simplest way for auto-switch off from line in.

Hi there

I'm currently trying to determine the simplest way to interface an audio line-in so that I can detect if audio is being played or not. I am just looking for a 'playing or not playing' indication.

From my experiments so far (connecting directly to MCU with 3.3V as the reference) I have found that I need significant volume (> 30% on the windows slider, which is extremely loud on my amp) on the line-in to get any readings at all (an it mostly looks like noise). At low volumes, the readings are 0. I am assuming that this is because there is no DC component in the signal. I was hoping that the sampling could be quick enough so that I can catch the 'positive' peaks without resorting to some rectification using an ideal diode or similar. I guess with the ADC being charge based, when the negative parts of the signal occur, it depletes the charge in the ADC for that sample.

Has anybody got any suggestions on the simplest way to do this (ideally no active parts) without affecting the incoming signal? Is it simply a choice of adding a DC component with a potentiometer? are there any alternatives to this?

Thank you in advance.

Liam

Connect ground to ground, and audio to resistor to analog input. You can get away w/o DC offset, simply ignoring negative semiwave, limiting input current by resistor to less than 1 mA , 5 kohm or better 10 kohm should be o'k. Arduino sensitive enough up to 5 mV, you can even increase this to 1 mV setting INTERNAL reference. There is would be noise , of course, but you can set threshould level 10-20 mV and filter reading by "running average" or similar technics.