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
--------------------------------------------------------------------------------------------------------
Do you like the video? Please consider buying me a coffee, thank you! www.buymeacoffee.com/upir
Here are more videos with Arduino and OLED display - th-cam.com/video/HVHVkKt-ldc/w-d-xo.html
Love these tutorials, really well made and easy to follow, thank you!
That’s great to hear, thank you for your comment and I’m glad it’s useful.
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.
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.
Thanks for your efforts and tutorials ♥
You are welcome, I’m glad it’s helpful.
Thank you for Sharing your Knowledge! :)
You are welcome, I´m glad you like it!
Thank you for another great tutorial!
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.
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!
such a great video tutorial thank you very much! subbed :)
Thank you and welcome to the team 🙂
This is awesome I sometimes like the easy ones !!!.....cheers.
Thank you!
Superb Tutorial
Thank you, I´m glad you like it!
Excelente! 😃👍
Thank you, I’m glad you like it!
Super And Amazing!
Thank you, I´m glad you like it!
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?
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.
@@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.
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?
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?
@@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
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?
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.
@@upir_upir The chip is still too expensive and complex for what I need. I will probably go with an op-amp solution.
@@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.
@@upir_upir Not a problem. Thanks anyway.
I'm just surprised something so simple seems to be so hard to find a solution.
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
You can use different microphone, but this particular chip only supports 8 frequencies. You would need a different chip / approach.
@@upir_upir can you suggest chip for 31 band frequency and for sm58 microphone
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
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.
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.
Hello there.
Is the code from Github the "Complete code"???
Ir do i need to edit it just like you did on the video
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.
Thank you Very much
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.
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)".
@@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.
Is there a way to adjust the sensitivity of the mic? This analyzer seems to peak very easily.
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.
ı love it
That´s great to hear, thank you for your comment!
Can you increase the amount of bars that the audio analyser detects?
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
Can you use the computer audio instead of the audio analyzer?
You mean using computer audio to analyze the audio signal? Yes, that should surely be possible.
Can you run it on GC9A01 LCD round display?
Yes, if you use proper libraries, it should be possible.
could you use an ad2 make the signal
I’m sorry I don’t understand the question.
How to display more bars? Even 1 or 2 pixels width?
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.
Does it take stereo input?
No, but you can use two modules to get the stereo readings.
Hello there. Where did you source a MSGEQ7 chip please? Aliexpress is full of fakes.
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?
@@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.
I'm finding it a little difficult to understand how a male human voice produces that much sound in the 16k hz range.
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..
@@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.
Terriffic
Thank you, I´m glad you like it! Good luck with your projects.