Go Down

Topic: Audio loss Alarm - Silence Detector (Read 244 times) previous topic - next topic

ne02005



Hi, I´m making "Silence Detector" for a TV Station  Channel, the A0 input is used for inject audio from a TV (RCA audio OUT connector).


I need to read the A0 input with the condition if no sound (A0= low levels) for "X"  period of time the input  turns on a led.

any ideas?
thanks
 

Grumpy_Mike

Use a envelope follower between the audio output and the analogue input. Then a simple read and comparison to a fixed threshold will do.

DVDdoug

#2
Jan 22, 2020, 04:32 pm Last Edit: Jan 22, 2020, 04:33 pm by DVDdoug
Quote
I need to read the A0 input
You shouldn't directly  connect the audio signal to the Arduino because the Arduino can be damaged by the negative-half of the AC audio waveform and/or the signal can be "damaged" (distorted).

An envelope follower (AKA peak detector) will take care of that because it "ignores" negative voltages.   (When I make an active peak detector I power the op-amp with positive & negative voltages greater than 5V so I can get the full 0-5V Arduino range and that makes the power supply a little more complicated.  Then I add a protection circuit to protect the Arduino from voltages outside that range.)

Or, you can bias the input (and then optionally subtract-out the bias in software).     

To get started take a look at my World's Simplest Lighting Effect.   It uses the bias circuit and flashes the LED on when the signal is above average and off when below average.   You can take-out the averaging stuff and replace it with a fixed threshold* and then add some "timing".   

Note that you can't use delay() because you need to reset your timer during the wait/delay time so you'll have to use a millis() timer. 




* Actually, there is already a "noise threshold" in my example but you'd have to do something with the timing because the LED "flickers".   

Go Up