My Weekend Project: Audio Frequency Detector Using An Arduino

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 145

  • @Airsoftguns345
    @Airsoftguns345 4 роки тому +12

    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

    • @fatinfarahin6836
      @fatinfarahin6836 4 роки тому +3

      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.

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      Thanks for the advice. Please like, share, and subscribe.

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому +1

      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

    • @fatinfarahin6836
      @fatinfarahin6836 4 роки тому +1

      @@CALettsomePhDPE Can it detect sound of baby crying too?

    • @ahmetdagtepe2596
      @ahmetdagtepe2596 Рік тому

      @@fatinfarahin6836 bebek sesini algılayan dedektör yapabildin mi

  • @gaznevi
    @gaznevi Рік тому +11

    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.

  • @weaq9370
    @weaq9370 Рік тому +1

    THIS IS INSANE CLYDE LETTSOME!!!!!!!! LOVE FROM NORWAY

  • @Airsoftguns345
    @Airsoftguns345 4 роки тому +6

    The one video I have been looking for 🙏 you sir are a life saver

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      You are welcome. Please like, share and subscribe.

  • @rafaellopesluthier4400
    @rafaellopesluthier4400 3 роки тому +2

    awsome, i was in doubt about this sensor, now i´ll buy one for sure.

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому +1

      Happy to hear the video helped.
      Please like, share and subscribe.

  • @MaverickTrustees
    @MaverickTrustees 7 місяців тому +7

    What was the version of the arduinoFFT library you added when you made this video, the latest version seems that it is not working

    • @gururajk9702
      @gururajk9702 6 місяців тому +1

      same problem here, did you find a solution?

    • @centrobiomeca580
      @centrobiomeca580 5 місяців тому

      @@gururajk9702 After several error_codes .... finally, it was compiled, but it doesn't work

    • @digitronix532
      @digitronix532 4 місяці тому +1

      Install version 1.50

    • @thefrugalphotographer
      @thefrugalphotographer 2 місяці тому +2

      Library 2.0 has changed some of the capitalization of the words - go back to 1.6.2 and it should work fine.

  • @BarefootBeekeeper
    @BarefootBeekeeper Рік тому

    Thanks! This could be useful in a bee-related project I have in mind.

  • @longdongsilver4719
    @longdongsilver4719 3 роки тому +3

    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.

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому +5

      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.

    • @ACID2BREAKS
      @ACID2BREAKS Рік тому

      Are there any more accurate sensor modules out there?

    • @longdongsilver4719
      @longdongsilver4719 Рік тому

      @@ACID2BREAKS Please define what you mean by "accuracy" for a microphone.

  • @prassanna369
    @prassanna369 2 роки тому +2

    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?

  • @jumbojimbo706
    @jumbojimbo706 День тому

    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

  • @lazarosarradell
    @lazarosarradell 4 роки тому +2

    Your a MASTER! Thanks a lot!

  • @dvdowns
    @dvdowns 4 місяці тому +1

    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
      @FekadeselassieAshenafi 2 місяці тому

      Ya Me to what is the reason ?

    • @thefrugalphotographer
      @thefrugalphotographer 2 місяці тому +1

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

    • @FekadeselassieAshenafi
      @FekadeselassieAshenafi 2 місяці тому

      @@thefrugalphotographer okay thank you

  • @Tina-zn1lx
    @Tina-zn1lx 3 роки тому +3

    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?

    • @Dogburt_Junior
      @Dogburt_Junior 3 роки тому +1

      You'd need a way to determine the amplitude of the sound, so it only acts when the sound is loud enough.

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому

      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.

    • @Dogburt_Junior
      @Dogburt_Junior 3 роки тому +1

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

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому +2

      Hi Tristan,
      You may have to make some adjustment to the code and/or adjustments to the audio sensor that you used.
      Good luck!

  • @Oddzilla51
    @Oddzilla51 2 роки тому +2

    Thanks for the video? What is the lowest frequency that one of these modules can register?

  • @aliarslan2638
    @aliarslan2638 3 роки тому +1

    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?

  • @jamesgrissom9741
    @jamesgrissom9741 2 роки тому +1

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

  • @SusanAmberBruce
    @SusanAmberBruce 3 роки тому +1

    Great music and project thanks
    I kind of wish you had put the name of the music in your description

  • @enGGamer98
    @enGGamer98 4 роки тому +3

    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

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому +3

      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.

  • @nobod354
    @nobod354 6 місяців тому

    can you demonstrate this via a spectrum analyzer? I was hoping to see all the frequency components of a given signal

  • @apatiamusic
    @apatiamusic 2 роки тому

    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?

  • @Airsoftguns345
    @Airsoftguns345 4 роки тому +1

    Subscribed, code works great!

  • @palingebrigtsen4365
    @palingebrigtsen4365 3 роки тому +4

    Great video! How would you measure the frequency with an accuracy of 0.01Hz?

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому +6

      Thank you for asking. I think you will need more precise components to do that. This video is for hobbyist and educational purposes.

  • @shaunmurda4727
    @shaunmurda4727 Рік тому

    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

  • @ChronoGXay
    @ChronoGXay 6 місяців тому

    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?

  • @ahmetozdemir7173
    @ahmetozdemir7173 3 роки тому

    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?

  • @johnmaricagravio4357
    @johnmaricagravio4357 4 роки тому +2

    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

    • @thebeat2575
      @thebeat2575 2 роки тому

      You can probably use interrupts on each sound sensor, but probably with a faster clocking uC like a ESP32

  • @double-v3218
    @double-v3218 4 роки тому +1

    It's wonderful!!!

  • @01aananditasharma64
    @01aananditasharma64 4 роки тому +2

    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 .

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому +2

      Hi Aanandita,
      Thanks for asking. Unfortuantely I do not teach and tutor anymore. I am working full-time as a consultant, contractor, and researcher.

    • @buvaneshkanths894
      @buvaneshkanths894 3 роки тому

      Hi Sir! Did you succeed in completing your project?

  • @rkjayakrishnan3997
    @rkjayakrishnan3997 9 місяців тому

    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.

  • @solardad
    @solardad 4 роки тому +2

    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?

    • @NavodKiriwaththuduwa
      @NavodKiriwaththuduwa 4 роки тому +1

      Heyy, I'm doing a project for detecting high frequency. were you able to find a method to detect higher frequencies?

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому

      Thank you for asking. I did not try higher frequencies.

  • @ArthurLnz
    @ArthurLnz 4 роки тому +1

    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
      @CALettsomePhDPE  4 роки тому

      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

    • @ArthurLnz
      @ArthurLnz 4 роки тому

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

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      Thank you for asking. I do not off at this time. The code I wrote was specifically for the Arduino IDE. Sorry.

    • @ArthurLnz
      @ArthurLnz 4 роки тому +1

      @@CALettsomePhDPE no worries, thank you for your answers anyway !

  • @albandaumer3441
    @albandaumer3441 4 роки тому +1

    maybe you can use the tone function and a buzzer instead of the "device(s) that create(s) a known frequency" :)

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому +1

      That is possible but it is so much more interestng to use items that are more common.
      Please like, share, and subscribe.

    • @longdongsilver4719
      @longdongsilver4719 3 роки тому

      No, because the tone function is not very accurate.

  • @brocksamson8634
    @brocksamson8634 5 місяців тому

    This is awesome

  • @shrekanthofficial-8540
    @shrekanthofficial-8540 Рік тому

    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

  • @mycurrents
    @mycurrents 4 роки тому +1

    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 :)

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      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.

    • @mycurrents
      @mycurrents 4 роки тому

      @@CALettsomePhDPE thank you dr.!!!

  • @davidgentzel4001
    @davidgentzel4001 3 роки тому +1

    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?

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому +1

      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.

    • @MichaelSträssle
      @MichaelSträssle Місяць тому

      And try liwering the sent frequency, tje higzer tje frequency is the worse it is to detect

  • @jijeonm
    @jijeonm 3 роки тому

    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?

  • @randomhobby2764
    @randomhobby2764 4 роки тому +1

    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.

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      It is better if the sond is constant.
      Please like, share and subscribe.

  • @bobbamba7703
    @bobbamba7703 2 роки тому

    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.

  • @dominikschmitt1503
    @dominikschmitt1503 2 роки тому

    Does the FFT convert the analog signal from the sensor to Hz or from where Arduino getting the frequency in Hz?

  • @SinaAtalay
    @SinaAtalay 3 роки тому +1

    Thank you so much!

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому

      You're welcome!
      Please share, like and subscribe.

  • @aizuddinhasri8903
    @aizuddinhasri8903 3 роки тому +1

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

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому +1

      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.

    • @aizuddinhasri8903
      @aizuddinhasri8903 3 роки тому +2

      Thank you Dr...really appreciate your help and it's working really nice...heheheheh

  • @parthpurohit6033
    @parthpurohit6033 2 роки тому

    Hi does the sensor have to be DEVMO or can I use another brand, they look identical?

  • @motivationtech5231
    @motivationtech5231 4 роки тому +1

    Nice project sir

  • @أيمانعزتمواءاز
    @أيمانعزتمواءاز Місяць тому

    Get this be used for belt tension also

  • @youroldmangaming8150
    @youroldmangaming8150 3 роки тому +1

    Nice clear explanation, thank you.

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому

      Glad it was helpful!
      Please like, share, and subscribe.

  • @SLguitarGuy
    @SLguitarGuy 3 роки тому +2

    Nice vid

  • @Notpresent-1
    @Notpresent-1 Рік тому

    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.

    • @gaznevi
      @gaznevi Рік тому

      Hey, did you find the answer?

    • @Notpresent-1
      @Notpresent-1 Рік тому

      @@gaznevi Have not yet unfortunately, I think it is best to use Fast Fourier Transform and a different circuit using a better sound sensor.

  • @jamesgrissom9741
    @jamesgrissom9741 2 роки тому +1

    Is there a way to set a frequency range for the fft?

    • @jamesgrissom9741
      @jamesgrissom9741 2 роки тому

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

  • @apatiamusic
    @apatiamusic 2 роки тому

    Hello sir, how many hertz is the maximum Frequency this app can detect?

  • @anonymoususer900
    @anonymoususer900 4 роки тому +2

    Thanks a lot buddy. There are not many people making useful things on youtube. You are definitely not one of them

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      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.

  • @creativitytools4576
    @creativitytools4576 3 роки тому +1

    can a audio frequency dectector decotor dectect from a distance ?

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому +1

      Hi,
      Thank you for asking. The sensitivity of the sensors used will be the main determinant.
      Please like, share and like.

  • @Anonymous-ym6oz
    @Anonymous-ym6oz 4 роки тому +1

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

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      Please try downloading again. There was an error on the site that has now been corrected.

  • @plutarco8556
    @plutarco8556 11 місяців тому

    Very nice

  • @TiagoodosSantos
    @TiagoodosSantos 4 роки тому +2

    Thanks for the video. You are fucking good

  • @medb2322
    @medb2322 2 роки тому

    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

  • @christianbautch4015
    @christianbautch4015 3 роки тому

    Can you also read decibels from the audio module?

  • @inferno6012
    @inferno6012 5 років тому +1

    awesome

  • @fisikaok5818
    @fisikaok5818 4 роки тому +2

    Can i measure the frquency in real time?

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому +2

      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.

    • @fisikaok5818
      @fisikaok5818 4 роки тому

      @@CALettsomePhDPE thank you sir to answer my quetion, too loop the code, which code should i add? thanks 🙏

    • @fisikaok5818
      @fisikaok5818 4 роки тому

      if you wish, maybe you can send me the code to the following email: mafiaganjil18@gmail.com
      thank you very much

  • @madhavikennedy2225
    @madhavikennedy2225 Рік тому

    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?

  • @NikanKm
    @NikanKm 3 роки тому

    The circuit schematics does not load for me anyone able to tell me why?

  • @amadeus.a
    @amadeus.a 3 роки тому +1

    seems like your website is down?

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому

      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.

  • @jayantabanik2751
    @jayantabanik2751 3 роки тому

    should we not do pinMode(0, INPUT); ?

    • @CALettsomePhDPE
      @CALettsomePhDPE  3 роки тому

      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.

  • @yassirbendrao2862
    @yassirbendrao2862 4 роки тому

    please after execution of FFT...... vreal will be signal amplitude

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      Check the arduinofft library information (github.com/kosme/arduinoFFT). It may be available there.

  • @twashinilahi6823
    @twashinilahi6823 4 роки тому +1

    Is the frequency measure in HZ

  • @yassirbendrao2862
    @yassirbendrao2862 4 роки тому

    hello please how can I get the amplitude from this code

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому

      Check the arduinofft library information (github.com/kosme/arduinoFFT). It may be available there.

  • @JA-yy6bd
    @JA-yy6bd 4 роки тому +1

    Can this detect gps tracker?

  • @Cherish_611
    @Cherish_611 4 роки тому +1

    Can you send me a fft code for my email?

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому +1

      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
      @Cherish_611 4 роки тому +2

      @@CALettsomePhDPE What function should I use other than MajorPeak if I want to receive the data on a serial monitor every second?

    • @CALettsomePhDPE
      @CALettsomePhDPE  4 роки тому +1

      @@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

  • @FekadeselassieAshenafi
    @FekadeselassieAshenafi 2 місяці тому +1

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

    • @MichaelSträssle
      @MichaelSträssle Місяць тому

      Zhere's abother comment saying u need an older version and after implying it, my code finally worked