EmbDev.net

Forum: Analog Circuits Simple audio signal detector


Author: Flok3r (Guest)
Posted on:

Rate this post
0 useful
not useful
Hi,
my first post here, I hope it fits in this forum.

I just want a device, that detects, if there is a signal (playing audio) 
on the incoming audio source AND lets the signal pass to an output audio 
jack. So the signal must not be screwed up by the detector part.

I built this using:
-http://www.ti.com/product/lm324
this op amp as inverting amplifier (10meg as feedback, 10k between input 
and op amp).
The op amp is single supplied with 5v and "stretches" the signal to 
0-5v.

-atmega168/328 (prototyping on arduino)
to measure the amplified signal on the analog pin (simple algorithm 
detects audio).
Readout every 2 ms.

-4066 ic
to let the signal pass or not

So far, this works perfect, when using normal audio sources..
When connecting my Smartphone/Laptop/Pc directly from the devices audio 
jack the arduino shows fluctuating values (while playing music..), app. 
0-4v.
BUT the big issue is when using a usb sound card as audio source.
When connecting these the arduino measures 0v all the time. Only on the 
highest volume some "peaks" show up.
I tried different resistor values and other things, always 0v.

There has to some fundamental difference between "normal" audio devices 
and usb sound cards I don't get.. Why does this happen/what did I 
misunderstand?

requirements:
-5v single supply
-reliable detection, even on low volume/small signals

I am using these usb sound cards:
http://www.amazon.com/Channel-External-Sound-Audio...
http://www.amazon.de/gp/product/B0028RZ23I/ref=s9_...

Author: lutz.h (Guest)
Posted on:

Rate this post
0 useful
not useful
Can you try the microphone input of the sound card to use as a 
Oscilloscope
and measure differences between IPOD and sound card.

like Soundcard scope 1.41

Author: HildeK (Guest)
Posted on:

Rate this post
0 useful
not useful
Flok3r wrote:
> this op amp as inverting amplifier (10meg as feedback, 10k between input
> and op amp).

I am missing a capacitor at the input. There may be a DC offset in one 
of your sources.
To which voltage ist the non-inverting input connected?

And: you have a single supply circuit and an inverting amplifier. If you 
have a positive input then the output would like to go into negative 
regions: not possible. On the other side, an input signal below the GND 
pin is not allowed!
So, I wonder why you report of some success.

Author: Flok3r (Guest)
Posted on:

Rate this post
0 useful
not useful
I measured both on medium volume. Playing the same song on my iPhone and 
my Laptop (playing through the Creative Soundcard) gives pretty much the 
same gaph (set triggering to off..).
Amlpitude of the iPhone signal is about 200mV
The one of the usb Soundcard (on medium system volume) is 300 mV.

No big differences at all, that confuses me even more :(
but thanks for the hint, great software!

Author: Flok3r (Guest)
Posted on:

Rate this post
0 useful
not useful
Tried filtering the dc offset with 1-10 uF, same as before..

> And: you have a single supply circuit and an inverting amplifier. If you
> have a positive input then the output would like to go into negative
> regions: not possible. On the other side, an input signal below the GND
> pin is not allowed!
> So, I wonder why you report of some success.
I know this problem, but as I said, on standard players everything works 
fine.
I dont know how the op amp is doing that, but it can amplify half of the 
signal (dont remember if it is the negative or positive half wave). The 
amplified result is quiet distorted and only the half of the signal is 
reaches the output, but that would be enough for my needs, when it would 
work..

Ah, the signal-gnd is connected to +op-amp. signal-L and signal-R are 
connected through 10k to -op-amp. 10 meg from -op-amp to out-op-amp.

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.