Code works amazingly! I just ran it and saw it was using 60% of the global variable space. If you move " double vReal[SAMPLES]; double vImag[SAMPLES]; unsigned long microSeconds;" into the for loop, that percentage drops to 10%. I had to do this to compact things for my Junior Design project, it still works great! thanks once again
Hi Fatin, If you gave your correct email address when you registered on my website, I sent you an email to tell you I corrected the error. You should be able to download it from my website now. Sorry for the issue. CAL
Very interesting video. It's always a good thing to know how the FFT library works. Thank you for the clear explanations. But the method is not very accurate on an arduino. I had differences of up to 10Hz at 440Hz with a calibrated audio source.
Hi Longdong, Thank you for the comment. The results are not very very accurate. You are correct. It does work fine though for none commercial projects. Thanks again for the comment.
This is really much needed video sir. Sir, is this the resonance frequency of that tuning fork? Or, is there any electronic device which specially made for calculating the resonant frequency of an object?
I have an issue with arduinoFFT FFT = arduinoFFT () ; I get Compilation error: 'arduinoFFT' does not name a type; did you mean 'ArduinoFFT'?. If I change this I then get: Compilation error: invalid use of template-name 'ArduinoFFT' without an argument list
Hi, I have just tried this and several other projects that use FFTand always get this error, I am using the latest "arduinoFFT" library 2.0.2 by Enrique Condes : error: Compilation error: 'arduinoFFT' does not name a type; did you mean 'ArduinoFFT'?
@@FekadeselassieAshenafi It turns out that the updated library has been changed with some capitalization in some of the words. If you uninstall it and go back to library 1.6.2 it should work.
Thank you for your great video. I deleted last code 'while (1);' because I wanted to get continuous frequency data when there was more than a certain size of sound. But meaningless frequencies were printed without any sound. How can the output be reduced when there is no main sound?
Glad it helped! Tristan is correct. You would need to set a higher threshold so only "main sound" as you say, can be detected. Please like, share and subscribe.
@@CALettsomePhDPE I've been messing with this sensor and it seems that's it's main purpose, to detect loud noise. It has been struggling to read frequencies between 440hz and 55hz, those octaves have been the only ones to yield accurate results. Connected everything just like your video and getting the audio sample from my phone tuner which is correct.
I should get frequency data at least in every quarter of a second from my 15 seconds speech for my project and I will use this data for an immediate comparison with another dataset. So, Is this sensor usable and what is its name?
Is there a way to set a frequency range for the fft? Im working on building an EEG with an arduino and i need to compute an FFT on the input signal. The issue is I need the dominant frequencies that fall within 5 different frequency ranges....
Amazing! Can i use it detect human voices ? And why should reset everytime ? Can i make it always in detect mode ? Im trying to make a project for college and hope this video help me
Hi Aballa, Thank you for asking. It is much more difficult to do with voice and word recognition because human speech is more complicated than a note. The code, as written, does not loop forever. Therefore, it has to be reset. You can change that if you want. You cannot change it to always be in detect mode. It has to process data at some point. Good Luck! Like, Share, and Subscribe.
My OFFSETSAMPLES are all always zero (I'm really not sure why- maybe this is why my frequency results seem almost random). I'm using the same analog audio module, I've calibrated the potentiometer very well to where the sensor LED only comes on at all with so little as a finger tapping on the table, I have double-checked that my wiring is the same as in the video, and have copy-pasted the program from the website. Do I need to use an external pulldown resistor since this is an analog input? If so, what value approximately?
Is it possible to count a continuously changing duty cycle? For example When counting a frequency, we first turn the analog signal to the square wave. The frequency count of a regular analog signal can be considered regularly with 50% duty cycle. However, the square wave duty cycle is not regular in the count of irregular and mixed analog signals. For example, 50, 55, 43, 20, 70, 30, 3, 43, 20, 70, 30, 3, 21, 17, 35 ....... can be a duty cycle. In this case, can the frequency of an analog signal provided in this case?
Hello sir , this is an amazing video . Could you please guide me for a project that i am trying to make ? The basic idea is that the traffic lights detect an ambulance coming it's way by detecting the frequency of the siren , and as soon as it detects it , it turns the traffic light green . But I am facing a lot of problem. Would be great if we get your guidance .
how can I get the instantaneous output received from a Arduino mic, as I do not wanna use SD, pre-loaded MP3, WAV or any other stored data. I need live IP to OP.
The high frequency that you detected was 1024hz. Is this audio sensor and library able to detect higher frequencies. My project will be detecting 2000 to 3000hz. Is this doable with this sensor and library?
Hello, I'm trying to use this code on ATMEL Studio, in a C code project. It seems that c code doesn't understands classes, do ou know how I can fix that ? Thank you for your video anyways !
@@CALettsomePhDPE thank you for your response. I mean the header file uses classes, not your code, so Atmel Studio can't compile your code in a C project . Do you know how I can fix this ?
Sir. could you please tell me how to write code for detecting higher frequencies(4000Hz-6000Hz) I have noticed that increasing the sample frequency can make it detect higher frequency, but that is an inefficient code..it is not detecting accurately (showing 6000Hz for 4000Hz) .. could you please let me know what changes to be made to detect higher frequencies
Hi Dr. Lettsome Where can I buy the actual sound detector module? I have searched on google and got many options, but I want to get the same one you are using. Thank you :)
Hi, I added the link to the parts list on my website. clydelettsome.com/blog/2019/12/18/my-weekend-project-audio-frequency-detector-using-an-arduino/ Please share, like and subscribe.
Hi David, Thank you for asking. I could not get my tablet to work alone either. I had to connect my tablet to pc speakers with an amplifier built in. The issue may be related to amplitude and sensor sensitivity. Try adding pc speakers. If this does not help, you may have to adjust the code.
Thank you for your video. What should I do if the second value is not displayed after initializing the serial monitor after receiving the frequency value first?
Will i be able to detect a frequency of a knock or tap on a table using this sensor? Or is the sound source suppose to be constantly being broadcast to detect.
Am I right that a frequency is known first so I can change the sampling frequency(2 times the known frequency) in the code to output the same known frequency in the serial output of Arduino IDE? Or is it getting the sound and let the system(the sound sensor and arduino display the real time audio to it's equivalent frequency?) I have tested the system using frequency generator app to several frequencies and it did serial output correct frequency but need to change the sampling frequency everytime I need to verify it . Thanks.
Hi Dr, i facing error when i want to open code download link, what can i do to solve this issue. The error was "there has been a critical error on this website."
Hi Aizuddin, I responded to a message you sent me by email. I was working on the site at the time. Please try to download the file again and let me know if you are still having issues.
Hi, I have a question regarding how to bypass the constant "reset" hitting, as I want a quick update of frequencies due to a variety of notes that will be hit in a short amount of time, and I cant hit reset every time. Thank you.
Im working on building an EEG with an arduino and i need to compute an FFT on the input signal. The issue is I need the dominant frequencies that fall within 5 different frequency ranges....
Hey, Thank you for such a helpful video. I tried to download the code from the website but it saves the file as a cpio archive which I can't seem to open any help would be greatly appreciated!!
Thanks for asking. The frequency cannot be determined instantaneously as the frequency is determined by a set of samples collected. However, the frequency can be determined after a sufficient amount of samples have been collected. You can loop the code so it can continuously sample signals if this is what you desire. Like, Share and Subscribe.
Hi Amadeus, It was down temporarily for short periods of time each day as I rework the look. Just look at note at the top to see what times it will be down.
Hi Jayanta, Thank you for asking. If pin 0 is an input, it should be. Please go to my website for the code. If pin 0 needs to be an input, it is set in the code.
Thanks for asking. Please use the following link and go to clydelettsome.com/blog/2019/12/18/my-weekend-proje…using-an-arduino/ the "Obtain the arduinoFFT libarary" section of the page to see how to get the library.
@@Cherish_611 I am not sure. I did not write the libarary. Here is where you can find more information about the arduinoFFT library. github.com/kosme/arduinoFFT
Hi, I have just tried this and several other projects that use FFTand always get this error, I am using the latest "arduinoFFT" library 2.0.2 by Enrique Condes : error: Compilation error: 'arduinoFFT' does not name a type; did you mean 'ArduinoFFT'?
Code works amazingly! I just ran it and saw it was using 60% of the global variable space. If you move " double vReal[SAMPLES];
double vImag[SAMPLES];
unsigned long microSeconds;" into the for loop, that percentage drops to 10%. I had to do this to compact things for my Junior Design project, it still works great! thanks once again
Where can I get the code? I already went to the website and search for it. After I check out, it send the link but I cant open it.
Thanks for the advice. Please like, share, and subscribe.
Hi Fatin,
If you gave your correct email address when you registered on my website, I sent you an email to tell you I corrected the error. You should be able to download it from my website now. Sorry for the issue.
CAL
@@CALettsomePhDPE Can it detect sound of baby crying too?
@@fatinfarahin6836 bebek sesini algılayan dedektör yapabildin mi
If you don't want hardware reset, you should delete the while (1) line and if you want the time delay add delay(1000); (1sec) or something else.
THIS IS INSANE CLYDE LETTSOME!!!!!!!! LOVE FROM NORWAY
The one video I have been looking for 🙏 you sir are a life saver
You are welcome. Please like, share and subscribe.
awsome, i was in doubt about this sensor, now i´ll buy one for sure.
Happy to hear the video helped.
Please like, share and subscribe.
What was the version of the arduinoFFT library you added when you made this video, the latest version seems that it is not working
same problem here, did you find a solution?
@@gururajk9702 After several error_codes .... finally, it was compiled, but it doesn't work
Install version 1.50
Library 2.0 has changed some of the capitalization of the words - go back to 1.6.2 and it should work fine.
Thanks! This could be useful in a bee-related project I have in mind.
Very interesting video. It's always a good thing to know how the FFT library works. Thank you for the clear explanations. But the method is not very accurate on an arduino. I had differences of up to 10Hz at 440Hz with a calibrated audio source.
Hi Longdong,
Thank you for the comment. The results are not very very accurate. You are correct. It does work fine though for none commercial projects.
Thanks again for the comment.
Are there any more accurate sensor modules out there?
@@ACID2BREAKS Please define what you mean by "accuracy" for a microphone.
This is really much needed video sir. Sir, is this the resonance frequency of that tuning fork?
Or, is there any electronic device which specially made for calculating the resonant frequency of an object?
I have an issue with arduinoFFT FFT = arduinoFFT () ;
I get Compilation error: 'arduinoFFT' does not name a type; did you mean 'ArduinoFFT'?.
If I change this I then get:
Compilation error: invalid use of template-name 'ArduinoFFT' without an argument list
Your a MASTER! Thanks a lot!
You're welcome! Like, Share and Subscribe!
Hi, I have just tried this and several other projects that use FFTand always get this error, I am using the latest "arduinoFFT" library 2.0.2 by Enrique Condes : error: Compilation error: 'arduinoFFT' does not name a type; did you mean 'ArduinoFFT'?
Ya Me to what is the reason ?
@@FekadeselassieAshenafi It turns out that the updated library has been changed with some capitalization in some of the words. If you uninstall it and go back to library 1.6.2 it should work.
@@thefrugalphotographer okay thank you
Thank you for your great video. I deleted last code 'while (1);' because I wanted to get continuous frequency data when there was more than a certain size of sound. But meaningless frequencies were printed without any sound. How can the output be reduced when there is no main sound?
You'd need a way to determine the amplitude of the sound, so it only acts when the sound is loud enough.
Glad it helped! Tristan is correct. You would need to set a higher threshold so only "main sound" as you say, can be detected.
Please like, share and subscribe.
@@CALettsomePhDPE I've been messing with this sensor and it seems that's it's main purpose, to detect loud noise.
It has been struggling to read frequencies between 440hz and 55hz, those octaves have been the only ones to yield accurate results. Connected everything just like your video and getting the audio sample from my phone tuner which is correct.
Hi Tristan,
You may have to make some adjustment to the code and/or adjustments to the audio sensor that you used.
Good luck!
Thanks for the video? What is the lowest frequency that one of these modules can register?
I should get frequency data at least in every quarter of a second from my 15 seconds speech for my project and I will use this data for an immediate comparison with another dataset. So, Is this sensor usable and what is its name?
Is there a way to set a frequency range for the fft? Im working on building an EEG with an arduino and i need to compute an FFT on the input signal. The issue is I need the dominant frequencies that fall within 5 different frequency ranges....
Great music and project thanks
I kind of wish you had put the name of the music in your description
Thank you.
Please like, share and subscribe.
@@CALettsomePhDPE I am liking
Amazing!
Can i use it detect human voices ?
And why should reset everytime ?
Can i make it always in detect mode ?
Im trying to make a project for college and hope this video help me
Hi Aballa,
Thank you for asking.
It is much more difficult to do with voice and word recognition because human speech is more complicated than a note.
The code, as written, does not loop forever. Therefore, it has to be reset. You can change that if you want.
You cannot change it to always be in detect mode. It has to process data at some point.
Good Luck!
Like, Share, and Subscribe.
can you demonstrate this via a spectrum analyzer? I was hoping to see all the frequency components of a given signal
Hello sir, The program codes you shared did not work on the arduino Promicro device. What do you think could be the reason for this?
Subscribed, code works great!
Thanks. Share and like.
Great video! How would you measure the frequency with an accuracy of 0.01Hz?
Thank you for asking. I think you will need more precise components to do that. This video is for hobbyist and educational purposes.
The highest frequency the mic can record is around 20kHz so what happens to your circuit if a signal higher than 1024hz hits your circuit
My OFFSETSAMPLES are all always zero (I'm really not sure why- maybe this is why my frequency results seem almost random). I'm using the same analog audio module, I've calibrated the potentiometer very well to where the sensor LED only comes on at all with so little as a finger tapping on the table, I have double-checked that my wiring is the same as in the video, and have copy-pasted the program from the website. Do I need to use an external pulldown resistor since this is an analog input? If so, what value approximately?
Is it possible to count a continuously changing duty cycle? For example When counting a frequency, we first turn the analog signal to the square wave. The frequency count of a regular analog signal can be considered regularly with 50% duty cycle. However, the square wave duty cycle is not regular in the count of irregular and mixed analog signals. For example, 50, 55, 43, 20, 70, 30, 3, 43, 20, 70, 30, 3, 21, 17, 35 ....... can be a duty cycle. In this case, can the frequency of an analog signal provided in this case?
Hello sir, may I know how to modify the code because I'm using 6 sound sensor and I need the frequency output of that 6 sound sensors simultaneously
You can probably use interrupts on each sound sensor, but probably with a faster clocking uC like a ESP32
It's wonderful!!!
Thank you.
Please like, share and subscribe.
Hello sir , this is an amazing video . Could you please guide me for a project that i am trying to make ? The basic idea is that the traffic lights detect an ambulance coming it's way by detecting the frequency of the siren , and as soon as it detects it , it turns the traffic light green . But I am facing a lot of problem. Would be great if we get your guidance .
Hi Aanandita,
Thanks for asking. Unfortuantely I do not teach and tutor anymore. I am working full-time as a consultant, contractor, and researcher.
Hi Sir! Did you succeed in completing your project?
how can I get the instantaneous output received from a Arduino mic, as I do not wanna use SD, pre-loaded MP3, WAV or any other stored data. I need live IP to OP.
The high frequency that you detected was 1024hz. Is this audio sensor and library able to detect higher frequencies. My project will be detecting 2000 to 3000hz. Is this doable with this sensor and library?
Heyy, I'm doing a project for detecting high frequency. were you able to find a method to detect higher frequencies?
Thank you for asking. I did not try higher frequencies.
Hello, I'm trying to use this code on ATMEL Studio, in a C code project. It seems that c code doesn't understands classes, do ou know how I can fix that ?
Thank you for your video anyways !
Hello Arthur,
Thank you for asking. The code was not written with classes. If you need to use classes, you will have to code it to do so.
CAL
@@CALettsomePhDPE thank you for your response. I mean the header file uses classes, not your code, so Atmel Studio can't compile your code in a C project . Do you know how I can fix this ?
Thank you for asking. I do not off at this time. The code I wrote was specifically for the Arduino IDE. Sorry.
@@CALettsomePhDPE no worries, thank you for your answers anyway !
maybe you can use the tone function and a buzzer instead of the "device(s) that create(s) a known frequency" :)
That is possible but it is so much more interestng to use items that are more common.
Please like, share, and subscribe.
No, because the tone function is not very accurate.
This is awesome
Sir.
could you please tell me how to write code for detecting higher frequencies(4000Hz-6000Hz)
I have noticed that increasing the sample frequency can make it detect higher frequency, but that is an inefficient code..it is not detecting accurately (showing 6000Hz for 4000Hz) ..
could you please let me know what changes to be made to detect higher frequencies
Hi Dr. Lettsome
Where can I buy the actual sound detector module? I have searched on google and got many options, but I want to get the same one you are using.
Thank you :)
Hi,
I added the link to the parts list on my website. clydelettsome.com/blog/2019/12/18/my-weekend-project-audio-frequency-detector-using-an-arduino/
Please share, like and subscribe.
@@CALettsomePhDPE thank you dr.!!!
I'm using my phone to generate a frequency and the readings I'm getting aren't too accurate, what can I do to improve my results?
Hi David,
Thank you for asking. I could not get my tablet to work alone either. I had to connect my tablet to pc speakers with an amplifier built in. The issue may be related to amplitude and sensor sensitivity. Try adding pc speakers. If this does not help, you may have to adjust the code.
And try liwering the sent frequency, tje higzer tje frequency is the worse it is to detect
Thank you for your video.
What should I do if the second value is not displayed after initializing the serial monitor after receiving the frequency value first?
Will i be able to detect a frequency of a knock or tap on a table using this sensor? Or is the sound source suppose to be constantly being broadcast to detect.
It is better if the sond is constant.
Please like, share and subscribe.
Am I right that a frequency is known first so I can change the sampling frequency(2 times the known frequency) in the code to output the same known frequency in the serial output of Arduino IDE? Or is it getting the sound and let the system(the sound sensor and arduino display the real time audio to it's equivalent frequency?) I have tested the system using frequency generator app to several frequencies and it did serial output correct frequency but need to change the sampling frequency everytime I need to verify it .
Thanks.
Does the FFT convert the analog signal from the sensor to Hz or from where Arduino getting the frequency in Hz?
Thank you so much!
You're welcome!
Please share, like and subscribe.
Hi Dr, i facing error when i want to open code download link, what can i do to solve this issue. The error was "there has been a critical error on this website."
Hi Aizuddin,
I responded to a message you sent me by email. I was working on the site at the time. Please try to download the file again and let me know if you are still having issues.
Thank you Dr...really appreciate your help and it's working really nice...heheheheh
Hi does the sensor have to be DEVMO or can I use another brand, they look identical?
Nice project sir
Thank you! Please like, share, and subscribe.
Get this be used for belt tension also
Nice clear explanation, thank you.
Glad it was helpful!
Please like, share, and subscribe.
Nice vid
Thank you!
Please like, share, and subscribe.
Hi, I have a question regarding how to bypass the constant "reset" hitting, as I want a quick update of frequencies due to a variety of notes that will be hit in a short amount of time, and I cant hit reset every time. Thank you.
Hey, did you find the answer?
@@gaznevi Have not yet unfortunately, I think it is best to use Fast Fourier Transform and a different circuit using a better sound sensor.
Is there a way to set a frequency range for the fft?
Im working on building an EEG with an arduino and i need to compute an FFT on the input signal. The issue is I need the dominant frequencies that fall within 5 different frequency ranges....
Hello sir, how many hertz is the maximum Frequency this app can detect?
Thanks a lot buddy. There are not many people making useful things on youtube. You are definitely not one of them
Thank you. If you like this project, you might like this one also: ua-cam.com/video/2n_JiXvBwsw/v-deo.html
Please like, share and subscribe.
can a audio frequency dectector decotor dectect from a distance ?
Hi,
Thank you for asking. The sensitivity of the sensors used will be the main determinant.
Please like, share and like.
Hey, Thank you for such a helpful video. I tried to download the code from the website but it saves the file as a cpio archive which I can't seem to open any help would be greatly appreciated!!
Please try downloading again. There was an error on the site that has now been corrected.
Very nice
Thanks for the video. You are fucking good
You are welcome. Like, Share and Subscrbe!
hello sir thanks for this video, i want to ask about the amplitude and how can I get the frequency and the amplitude at the same time
Did you found solution for this problem
Can you also read decibels from the audio module?
Can you find anything about decibel measurement?
awesome
Thank you. Please like, share, and subscribe.
Can i measure the frquency in real time?
Thanks for asking. The frequency cannot be determined instantaneously as the frequency is determined by a set of samples collected. However, the frequency can be determined after a sufficient amount of samples have been collected. You can loop the code so it can continuously sample signals if this is what you desire.
Like, Share and Subscribe.
@@CALettsomePhDPE thank you sir to answer my quetion, too loop the code, which code should i add? thanks 🙏
if you wish, maybe you can send me the code to the following email: mafiaganjil18@gmail.com
thank you very much
I followed the video exactly but mine won't output the frequency? Did anyone else have this problem or does anyone know how to fix it?
me tooo..its showing random values :(
Did you fix it tho??
The circuit schematics does not load for me anyone able to tell me why?
seems like your website is down?
Hi Amadeus,
It was down temporarily for short periods of time each day as I rework the look. Just look at note at the top to see what times it will be down.
should we not do pinMode(0, INPUT); ?
Hi Jayanta,
Thank you for asking. If pin 0 is an input, it should be. Please go to my website for the code. If pin 0 needs to be an input, it is set in the code.
please after execution of FFT...... vreal will be signal amplitude
Check the arduinofft library information (github.com/kosme/arduinoFFT). It may be available there.
Is the frequency measure in HZ
Yes it is in Hz.
hello please how can I get the amplitude from this code
Check the arduinofft library information (github.com/kosme/arduinoFFT). It may be available there.
Can this detect gps tracker?
No it cannot.
Can you send me a fft code for my email?
Thanks for asking. Please use the following link and go to clydelettsome.com/blog/2019/12/18/my-weekend-proje…using-an-arduino/
the "Obtain the arduinoFFT libarary" section of the page to see how to get the library.
@@CALettsomePhDPE What function should I use other than MajorPeak if I want to receive the data on a serial monitor every second?
@@Cherish_611 I am not sure. I did not write the libarary. Here is where you can find more information about the arduinoFFT library. github.com/kosme/arduinoFFT
Hi, I have just tried this and several other projects that use FFTand always get this error, I am using the latest "arduinoFFT" library 2.0.2 by Enrique Condes : error: Compilation error: 'arduinoFFT' does not name a type; did you mean 'ArduinoFFT'?
Zhere's abother comment saying u need an older version and after implying it, my code finally worked