Pages: [1]   Go Down
Author Topic: Using a microphone with Arduino  (Read 1673 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I want to make a clap-switch for turning on an LED, so I was reading some forums and they all were talking about a sound sensor to input the sound to the Arduino, can't I just use a regular microphone like the one in headphones, don't know if that's a condenser though, but even a condenser, wouldn't it work?
Another question, how would the Arduino tell the difference  between a 2 shouts and 2 claps, they are both loud and short?
Logged

Offline Offline
Edison Member
*
Karma: 32
Posts: 1282
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The signal from a microphone is typically too weak (usually a few millivolts).   You can get more signal (maybe one volt) with loud sounds, such as with a microphone in front of a kick-drum or in front of a guitar amplifier.

You can make a microphone preamplifier yourself or use something like this.  (Condenser mics also require a power supply.    The mic input on a computer puts-out 5V to power an electret condenser.)

Another consideration is the AC signal.  The Arduino can't handle signals that go negative.    I believe the SparkFun board puts a 2.5V bias on the signal, so that it can be used directly, and it also provides the power to the condenser mic.

Quote
Another question, how would the Arduino tell the difference  between a 2 shouts and 2 claps, they are both loud and short?
I'd try to do it with timing 1st.  It's hard to shout for a time period as short as a clap.    Look for a sound that doesn't last long (probably less than 1/10th of a second) followed by another sound that doesn't last long.    If that doesn't work, there are FFT software libraries that analyze the sound spectrum.  (I've never used FFT myself.)

A simple R-C high pass filter might help too (to knock-down low-pitch sounds).   But, a high pass filter would kill the 2.5V bias if you use the SparkFun board, and that surfact-mount board might be difficult to modify.

Logged

Pages: [1]   Go Up
Jump to: