Go Down

Topic: Read a freqency from an analog pin (Read 8998 times)previous topic - next topic

majenko

#45
Nov 15, 2012, 02:30 pm

Values are fictive. I want to separe 2 frequences. (frequences from microphone)

If you can't be bothered to answer our simple questions, then I can't be bothered to help you.

I have asked for simple, straight forward, information, which you have repeatedly failed to give us.

Unless you do so there is NOTHING we can do for you!

florin

#46
Nov 15, 2012, 02:38 pm
OK. So, i have a microphone connected to analog 0. When i speak, the microphone get a frequence.If this frequence is bigger than a "constant value", a led is on. If frequence is less than a " constant value" , another led is on. That is all.

"constant value"= a frequence, wich i write in the code.

PaulS

#47
Nov 15, 2012, 02:41 pm
Frequency and volume are two completely different things. Is frequency really what you want?

HOW IS THE DAMNED MICROPHONE CONNECTED?

AWOL

#48
Nov 15, 2012, 02:42 pm
Quote
So, i have a microphone connected to analog 0.

I asked quite a long time ago what amplification do you have between the microphone and the analog pin.
If the answer is "none", then we are all really just wasting our time, and I will lock the thread.

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

florin

#49
Nov 15, 2012, 02:47 pm
I have transistor for amp.

dhenry

#50
Nov 15, 2012, 02:48 pm
Rather than attempting a project that is way beyond your skill levels, try to break the project into doable pieces and do them one at a time, starting with the simpler ones (like turn on / off an led).

In your case, those would be something for you to think of:

1) write code to turn on / off an led;
2) write code to turn on / off an led depending on a value comparison
3) write code to measure frequency;
4) design hardware to process the microphone signal so it can be measured by your arduino.
5) put them all together.

You have to start somewhere and it is best that you start where you can draw upon your skills.

florin

#51
Nov 15, 2012, 02:50 pm
I know how to turn on/ off a led. I don't know how to use frequency reading.

PaulS

#52
Nov 15, 2012, 02:59 pm
Quote
I know how to turn on/ off a led.

Then you should know how to use Serial.print() to print some data. You should know how to write code properly. You should know how to post that code. You should know how to post the output from your application. You should have at least the vaguest clue about debugging.

majenko

#53
Nov 15, 2012, 03:05 pm
Trying to infer what you want from your unintelligible ramblings, I think what you want is:

1. Attach a microphone to the Arduino.
You will require an amplifier to boost the signal to a level the Arduino can sense.  You should look in to op-amp microphone pre-amplifiers.  There are plenty of resources on the web for them.

2. Find the frequency of the signal.
There will be many many frequencies present in the signal, not just one.  You will need to sample a clip of audio from the microphone and do a Fast Fourier Transform on it.  This will give you a list of frequencies present in the signal and their amplitudes.

3. Light an LED depending on the frequency.
You can use the list of frequencies provided by the FFT to find the frequency that has the greatest amplitude.  This is the peak frequency, and can be used to make decisions, like is it above or below a threshold?  Is there no clear peak frequency?  Etc.

So, you have some reading to go and do:

1. Read up on attaching a microphone to an Arduino using a pre-amp circuit.
2. Read up on Fast Fourier Transforms, and find some Arduino code to do it (hint, look for fix_fft).

AWOL

#54
Nov 15, 2012, 03:15 pmLast Edit: Nov 15, 2012, 03:21 pm by AWOL Reason: 1
and
3) Have a clear sense of scale. Measuring a 1Hz signal with a microphone is unrealistic, as is measuring a 1MHz signal.

Quote
I have transistor for amp.

I will employ my psychic powers to endeavour to draw your schematic.
Or, you could save me the considerable mental effort and post it.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

be80be

#55
Nov 15, 2012, 03:26 pm
Here a nice link to give a understanding of sound and they have a nice link to a real good preamp
http://courses.oliviarobinson.com/wt/node/79

Never could figure wHy we need a crystal ball now I NO

PaulS

#56
Nov 15, 2012, 03:38 pm
Quote
Never could figure wHy we need a crystal ball now I NO

Did you get one when you joined the forum? I'm still waiting on mind. The psychic keeps saying "any day now".

florin

#57
Nov 15, 2012, 03:49 pm
Now it works!
Thank you for answers! You are the best!

majenko

#58
Nov 15, 2012, 03:55 pm
...

If he's learned all that so fast, he's either a genius (which somehow I doubt), or what he is trying to do is completely different to what he is saying he is trying to do.

be80be

#59
Nov 15, 2012, 03:58 pm
Na some one here used a magic wand with there crystal ball

Go Up