Arduino Audio Analyzer (Tutorial for Beginners, SSD1306 OLED, u8g2, Arduino UNO)

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ค. 2023
  • Do you like the video? Please consider buying me a coffee, thank you! www.buymeacoffee.com/upir
    PCBway: www.pcbway.com/setinvite.aspx...
    Source files: github.com/upiir/arduino_audi...
    WOKWI sketch: wokwi.com/projects/3655895711...
    ------------------------------------------------------------------------------------------
    In this project, I will show you how to create a simple audio analyzer using Arduino UNO, an OLED display (SSD1306 128x64px I2C), Audio Analyzer module from DFRobot and Microphone from DFRobot. Enjoy!
    ------------------------------------------------------------------------------------------
    Links from the video:
    - DFRobot Audio Module: s.click.aliexpress.com/e/_Deq...
    - DFRobot Audio Module Documentation: wiki.dfrobot.com/Audio_Analyz...
    - DFRobot Analog Sound Sensor: s.click.aliexpress.com/e/_DmU...
    - WOKWI starting project (OLED menu): • U8g vs. U8g2 Arduino G...
    - 128x64 SSD1306 OLED Display: s.click.aliexpress.com/e/_DCY...
    - 128x64 SSD1306 OLED Display (smaller): s.click.aliexpress.com/e/_DCK...
    - Arduino UNO: s.click.aliexpress.com/e/_AXDw1h
    - UNO Shield with male pins: s.click.aliexpress.com/e/_Dcv...
    - Photopea (online Photoshop-like tool): www.photopea.com/
    - Arduino breadboard prototyping shield: s.click.aliexpress.com/e/_ApbCwx
    - u8g2 documentation: github.com/olikraus/u8g2/wiki...
    Related videos with Arduino and OLED display:
    - Arduino Parking Sensor - • DIY Parking Sensor wit...
    - Turbo pressure gauge with Arduino and OLED display - • Turbo pressure gauge w...
    - Arduino Car Cluster with OLED Display - • Arduino Car Cluster wi...
    - Knob over OLED Display - • Knob over OLED Display...
    - Arduino + OLED = 3D ? - • Arduino + OLED = 3D ?
    - Arduino OLED Gauge - • Arduino OLED Gauge
    - Smaller & Faster Arduino - • Smaller & Faster Arduino?
    ------------------------------------------------------------------------------------------
    PCBWay is a service for manufacturing custom PCBs. If you click the link above, you will get a coupon for $5, which is exactly the price of 10 pieces of custom PCBs. In that case, you will only pay for shipping. Do you have any experience doing this? Please let me know in the comment section!
    ------------------------------------------------------------------------------------------------------------------------------
    Do you have any questions? Suggestions for the next video? Please put those down in the comment section. I try to answer as many questions as I can. Thank you for watching, reading the video description and I hope to see you next time. Good luck with your projects!
    --------------------------------------------------------------------------------------------------------
    #audio #arduino #oled
    --------------------------------------------------------------------------------------------------------

