Pages: [1]   Go Down
Author Topic: Arduino sound frequency detection? Help!  (Read 1601 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8966
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Lefty
 
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8966
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34541
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Pages: [1]   Go Up
Jump to: