Detect a particular frequency?

Hey i am using MAX4466 and using the following code to detect the the max frequency. But I’m getting the maximum magnitude in the bin for the frequency when the source is perpendicular to the mic not in front of it. Can you help me out. Its realllly important

micSample.ino (1.17 KB)

using MAX4466 and using the following code to detect the the max frequency. But I'm getting the maximum magnitude in the bin for the frequency when the source is perpendicular to the mic not in front of it

So I assume that it is detecting the frequency correctly?

A microphone has a specific polar response so why would you expect any Microphone orientation to give no signal?

Well, I have to point my robo car towards the direction of the chosen frequency and then go towards it. But I'm getting maximum magnitude for the particular frequency when the orientation of mic is perpendicular to the source of sound. Hence my car goes in the wrong direction

So reposition the mic on the car so that it sees maximum in the direction you want it to go in.

It sounds like the polar pattern of the mic isn't what you think it is.

Steve

Or put the mike in the bottom of a styrene drinking cup to act as a direction microphone.

But I'm getting the maximum magnitude in the bin for the frequency when the source is perpendicular to the mic not in front of it.

When the microphone is pointed at the source, you are probably overloading the microphone amplifier, which leads to serious waveform distortion and totally incorrect frequency indications.

Post a clear circuit diagram (not a Fritzing mess) of your microphone input circuit.

I could try a styrene cup today.

jremington: When the microphone is pointed at the source, you are probably overloading the microphone amplifier, which leads to serious waveform distortion and totally incorrect frequency indications.

Post a clear circuit diagram (not a Fritzing mess) of your microphone input circuit.

I'm using MAX4466 with Adjustable Gain. You can see the circuit diagram here: https://cdn-shop.adafruit.com/datasheets/MAX4465-MAX4469.pdf

There are several circuit diagrams in that link, and none include an Arduino. If you want help, follow the instructions in the "How to use this forum" post.

Have you verified that the input signal to the Arduino is not distorted under any conditions?