Hi
plz some one tell me how can i measure frequency of sound using Arduino sound sensor. I don't know how to code this thing actually
But are you going to learn as you work on this project?
No , it is having 4 pins
yes i want to learn that's why not copying it from any where
Does that have an amplifier and an analog output pin?
it is having analog input pin
Begin by looking at all the other forum threads doing what you want to do. Search the forum for "sound frequency" and you will have a good chance at learning what you need. Do you see the box in the upper right corner of this page saying "Search Forum""?
That module has no amplifier, so you usually need to scream into it to get a good output signal on AO.
plz tell me how can i code to get the approx frequency
Do what @Paul_KD7HB suggested but I think you will be disappointed with that module.
Ok, but you bought the sensor from somewhere, right?
First of all always post a link to the exact item you bought, because there are dozens around with different ICs, shapes, and usage. don't just show us just pictures (unless you made them, sharp, and if possible of both sides), you better show us a direct link.
Second, the seller should also be able to give you some example code, or at least send you a couple of links where you can find more information and usage details. This should always be the very first way to explore.
i have brought this module offline market but didnt give me some sample code
See post #12
Then you do not understand learning. It is always copying and then making changes and testing. ALL of what we know about anything is a result of us copying and extending what we copied into something new.
The specs for that board aren't really clear... I don't know if the analog output puts-out an audio signal (probably, which is what you want), or some of them put-out a DC voltage corresponding to loudness.
The pot probably only adjusts the sensitivity of the digital output.
To test the sensor and to get off the ground, connect power and ground, and connect the analog output to an analog input on your Arduino.
Then run the Analog Read Serial Example, but with the sound sensor instead of a pot, and take-out the delay.
If it's putting out audio, the output should be biased at half the supply voltage and a regular Arduino (Uno, etc., with a 10-bit ADC) should read about 512 with silence.
(If it reads about zero with silence it's the wrong kind of sensor.)
With louder sounds you should get readings above and below the bias reading as you "sample" the wave every time through the loop.
The readings will "look random" because you are reading/sampling a wave but you should be able to tell the difference between "silence", quiet sounds, and loud sounds.
You'll never read "pure silence" because there is always room noise and electrical noise. The signal has to be louder than the noise before you get anything useful.
If you are getting good readings you can get the FFT Library. FFT (Fast Fourier Transform) gives you the intensity of each frequency range, which are called "bins" in FFT terminology.
The library does most of the work for you but there are settings, options, and trade-offs and it will require some study to make use of it.
For testing, I recommend that you play some known-frequency test tones (which you generate with Audacity). As you may know, real world sound contains multiple frequencies (even if an instrument is playing one note) and most sound changes moment-to-moment., so test tones are the best way to test & troubleshoot.