Hi everyone, this is my first time using the Arduino Uno model and I have run into a bit of an issue. I am in the process of writing a code to identify and differentiate audio frequencies in order to complete a pre-determined task based on specific readings. The issue I am having with the Arduino is its inability to decipher the varying analog input from a microphone. This is likely because there is no sound card or other sound decoding device to convert the seemingly random electrical input from the microphone into usable sound frequency and amplitude data. I would like to know if anyone has found a solution to this problem and how to carry out that solution. I have researched the potential utility of a piezo however I am unsure whether the fact that it measures vibrations as well as audio frequencies will be problematic in deciphering between physical "knocks" and the audio stimulus I am attempting to capture. Any help would be greatly appreciated!
Are you trying to detect a single pure tone? A combination of tones (like a DTMF 'Touchtone" phone)? A tone within a noisy environment (like one particular car horn in a busy street)?
I suspect that as a minimum you will need to amplify the microphone to get a usable signal level. You can set the A/D converter to run at various rates and signal an interrupt when each sample is available.
Thanks for the quick reply! Essentially what my project is attempting to do is to detect the sound of a car pulling into the driveway (in a suburb with relatively low ambient noises) and to activate a switch that will be connected to a garage door. I have already purchased an amplifier to render my frequency values relevant, however I am unsure how to set the A/D converter to run at various rates and signal an interrupt when each sample is available... do you have any past experience with this or any knowledge of a link describing the process?
Essentially what my project is attempting to do is to detect the sound of a car pulling into the driveway (in a suburb with relatively low ambient noises) and to activate a switch that will be connected to a garage door.
I think using sound would be a very poor method for what you are trying to accomplish. Just too much chance of other possible other sound sources end up opening your garage door. Use some kind of infrared sensor, or just a simple light beam that the car can break to trigger the action. You just won't be able to get enough discrimination using sound to insure that only your car will trigger the door using sound.
Is there a specific car you wanted to detect or should any nearby car trigger the garage door?
If it’s any car then a metal detector loop or an optical tripwire or a mechanical strip switch would be a better solution. An electric car might not produce enough noise to detect at a reasonable distance.
If it’s a specific car then putting something on the car (IR beacon, Ultrasonic beacon, radio beacon) would be a much simpler solution than trying to discriminate the noise of one car from all other cars.
This is likely because there is no sound card or other sound decoding device to convert the seemingly random electrical input from the microphone into usable sound frequency and amplitude data.
Sound cards don't do that. They convert sound into the "seemingly random electrical input" you see on the arduino.
Reliably recognizing a sound is an almost impossible task to do even on a large computer. There a few projects that recognise a word or to but they are not very reliable, suffering from both false positive recognition and false negative recognition.