I recently bought a Grove sound sensor from the Arduino Official Store and connected it to Arduino Mega 2560. I wanted to measure the mid voltage I'm getting in silence and surprisingly found out that it is dropping as minutes go by.
It starts at 140 and then eventually goes down to 61, rises to 76 and start decreasing again ...
I've got the feeling that it actually detects sound through analog output (AO). The signal was rather poor but I thought this was because of the low sampling rate (9 kHz). Before addressing this issue I noticed that I'm already having a problem with the input.
I want to build a neural network on Arduino Mega that would recognize claps. I'm aware that there are easier ways but I'm doing this just for fun.
Thank you, but what I need to do is extract the sound from analog input, which can easily be done by (analogRead (0) - soundMid). The problem that I'm having is that soundMid should be a constant but it drops a lot in, say 10 minutes of operation.
Well, basically it can detect any loud noise but you can't distuinguish between a clap or say a jackhammer. You just need to set a threshold for the analog input. Maybe anything over 250 is a clap (or other loud noise).
Well, this is the point - distinguishing a clap from other loud noises (dog barks for example). Beside amplitude there are other sound features that can be used, like signal zero-crossings, distribution of sound energy through time, ... This is why I need to get correct audio samples first.
I did try different resistors but still couldn't get a good audio recording. I found another microphone in my drawer that seems to work though.
The output seems AC coupled (220n cap).
That means that the Arduino input is floating (for DC).
One way to fix this is to mid-bias your analogue input mid-voltage with two 1Megohm resistors. One from pin to ground and one from pin to 5volt.
Leo..