ความคิดเห็น • 71

  • @upir_upir
    @upir_upir  3 หลายเดือนก่อน

    Do you like the video? Please consider buying me a coffee, thank you! www.buymeacoffee.com/upir

  • @upir_upir
    @upir_upir  11 หลายเดือนก่อน +4

    Here are more videos with Arduino and OLED display - th-cam.com/video/HVHVkKt-ldc/w-d-xo.html

  • @fernandoboaro8363
    @fernandoboaro8363 11 หลายเดือนก่อน +4

    Love these tutorials, really well made and easy to follow, thank you!

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน

      That’s great to hear, thank you for your comment and I’m glad it’s useful.

  • @TimeFadesMemoryLasts
    @TimeFadesMemoryLasts 11 หลายเดือนก่อน +9

    Since the arduino is so slow, you can supercharge this project by impementing a sliding discrete fourier transform. It's faster than a fast fourier transform and the fastest you can get with digital fourier analysis. You will be able to implement more frequency bins without bogging down the arduino.

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน +6

      Here all the calculations are actually done on the dedicated chip that’s on the audio analyzer board, so Arduino is not doing anything, other than drawing on the OLED display.

  • @bimokayoba
    @bimokayoba 11 หลายเดือนก่อน +3

    Thanks for your efforts and tutorials ♥

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน +1

      You are welcome, I’m glad it’s helpful.

  • @Cichlor
    @Cichlor 11 หลายเดือนก่อน +6

    Thank you for Sharing your Knowledge! :)

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน +1

      You are welcome, I´m glad you like it!

  • @Wokwi
    @Wokwi 11 หลายเดือนก่อน +1

    Thank you for another great tutorial!

    • @Wokwi
      @Wokwi 11 หลายเดือนก่อน +1

      p.s. you could even simulate the MSGEQ7 with Wokwi by creating a custom chip that feeds random data through I2C, or even record the user's microphone through the undocumented wokwi-microphone part.

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน +1

      Thank you, but my tutorials would be much more boring without your great emmulator! Do you have any links to how to create a custom chip/more details about using the microphone? I would be very interested in that. Thanks!

  • @alirezaakhavi9943
    @alirezaakhavi9943 10 หลายเดือนก่อน +1

    such a great video tutorial thank you very much! subbed :)

    • @upir_upir
      @upir_upir  10 หลายเดือนก่อน

      Thank you and welcome to the team 🙂

  • @andymouse
    @andymouse 11 หลายเดือนก่อน +1

    This is awesome I sometimes like the easy ones !!!.....cheers.

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน

      Thank you!

  • @noman1819
    @noman1819 4 หลายเดือนก่อน +1

    Superb Tutorial

    • @upir_upir
      @upir_upir  4 หลายเดือนก่อน

      Thank you, I´m glad you like it!

  • @luisrey8986
    @luisrey8986 11 หลายเดือนก่อน +1

    Excelente! 😃👍

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน

      Thank you, I’m glad you like it!

  • @Oshan_Dissanayaka
    @Oshan_Dissanayaka 11 หลายเดือนก่อน +1

    Super And Amazing!

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน +1

      Thank you, I´m glad you like it!

  • @BlondieSL
    @BlondieSL 7 หลายเดือนก่อน +1

    That library that you are using for this OLED display, does it also work for the color version of that tiny display?
    With full colors?
    If so, is the foot print of that library smaller than Adafruit's massive libraries?

    • @upir_upir
      @upir_upir  7 หลายเดือนก่อน

      No, the u8g2 library is only for monochrome displays. You need to use a different library, and yes, I´m sure you can find a lightweight ones compared to Adafruit libraries. You can start with TFT_eSPI.

    • @BlondieSL
      @BlondieSL 7 หลายเดือนก่อน

      @@upir_upirYeah, at one time I did find a "lightweight" one for the color display.
      It was ASCII mostly and just a couple of graphics calls like draw line.
      I had lost it for a while, but then found it.
      But I moved over to ESP32j and that lib didn't work so well.
      I don't actually use those little color displays so much anymore, but there are a couple of projects where I'd like to use them as long as the character set looks good.
      Fun times.

  • @elias.keller_photography
    @elias.keller_photography 4 หลายเดือนก่อน +1

    hi! learned a lot from your videos and highly appreciate them. i am currently working on a simmilar project but on an arduino nano and a temp/hum sensor instead of a frequency sensor. howere i really stuggle to get it working with i2c connection. oled itself works, sensor itself works, setting the adresses seems to work (at least from the code side) but the program somehow does not start propperly. did you ever have problems with i2c and the u8g2 library?

    • @upir_upir
      @upir_upir  4 หลายเดือนก่อน

      Thank you for your comment. I actually had a problem with u8g2 library and some OLED displays, and it helped to slow down the IIC connection from 400 down to 100Hz. Could you try that?

    • @elias.keller_photography
      @elias.keller_photography 4 หลายเดือนก่อน

      @@upir_upir not yet but i just saw that 100khz is the standard speed and i didnt change that. i will still try and see if changing the speed affects this problem

  • @TryptychUK
    @TryptychUK 6 หลายเดือนก่อน +1

    A great little project.
    I have a requirement for a simple board or circuit for an audio signal amplitude from an MP3 player board running off Arduino to trigger an LED light.
    (Basically an audio envelope follower/trigger.)
    The analyser board you are using is over-specced and too expensive for my needs.
    Is there anything you can suggest?

    • @upir_upir
      @upir_upir  6 หลายเดือนก่อน +1

      Thank you. Could you use this chip alone, not in the form of a module? You can also try processing the audio signal directly on Arduino.

    • @TryptychUK
      @TryptychUK 6 หลายเดือนก่อน +1

      @@upir_upir The chip is still too expensive and complex for what I need. I will probably go with an op-amp solution.

    • @upir_upir
      @upir_upir  6 หลายเดือนก่อน

      @@TryptychUKOK, hopefully you will be able to find a solution that works for you. I´m sorry I cannot provide more guidance, but I´m not that familiar with audio processing.

    • @TryptychUK
      @TryptychUK 6 หลายเดือนก่อน

      @@upir_upir Not a problem. Thanks anyway.
      I'm just surprised something so simple seems to be so hard to find a solution.

  • @firstworldpilipinas
    @firstworldpilipinas 6 หลายเดือนก่อน +1

    can i use real microphone like shure sm58 for the input and for the lcd can i make it a 31 band frequency?maybe i can have a longer lcd...thank you

    • @upir_upir
      @upir_upir  6 หลายเดือนก่อน

      You can use different microphone, but this particular chip only supports 8 frequencies. You would need a different chip / approach.

    • @firstworldpilipinas
      @firstworldpilipinas 6 หลายเดือนก่อน

      @@upir_upir can you suggest chip for 31 band frequency and for sm58 microphone

    • @firstworldpilipinas
      @firstworldpilipinas 6 หลายเดือนก่อน

      your suggestion will help me with my project....
      im planning to create a 31 band audio analyzer with the use of shure sm 58 mic... can you help me?thank you

  • @igort5418
    @igort5418 10 หลายเดือนก่อน +1

    I have an idea for a next video, could you make a program for the arduino to stream your pc screen on a 128x32 oled display, and have like a tiny second screen.

    • @upir_upir
      @upir_upir  10 หลายเดือนก่อน

      I like that idea quite a lot, but unfortunately I don´t have enough knowledge how to make sure project - yet. If anyone else has that kind of solution, I would be the first one to buy it.

  • @xedtronicsph3877
    @xedtronicsph3877 6 หลายเดือนก่อน +1

    Hello there.
    Is the code from Github the "Complete code"???
    Ir do i need to edit it just like you did on the video

    • @upir_upir
      @upir_upir  6 หลายเดือนก่อน

      Yes, the code on GitHub is complete. It´s just the WOKWI simulation that is showing some random values because it does not support the chip.

    • @xedtronicsph3877
      @xedtronicsph3877 6 หลายเดือนก่อน +1

      Thank you Very much

  • @noman1819
    @noman1819 4 หลายเดือนก่อน +1

    Hello Upir,
    Can you please share an example for the same Audio Analyzer display on Max7219 dot matrix display ?
    Your help in this regard will be highly appreciated.

    • @upir_upir
      @upir_upir  4 หลายเดือนก่อน

      I have a video about using the MAX7219 dot matrix display using the u8g2 library - i.e. the same library as used here, so merging those two sketches together should be very simple. Please search for my video "Arduino + Matrix Display (The Proper Way)".

    • @noman1819
      @noman1819 4 หลายเดือนก่อน

      @@upir_upir Yes, I followed your video using the MAX7219 dot matrix display. It's working perfectly well displaying the TH-cam logo and 6 digits on 4 dot matrix display of mine. But I need your guidance how to display 7 frequencies audio visualizer on dot matrix display. Kindly provide some details.

  • @TobiahGieser
    @TobiahGieser 5 หลายเดือนก่อน +1

    Is there a way to adjust the sensitivity of the mic? This analyzer seems to peak very easily.

    • @upir_upir
      @upir_upir  5 หลายเดือนก่อน

      The microphone just provides analog voltage, so you might be able to just reduce it using a resistor/potentiometer before feeding this into the audio analyzer module.

  • @SAMETELMACI
    @SAMETELMACI 11 หลายเดือนก่อน +1

    ı love it

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน

      That´s great to hear, thank you for your comment!

  • @quinman16
    @quinman16 11 หลายเดือนก่อน +1

    Can you increase the amount of bars that the audio analyser detects?

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน

      Unfortunately not. The number of analyzed frequencies is set by the used chip on the audio analyzer board. You can do this manually using Arduino, but it will consume quite a lot cpu time

  • @foenixsc5412
    @foenixsc5412 26 วันที่ผ่านมา +1

    Can you use the computer audio instead of the audio analyzer?

    • @upir_upir
      @upir_upir  25 วันที่ผ่านมา

      You mean using computer audio to analyze the audio signal? Yes, that should surely be possible.

  • @tarek_hosni8348
    @tarek_hosni8348 11 หลายเดือนก่อน +1

    Can you run it on GC9A01 LCD round display?

    • @upir_upir
      @upir_upir  11 หลายเดือนก่อน

      Yes, if you use proper libraries, it should be possible.

  • @alberttaber6349
    @alberttaber6349 22 วันที่ผ่านมา +1

    could you use an ad2 make the signal

    • @upir_upir
      @upir_upir  22 วันที่ผ่านมา

      I’m sorry I don’t understand the question.

  • @ex1stenz
    @ex1stenz 13 วันที่ผ่านมา +1

    How to display more bars? Even 1 or 2 pixels width?

    • @upir_upir
      @upir_upir  12 วันที่ผ่านมา +1

      You can do that easily (the display part), but the used module only provides those 7 bands. You would need a different audio analyzer module.

  • @gbangyt-codmobile7037
    @gbangyt-codmobile7037 5 หลายเดือนก่อน +1

    Does it take stereo input?

    • @upir_upir
      @upir_upir  5 หลายเดือนก่อน

      No, but you can use two modules to get the stereo readings.

  • @RoSi4You
    @RoSi4You 11 หลายเดือนก่อน +1

    Hello there. Where did you source a MSGEQ7 chip please? Aliexpress is full of fakes.

    • @upir_upir
      @upir_upir  10 หลายเดือนก่อน

      This one is from DFRobot, it´s the entire module, but you can remove the chip if you want. Is there a way how to tell the chip is fake?

    • @RoSi4You
      @RoSi4You 10 หลายเดือนก่อน +1

      @@upir_upir Not really just plug it in and try, or there are some guides, how to determine it by measuring some voltages between and current draws on some pins. Basically, all aliexpress are considered (by me) as fakes. Dfrobot price is just bit over the hill.

  • @carlfranz6805
    @carlfranz6805 5 หลายเดือนก่อน +1

    I'm finding it a little difficult to understand how a male human voice produces that much sound in the 16k hz range.

    • @upir_upir
      @upir_upir  5 หลายเดือนก่อน

      Is it too low? Too high? According to Wikipedia, During a conversation, the fundamental frequency of a typical adult man ranges from 80 to 180 Hz and that of a typical adult woman from 165 to 255 Hz. I guess the chip is not super accurate or perhaps something else is going on..

    • @carlfranz6805
      @carlfranz6805 4 หลายเดือนก่อน

      @@upir_upir 16K is WAY to high for a mature male human, you're not even going to get (natural) harmonics in that range. Makes me wonder if something else is going on. Since 16K is really hard to hear (unless you're young), perhaps something else to generating the sound in the upper ranges? Or, it is possible the pre-amp is not very good and is augmenting harmonics. It's also possible that the conversion of sound pressure measurement to bar graph is suspect.
      Anyway good luck.

  • @jimsnodgrass8454
    @jimsnodgrass8454 10 หลายเดือนก่อน +1

    Terriffic

    • @upir_upir
      @upir_upir  10 หลายเดือนก่อน

      Thank you, I´m glad you like it! Good luck with your projects.