ESP32 spectrum analyser VU meter using arduinoFFT and a FastLED matrix

Ғылым және технология

I was struggling to understand the arduinoFFT library due to its lack of documentation, so I spent some time investigating and this is what I made. This might also work on an ESP8266, but you will have to reduce the sampling rate as it's not as fast as the ESP32.
The code is written using the Arduino IDE. It can have any number of bands, and comes with 5 preset patterns but it's easy enough to add your own providing you can work with FastLED.The image is displayed on a homemade LED matrix, using the FastLED library.
Click here for a link on how to make your own matrix: • ESP32 powered WS2812B ...
Code is available on GitHub: github.com/s-marley/ESP32_FFT_VU
Based on original code by G6EJD: • Tech Note 077 - ESP32 ...
arduinoFFT library on GitHub: github.com/kosme/arduinoFFT

Пікірлер: 379

  • @theREALdilAndou
    @theREALdilAndou2 жыл бұрын

    Hey Scott. Keep up the good work man. I'm sorry to see how disgracefully G6EJD handled the whole copyright thing. Rip out his code and switch to audio_reactive.h from WLED (MIT licence) and remove all his credit. It's the least the guy deserves.

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    Thank you, that's the plan. As soon as I'm able I will remove any references to his code and links to his channel. Andrew from sound reactive WLED also messaged me in suppport and I really appreciate it from both of you.

  • @mschwage

    @mschwage

    Жыл бұрын

    You could just grab an older version of his library which is licensed under the mit license. You can't retroactively apply a license change... That would be a social nightmare!

  • @TheDradge

    @TheDradge

    9 ай бұрын

    Only just reading your spat with G6EJD and don't see what his problem was. You gave credit albeit in an "unofficial" form. The irony is that on his YT channel he writes "A collection of predominantly technical videos with an aim of helping others to understand topics, to share knowledge and to give examples of what can be achieved." Keep up the good work Scott. You did nothing to deserve that kind of response.

  • @AnthonyHortin
    @AnthonyHortin4 жыл бұрын

    Love this! That is such a beautiful, clean and crisp Matrix that you've put together and looks fantastic with that spectrum analyser running on it. Well done! 👍

  • @ScottMarley

    @ScottMarley

    4 жыл бұрын

    Thank you, for your kind comment!

  • @fragiggle
    @fragiggle Жыл бұрын

    Hey Scott, thanks for this fantastic starting point for my project. I made this powered by a DeWalt battery, mounted to a pole and had to heavily modify the code and hardware to get it to work in any volume level environment. I can't say how much longer this would have taken without this starting point, but I can say it would have been a lot longer. I had the idea to do it 8 years ago and finally sat down to do it last January and found your project during the research phase. Finished it in August and took it to a music festival, people absolutely loved it. Thanks again for the great work!

  • @mehmetaliertorer5819
    @mehmetaliertorer5819 Жыл бұрын

    I have never seen a complicated topic explained so intuitively and straightforward. Such an amazing video

  • @wclumiere5665
    @wclumiere56654 жыл бұрын

    @Scott Marley thanks for sharing, have to say it, this is so far the best video tutorial on how to use the arduinoFFT library I have seen. Keep it up. Great Job!

  • @acquireelectricity1458
    @acquireelectricity14582 жыл бұрын

    Hi. I built it! First I tried using my esp8266, but the latency was massive. Esp32 works amazing. Thank you Scott Marley for this tutorial.

  • @Hienix
    @Hienix2 жыл бұрын

    This is amazing. I've seen other videos and they aren't nearly as good as this explaning the math and logic behind.

  • @dasphantom0439
    @dasphantom0439 Жыл бұрын

    Hi, awesome work. I tried for so long to understand FFT and how to use it. You made it so clear. Thanks!

  • @Jessyplaysz
    @Jessyplaysz7 ай бұрын

    Thanks for the video Scott. It told me just what I wanted to know. This post is for the benefit of anyone considering using an ESP32-S3. Its A/D is not as fast as the ESP32. I ran the Sample Test sketch on a LilyGO T-Display-S3 and got the following rates So I guess its good to around 8kHz audio which is the upper limit of what I need. Conversion time: 60.12 uS Max sampling frequency: 16633.61 Hz Conversion time: 60.12 uS Max sampling frequency: 16632.99 Hz I then thought I could be clever and reduced the A/D resolution from 12 to 9 bits to get a higher conversion speed but alas no luck in Arduino IDE. It was identical.

  • @Marc_Miller
    @Marc_Miller4 жыл бұрын

    Your videos are excellent Scott. Thank you for making and sharing.

  • @ScottMarley

    @ScottMarley

    4 жыл бұрын

    Thank for your support both on here and Reddit. I really appreciate it!

  • @JohnSmith-iu8cj
    @JohnSmith-iu8cj Жыл бұрын

    Yo you nailed it with this one I am going to try something Similar based on your code and I am super thankful for the code you provide! I was thinking about something like this for many years, even more so since studying fft and your video and the fft library are a big motivation to get going!

  • @franklincoellofranklin6756
    @franklincoellofranklin67562 жыл бұрын

    The best video I've ever seen related to FFT!

  • @user-jp1ep8rf4b
    @user-jp1ep8rf4b24 күн бұрын

    Thank you so much for this project. I manages to recreate it using an 8*32 led SPI matrix and a teensy 4.0. This is an amazingly well made and explained project which I had a lot of fun with. Keep up the good work and wish you the very best :)

  • @manoharmanu1460
    @manoharmanu14603 жыл бұрын

    Well explained Scott, for a complete noob like me this is a life saver of a project . I'll try it out and let you know , keep doing cool stuff

  • @rgbcrafts
    @rgbcrafts3 жыл бұрын

    ESP32 seems to be perfect for all kinds of pixelart. Your videos make me quite interested in making these projects myself.

  • @AmitRaj-zz9vp

    @AmitRaj-zz9vp

    3 жыл бұрын

    Hey brother can you please tell if this code runs in Arduino Uno??

  • @mustafaattar7210
    @mustafaattar7210 Жыл бұрын

    Awesome video - been searching for a great use of FTT - well done!

  • @Remowylliams
    @Remowylliams2 жыл бұрын

    Hi Scott, really liked your clear presentation on this. And your project works beautifully. Thank you for sharing.

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    Great, really glad you got it to work!

  • @ClaytonDarwin
    @ClaytonDarwin4 жыл бұрын

    Thanks, Scott. Good info. I've been wanting to try this.

  • @JohnSmith-iu8cj
    @JohnSmith-iu8cj Жыл бұрын

    We need more videos of this vu meter it’s the best thing by far! Nothing else comes near!

  • @brianmiller6320
    @brianmiller63203 жыл бұрын

    Thank you, a very good explanation of the FFT function, I understood it! so well done.

  • @javilarg
    @javilarg10 ай бұрын

    Hi, I was about to make a 7-band audio spectrum visualizer with an Arduino Nano and a MSEQG7 chip, but searching KZread I found this project, easier, more powerful and more impressive. Thank you.

  • @azfilmarchive
    @azfilmarchive Жыл бұрын

    Thanks for a wonderful tutorial. My build went right to work 1st time and the different modes were a delightful surprise. My larger project is to use an IR distance sensor to track trombone slide movements and encode MIDI signals. Besides recording parallel audio and MIDI signals, I can also light 64 individual WS2801 led's in a spiral piano array. Additionally, the MIDI signal operates a silent mono synth that in turn runs your spectrum analyzer. Part an art piece and part a scientific search for patterns in microtonal music. Thanks for adding another dimension to my quest. GCH

  • @ScottMarley

    @ScottMarley

    Жыл бұрын

    That's a really creative idea, I hope it all works out for you!

  • @nozynoz
    @nozynoz3 жыл бұрын

    Thank you for the fantastic video, very well explained and demonstrated.

  • @marinabraho3890
    @marinabraho38903 жыл бұрын

    grazie scott per aver condiviso il tuo lavoro

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    No problem, I hope it's useful!

  • @Edmundajw
    @Edmundajw3 жыл бұрын

    Great video. I have just put together a matrix using a string of WS2815 leds, rearnaged into 10 * strips of 16. I've yet to put together the code, so I'll find this very helpful, as I had intended to do something almost identical to your output. I enjoyed your explanation of the FFT, very scuccint. :)

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    Thank you, best of luck getting everything working!

  • @cyberbyron
    @cyberbyronАй бұрын

    An example of a great video on the topic!

  • @sunrising4931
    @sunrising49313 жыл бұрын

    one of the greatest video best tutorial....sir keep going god bless you..i subscribed your channel 2 day before and saw it from recomendation ,know i am fan of yours.

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    Thank you so much 😀

  • @danimal_1814
    @danimal_1814 Жыл бұрын

    Excellent video Scott. Thank You.

  • @raulguevara1944
    @raulguevara1944 Жыл бұрын

    Hi Scott, your project is very very very cool.

  • @laflaf3d
    @laflaf3d3 жыл бұрын

    Great job ! Thanks for sharing !

  • @logancoats
    @logancoats2 жыл бұрын

    So good, thank you for all the info!

  • @Bianchi77
    @Bianchi77 Жыл бұрын

    Creative video shot, thank you for sharing it, keep it up :)

  • @ifell3
    @ifell32 жыл бұрын

    Awesome, you got another subscriber!!

  • @BrianLough
    @BrianLough3 жыл бұрын

    Love this Scott! I'm planning on making something similar and in was going to use the mseq7 but I think I'll use this instead!

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    Great! It's far less circuitry and much more customisable to do it in software :)

  • @BrianLough

    @BrianLough

    3 жыл бұрын

    @@ScottMarley cheaper too 😅

  • @BrianLough

    @BrianLough

    3 жыл бұрын

    @@ScottMarley I had a play around with it this evening and I couldn't get it working properly. Does the audio source need to be amplified? Like would a cable from a phone headphone jack to the esp32 be what's expected? I wasn't displaying on anything really, I was just printing the value for the top of the line in serial monitor. If I tapped at the line in cable I could see some values, but never anything when playing music. Any suggestions? (Btw I was using a board that doesn't have pin 35 or whatever pin you were using , so I tried 32 and 33, both were the same, I update the pin in the code each time too)

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    No amplification was required for me, works straight from the headphone output of a phone. What values are you printing out, barHeight? And for each channel? Are you using the circuit for line in given on the GitHub page?You can also play with the AMPLITUDE parameter, lower values make it more sensitive (I think, can't quite remember now!). The input pin shouldn't matter, I'm not doing anything clever here ;)

  • @kamhinsee2595
    @kamhinsee25952 жыл бұрын

    Hi Scott, your project is very cool. I am currently doing a school project with STM32F103 MINI V3 development board to make a Music LED Spectrum Analyser like yours. May I know which module would you use in the line-in setup for receiving an audio signal from a computer or phone?

  • @jaapdoornbos3369
    @jaapdoornbos33692 жыл бұрын

    Hi Scott! Again great video! I really enjoy your content! The way you explain everything is super! One question. What do you think? Would it make sense to combine FFT with stereo vu meters? It sometimes seems the response time is slow with the mega and two 2813 strips containining 142 LEDS in stereo. Thanks!

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    Thank you! I wouldn't recommend using an Arduino for fft stuff, they're very very slow. Try a teensy or ESP32, the code is the same but they're much faster (16MHz Vs up to 240Mz!).

  • @jaapdoornbos3369

    @jaapdoornbos3369

    2 жыл бұрын

    @@ScottMarley Sorry, forgot to mention. I'm thinking about replacing the mega with a Teensy 4.0 or 4.1. I'm struggling a bit with how to make FFT work in stereo line in.

  • @alexbraddock7670
    @alexbraddock76703 жыл бұрын

    Great video. I don't know much about electronics, and I was wondering if the sound input could come from the left and right outputs from a Marantz receiver? Would the amplification be too much or is it the same as a 3.5mm output?

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    Don't connect this to the speaker outputs unless you know how. The maximum analog input for the ESP32 ADC is 3.3V. An amplifier can run at much higher voltages than that (10s to 100s of volts depending on the power) and will destroy the ESP. If you *must* do this, you will need to use a voltage divider before the ESP, but how you do this will depend entirely on the voltages that your amplifier provides. The amplifier surely has some kind of lineout you could use?

  • @glitch3154
    @glitch31542 жыл бұрын

    Hey @Scott Marley , I know this is quite an old video, but I did have one quick question regarding one of the animations if you were still around? I have more or less completed this project (Awesome video, major thanks for making this), however, all of the light patterns work correctly apart from the purple and blue gradient one named "purpleBars" in the code. the bars function correctly, however, the purple part is placed randomly among the blue bars rather than at the top as an even gradient as you demonstrated, and seems to be glitch around as the bars shift. Any idea what might be causing this? Thank you for your time!

  • @mamax73
    @mamax73 Жыл бұрын

    Great tutorial. I do not have this led breakout but I will try to adapt your code to work on an optimized and very fast oled library I wrote for SSD1331 and SSD1351 color oleds (96x64) and (128x128). I have a question for you... what ESP32 Arduino Core version do you used to make this ? I tried your code to get max sampling rate from ADC but using last 2.0.6 core I get about 11Khz max and a sampling time about 90us on Wemos D32. Instead using ADC over I2S DMA the max sampling rate from core examples sketch is 277 Khz. Probably something was changed in the core. Anyway, the library I wrote is hardware optimized and permits very high refresh rate, I can stream videos from microsd up 140 FPS with both ESP8266 and ESP32 so I think results shoud be good and fast. For ESP32 I just used single core, so probably It can be optimized more. But note that SSD1331 have a very small display, about 2.5x2 cm. Before to do it, I have to use FFT arduino library for a bit different project, I need to acquire audio from I2S microphone use FFT to get a frequency and convert it to midi. I have no problems for midi and others stuff but my problem is FFT library, I never used it. I found a couple of tutorials on how make a spectrum analyzer, but I do not need to get all bands to show, instead i need to just know an most precise possible the dominant frequency that is at higher level, the fundamental of a voice or whistle over a microphone. You think Great tutorial. I do not have this led beakout but I will try to convert your code to be working on an 96x64 optimized and very fast library I wrote for SSD1331 and SSD1351 color oled. This library is hardware optimized and permits very high refresh rate, I can stream videos from microsd up 140 FPS with both ESP8266 and ESP32. For last I just used single core, so probably It can be optimized more. Before to do it, I have to use FFT arduino library for a bit different project, I need to acquire audio from I2S microphone use FFT to get a frequency and convert it to midi. Please is that possible? I have no problem for midi and others stuff bu my problem is FFT library I never used it. I found a couple of tutorials on how make a spectrum analyzer, but I do not need to get all bands to show, instead i need to just know as most precise possible the dominant frequency that is at higher level, eg. the fundamental of a voice or whistle over a microphone. Please do you know is that is possible ? Should be realtime... Many thanks

  • @marcinzawodnik6317
    @marcinzawodnik63173 жыл бұрын

    Great video. 👍

  • @kingruinous81
    @kingruinous812 жыл бұрын

    Scott this product is amazing and your vu meter fft calculator looks better then any I seen online. Do you have a video on how u set up your Vu meter calculator on excel or file for calculator? I'm a beginner and your explanations are easy to follow even with no experience.

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    The excel file is in the github link in the description if you want to take a look.

  • @medb2322
    @medb23222 жыл бұрын

    Hi scott great video in my case im using esp8266 so i want to know this code will work fine on it and also I do not have a led matrix so how can I display the result on a serial plotter ??

  • @krislivingston5848
    @krislivingston5848 Жыл бұрын

    Hi Scott, great video, very helpful! I made my own using a 64x32 LED matrix from Adafruit, and after a lot of tweaking of parameters, I got it to work. But there are some low-end bands that are blank due to the output of the spreadsheet. I used these inputs: sample rate: 28000, Lowest freq. band: 20, highest band: 14000, # of samples: 512, # bands: 32. The resulting code generated in the table includes many lines like this: if (i>1 && i 1 AND

  • @tobiahhowell
    @tobiahhowell3 жыл бұрын

    this is an amazing project and has inspired me to make a large 50x19 led matrix using this code. i cant seem to find the excel spread sheet you used to map out your bands to finish the code. did you make it your self or did you find it online somewhere? I don't think guessing would provide a good look for my bands. keep up the great work!

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    Hi Tobiah, it's on github with the rest of the code. Its called FFT.xlsx

  • @tobiahhowell

    @tobiahhowell

    3 жыл бұрын

    @@ScottMarley okay thank you. I must not have seen it while looking through it. Thank you very much! Keep up the awesome work!

  • @Anger019
    @Anger0193 жыл бұрын

    Greetings. First, thanks for the video and for the device and the code for it! Thanks for the hard work! I repeated the device, but several questions appeared, with which I ask you to help. I do not understand well in such crafts so far .. 1) Your vu meter speed is faster than mine. I have a feeling that it slows down, it does not work so smoothly. Is there something wrong with the firmware? (although it may seem to me ..) 2) Everything works only when the ESP32 is connected to the computer via a usb wire. If you power it separately from the power supply, the entire image on the matrix hangs and does not react in any way to the sound / button. What could be the problem?

  • @levinsommer371
    @levinsommer3712 жыл бұрын

    Hi Scott, i built my own version with 24 bands, sadly some of the frequency bands on the top part are always maxed out... any ideas what could cause that? (Seems to be affected by the brightness of the matrix, so maybe something corelating with the max amps flowing?) Thanks for the awesome walkthrough video, had alot of fun with this project!

  • @bendtherules0

    @bendtherules0

    Жыл бұрын

    I have also faced that and here are some of the reasons/solutions - 1. Top bands sum up many frequency bins - so small errors get summed up. Reducing the upper range of max band (264-380 instead of 264-512) helped. Adding a per-band noise level helped (500 for lower band, 1500 for highest band). 2. Changed the amplitude sum to bar height mapping - made it logarithmic scale and used some y = a + bx + cx**2 formula. For ex. when your Tv/computer is at 50% volume, the amplitude is not half of max amplitude, it's probably around 1/4th.

  • @vtech8716
    @vtech87163 жыл бұрын

    Hello Sir, and thanks for your great praject. I integrate a part of your project to my oun ws2812 matrix display, but I need to mirror the view horizontally, because bands goes from top in my case. Good luck

  • @getyerspn
    @getyerspn4 жыл бұрын

    That looks very very cool ..huge thanks for the hard work compiling this tutorial...and an excellent explanation of the sampling mechanism....i have tried fft with 8266 devices but when the WiFi is active it seems to make the ADC input 'noisy' ...have you tried this with WiFi running on the esp32 ..I'm now going to order a few Esp32 board's....on a side note have you seen any of Andrew Tuline's fft stuff ?? he's been doing sound reactive fft projects for a few years and has made some quite artistic lighting projects.

  • @ScottMarley

    @ScottMarley

    4 жыл бұрын

    Thanks for your comments, it really was a few days work putting that together even though it might not seem like it! I don't have an 8266, but I know on the ESP32 there are two ADCs, and ADC2 is somehow used for the WiFi. So as the 8266 only has 1 ADC, maybe this has to be shared between the analog pin and the WiFi causing interference? Just guessing here though. Andrew is the chap who does the WLED sound reactive port right? I haven't looked at it yet as I wanted to figure out how to do things myself in the first instance, but I do have an idea for a project that WLED would be good for. Stay tuned!

  • @getyerspn

    @getyerspn

    4 жыл бұрын

    @@ScottMarley ah so that would explain why the esp32 works where the 8266 doesn't ..well i say doesn't I have had it working with an ADS1115 I2C ADC module but you have to jump through hoops to get the sample rate high enough ...you're version is much easier ....here's hoping you're channel grows...anyway bought some ESP32's .

  • @xiaotianzhang3038
    @xiaotianzhang3038 Жыл бұрын

    ! Thank you so much for the clear description of FFT as well as the library. I'd like to ask if it's possible to read the data from Bluetooth? I mean using the A2DP library to feed audio signal instead of line in. I've seen other people do this but none comes with an explanation of their code. Thanks in advance!

  • @ScottMarley

    @ScottMarley

    Жыл бұрын

    That's a good question, I suppose it should be, but I've never played with the BT stuff on the ESP so I don't know for sure!

  • @CharlesLGoodwin
    @CharlesLGoodwin3 жыл бұрын

    Hi Scott, Love what you have done here and can't wait to extend my latest project to include FFT One quick question - I have the microphone amplifier MAX4466 with adjustable gain but I don't know what I should set it to or how I should go about it. I've already reproduced Dave's (G6EJD) example but whist blindly meddling (as one does) the adjustable screw broke off! Is this something I can stay clear of for this project or is there a calibration exercise that you would recommend?

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    I just left it at the halfway point and then played about with the numbers in software until it looked about right. That adjustment pot is really fragile, I've broken them in the past too.

  • @CharlesLGoodwin

    @CharlesLGoodwin

    3 жыл бұрын

    @@ScottMarley Thanks Scott - Glad it's not just me :-)

  • @band5680
    @band56802 жыл бұрын

    Hi Scott, thanks a lot for the time you took in sharing your project! If you can, why don't you set the sampling frequency higher, to 100kHz for example? Wouldn't it also shrink the latency time? After sampling the audio pin in 9.7microseconds the program waits nearly 15microseconds, before the next sample. After 1024 samples the for-loop ends and the FFT starts, right? That adds up to an unnecessary delay of ~15milliseconds. This is my first arduino/esp32 project and I also haven't coded before, so please correct me if I'm wrong :D Thanks! Max

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    You could try that and see what happens, however I'm not sure what benefit it would bring. If you're using e.g. a MAX4466 based microphone, the 3dB point is at just 6kHz and by 20kHz its basically zero. A line-in would be better of course, but when I tested my hearing response, I could only get up to about 18kHz before I couldn't hear anything at all. Plus, extra time is required to do the FFT calculations, create the patterns and output the LED data to the matrix. However, do let me know if you do try it and of you get reasonable results.

  • @manueleschborn9371
    @manueleschborn9371 Жыл бұрын

    Hey Scott! I really like your Project and I'm trying to build a simliar one. I'm using an ESP-WROOM-32, but my max datarate is 10 times lower than yours. Do you have any idea why this might happen?

  • @luigimorelli6444
    @luigimorelli64443 жыл бұрын

    Nice work! Did you take the line from the amplified signal, in parallel with the loudspeakers? No impedance change in the loudspeakers nor spurious interferences to the signal, giving distortions?

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    No, it takes a line-in. Be careful if you use the speaker cable. The maximum input voltage on an ESP is 3.3V, speakers are driven far higher than that usually so you would need a voltage divider etc.

  • @luigimorelli6444

    @luigimorelli6444

    3 жыл бұрын

    @@ScottMarley Thank you for the reply. I was afraid that the line-in level was too low and should be amplifieed..

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    @@luigimorelli6444 make sure you look at the circuit diagram on GitHub. It is very low level, but that's ok. I actually find it works best using a microphone instead.

  • @qzorn4440
    @qzorn44402 жыл бұрын

    very nice and understandable 🤩 now to add some numbers to display values as in a simple spectrum analyzer for trouble shooting power harmonics 🤔 Mmm 🙄 thanks a lot 🥳🐬☕

  • @ryzie2497
    @ryzie24972 жыл бұрын

    This video awsome and your awsome for making it

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    Thank you and happy holidays whatever you celebrate :)

  • @ryandhowell07
    @ryandhowell073 жыл бұрын

    First, great video and explanation of the science behind the FFT library. It inspired me to build my own LED matrix. I built it in exactly the same configuration that you did, with the copper tape running up the sides for the power and ground and the signal wiring connecting each strip on the back of the board. Lights work great. However, when I upload the code, with the 16-band configuration, my matrix shows a mirroring effect--meaning that when I run a frequency tone test, instead of the columns lighting up left to right like yours did as you increase the frequency, both the left AND right columns light up and meet in the middle and proceed to end on the opposite ends. Did you change the code to produce this effect or would this indicate that I have an issue with my wiring or circuit setup?

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    That's very weird! There were a couple of changes made to the code a while back but nothing that should have caused that to happen. I haven't looked at this in a long time, but if I'll check tomorrow to see if there is a bug somewhere.

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    I just checked and it works fine for me, so it's possible that your matrix is wired end to end (all strips facing the same direction) rather than serpentine. I've updated the code on GitHub, download the new version and change #define SERPENTINE to false and see if that works for you.

  • @ryandhowell07

    @ryandhowell07

    3 жыл бұрын

    @@ScottMarley That's it! Problem solved, works great now! Thanks SOO much for helping out this noob with the updated code. I figured since you wired your LED's all in the same direction that the code would work with that configuration. So did you re-wire your LED's in a serpentine config? Thanks again, you saved me hours of headache.

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    @@ryandhowell07 Yes, at some point I rewired it to serpentine as it looks neater and it turned out that most examples assumed that layout. Sorry about that!

  • @Wellan_Qc
    @Wellan_QcАй бұрын

    Hey Scott. I know this is a massive shot in the dark but I've been having issues recreating your project because my ESP32 can apparently only read the analog pin at 14kHz. Could you share the exact board you are using or if maybe your ArduinoIDE setup is different if possible? Kinda scared to get into possible solutions like I2c. Great video by the way, got me into making stuff at home and not waiting for school projects to start being interesting.

  • @utkuserin9750
    @utkuserin97503 жыл бұрын

    I had not even knew the arduino can take fft of input signal, until I watched this video

  • @yoted
    @yoted2 жыл бұрын

    Turns out you can also have the ADC sample for you at a provided sample rate, and have it do DMA into buffers which you can then use I2S to read (and avoid spending the CPU time doing the sampling). I’ve been using this on my led strip audio visualizer that I’ve been working on, and it seems to be working great so far.

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    If you have an example of how to do that, that would be great. Sounds a little over my head tbh :)

  • @yoted

    @yoted

    2 жыл бұрын

    @@ScottMarley looks like youtube deleted my last comment that had links in it, so I'll instead give you a YT video ID of an I2S tutorial for the ESP32: ejyt-kWmys8 Also, check out the "HiFreq_ADC" example in the I2S folder of the esp32-arduino github for how to configure the internal ADC to give you data with I2S. I increased the buffer size and count from the values in that example to avoid wasting time repeatedly calling i2s_read for only a few samples each time.

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    @@yoted great, thank you!

  • @akthem84

    @akthem84

    Жыл бұрын

    Hey, I was wondering if you can share an example of how to do that, this would be really helpful.

  • @ehoworka

    @ehoworka

    Жыл бұрын

    I would love to see an example of this, sounds GREAT! Thank you.

  • @Smeatsbeats
    @Smeatsbeats Жыл бұрын

    Hello. Thank you for yet another fantastic video. I've used the suggested code to check the sampling rate of my ESP32 and I'm getting nowhere near what you are. Mine comes out closer to 11 kHz! I don't think I've made a typo in the code... I'm using pin 33 of my uPesy ESP32 Wroom DevKit board. Is there a faster pin, or is this a slow board? Any help would be much appreciated!

  • @puddleraker2598
    @puddleraker25982 ай бұрын

    Hi Scott, Yet another excellent video. Ive been attempting to use an MSGEQ7 to position a servo based on speech (anamatronic project) ; after looking at your work your ESP32 VU meter project, it would appear it might be a viable alternative to use ArduinoFFT. Im definitely in the 'novice' category when it comes to coding so would be grateful for some assistance. As Im only looking at male/female vocal frequencies, I don't require many bands. I also need to average these and map against the range of a servo. How easy is this to achieve?

  • @MarkAHunter
    @MarkAHunter2 жыл бұрын

    Skecth ran slowly, but now it flies... I had previously commented that, despite following along exactly and trying different board library versions, as suggested in comments, my esp32 ran like a 3 legged dog with asthma, uphill, with a heavy back pack on! However I spotted something (or was that, I missed something) and that was the pin being used in the sketch, pin 35... When I checked my datasheet, this was not listed on my esp32 as an audio pin so I simply changed it to a pin that was and bingo... The sketch now runs sub 9uS. :-) Now whether or not that should have made a difference could be one for debate, but it did solve my problem.

  • @sheonbanks2389
    @sheonbanks23892 жыл бұрын

    ...the reason I ask is it works yet I get several cycles of good data in the bands then it goes haywire fir a few cycles and then the good data comes back. This is constant. Is there some sort of interrupt in the code could be taking place or could it be timing? Any thoughts of what it could be? I am very new to this but I am a quick learner.

  • @PrabuKumarGP
    @PrabuKumarGP2 ай бұрын

    Hi Scott. Thanks for amazing video man. FFT on ESP32 wonderous. A quick question. I tried hooking up line in with a 3.5 audio socket, 2 10k res for mono, 100nf for DC filtering and 2 100k for DC biasing. But when I connect my iPod or phone output to this, I get no audio read in pin 35. I tried changing to 34 and 36 too. But there is nothing there. Do I need to use an analog amplifier when using with PC/Mobile/iPod headphone out? Thanks for the wonderful explanation about FFT and your code!

  • @yug_diy_designer
    @yug_diy_designer Жыл бұрын

    Génial !

  • @eduardodiasgoncalves2761
    @eduardodiasgoncalves2761 Жыл бұрын

    Hello, I would like some help with the following: I have a 7018b touch screen on which I made a boom box and I want to connect the audio output directly to the Arduino uno that will connect the lieds board 8x32 led RGB panel to the rhythm of the music without using the Sound Sensor. Where can I find the schematic and code? I used sp107e box and it doesn't work properly because the leds go up and down even without music.

  • @CharlesLGoodwin
    @CharlesLGoodwin3 жыл бұрын

    Hi Scott, You might want to add the line: #define BRIGHTNESS 200 to your ESP32_FFT_VU ino file just to give your fans a less bumpy ride :-)

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    Thanks for pointing that out! This was broken by a pull request that I merged, and don't spot this issue at the time. Should be fixed now, although I haven't tested the code. Cheers.

  • @matiasmartinduarte
    @matiasmartinduarte3 жыл бұрын

    Scott would it be possible to combine this project within a same matrix with the games matrix? Lets say i turn my matrix on and it is in "spectrum analyzer mode" and by pressing a button being able to change the mode to "just light patterns + games mode". Great projects thanks for sharing!

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    I've already done this, just haven't uploaded the code yet. I'm away in holiday currently so I might get around to it on my return!

  • @Enigma758
    @Enigma75825 күн бұрын

    Line/headphone input peak to peak voltage is around 2v, so aren't you losing some resolution with the 3.3v ADC?

  • @EnvoyOfFabulousness
    @EnvoyOfFabulousness2 жыл бұрын

    I'm curious which ESP32 you are using. The one I have is outputting an analog read time of 68uS and thus a max sampling frequency of around 14kHz.

  • @akthem84

    @akthem84

    Жыл бұрын

    As per one of the comments and responses below, in the boards manager of arduino IDE uninstall the esp32 board version you are currently having and install the 1.0.4 version. I was having the same issue and this fixed the issue for me! Maybe Espressif have to pay attention for this when they release the 1.0.7 update!

  • @TKleinschmidt
    @TKleinschmidt Жыл бұрын

    My nodemcu esp32 board only manages 18khz, which is very confusing ... Shouldnt those boards all be the same open source hardware? I reduced the sampling freq to 18khz for now, but results should be worse, i fear. Could you link boards that worked out well for you? i also came across the problem, that my sensitivity usually is way off. any ideas on how to automatically adjust it?

  • @IlIDINOIlI
    @IlIDINOIlI2 жыл бұрын

    Hi. Would it work if i make a matrix 8 bands/strips and 20 leds/band with ws2812b strips? Thx in advance

  • @sheonbanks2389
    @sheonbanks23892 жыл бұрын

    May I trouble you once again, I am testing the analyzer with frequencies < 20HZ. Will this code work without modifications?

  • @javilarg
    @javilarg10 ай бұрын

    Hi Scott, I saw your 3D printed spectrum analyzer (amazing project) that uses a INMP441 digital mic and I’m trying to adapt that code to this first version, because I prefer a physical control rather than depending on a smartphone, but my experience with C is limited, and I’m not able to find the exact part that manages the audio input. Could you please help me? TIA.

  • @Mark-th1gn
    @Mark-th1gn2 жыл бұрын

    Hello, thanks for the amazing video. I already had a DOIT ESP32 unit so i decided do make this. I am already quite far. I only have one issue and that is that my ESP32 has a conversion time of 52.17 uS, so a max sampling freq of 19166.64 Hz . I am still reading into the documentation in order to improve this. Do you have any leads?

  • @tofek321

    @tofek321

    2 жыл бұрын

    Someone responded to similar problem down below: "If you install the 1.0.4 version of the ESP32 board via the Boards manager and re-run the sample code it does give a result of 9.73uS."

  • @Mark-th1gn

    @Mark-th1gn

    2 жыл бұрын

    @@tofek321 It actually did the trick. Thanks for the reply.

  • @randomvideos6944
    @randomvideos69442 жыл бұрын

    Just used this code on a 25x15 ping pong ball display like @Bitluni made. One thing to note if you want more that 16 EQ bands you need to modify the array sizes of "peak[]", "oldBarHeights[]", and "bandValues[]" to match the band size (along with modifying the binning if statements)

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    Thanks for the advice to help others :)

  • @monapistauer3804
    @monapistauer38043 жыл бұрын

    Really great and helpful:) But I was wondering if you could tell me how you calculated the frequency multiplier and the center bin, because I can't find any information about that in the video and I'm new to FFT so this really would be helpful. Thank you:)

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    It's a bit difficult to explain in a comment here. Have a look at the Excel sheet on GitHub, and all the equations are in the appropriate cells. You can work backwards from whatever you're trying to figure out!

  • @monapistauer3804

    @monapistauer3804

    3 жыл бұрын

    @@ScottMarley oh, should have done that in the first place, kinda forgot. Thank you very much

  • @faramirchevlonski6152
    @faramirchevlonski61523 жыл бұрын

    amazing work. How can I represent the values in the serial poltter, or by matploit? and if I want to add more time in the samplng period, should I increase the frecuency?

  • @medb2322

    @medb2322

    2 жыл бұрын

    hello, how are you doing I have the same question did get the answer?

  • @faramirchevlonski6152

    @faramirchevlonski6152

    2 жыл бұрын

    @@medb2322 Hi guy. In the end I couldn't get an answer of what I was trying to question, but luckily I could resolve it my myself. I simply pass the data via UDP to a Python environment, and then I applied the Fourier transform with scipy library. This allows me to visualize the data with matplotlib, and have a better understanding of the information acquired. Did you understand?

  • @medb2322

    @medb2322

    2 жыл бұрын

    @@faramirchevlonski6152 hi bro, Nah i didn't understand could you please explain

  • @faramirchevlonski6152

    @faramirchevlonski6152

    2 жыл бұрын

    @@medb2322 Did you not understand because I don’t explain myself properly or because you are not familiar with this kind of concepts? If it’s the second case I suggest you to search about this, and try to find a solution that works in your specific case. The only thing I can do is to send you my repository where I put all the concepts that I explain you in the message before in practice

  • @PavolFilek
    @PavolFilek Жыл бұрын

    Nice

  • @aGGreSSiv
    @aGGreSSiv2 жыл бұрын

    Hello. I need your help with something. I enter the 5V supply from the adapter to the matrix panel, it is also connected to the 5v input of the microprocessor. it's already a simple circuit, after all, there is nothing but a panel and a microphone. When I energize everything works great. After a while, random LEDs start to light up in the animation. Then smoke comes out of the ESP32. what am i missing? Is the panel somehow drawing current from the microprocessor? What should I do to prevent this?

  • @shohjahonrazzoqov2125
    @shohjahonrazzoqov2125 Жыл бұрын

    hi scott, thanks for your great project, i'm trying it at the moment, but i'm having problems uploading code to esp32, it throws an error when compiling for esp32 dev module board. Can you help me please.

  • @exlpt2234
    @exlpt22342 ай бұрын

    How are you getting your ESP to sample that fast? Tested mine and the most I could get it up to is 11.36kHz. I read up about using the I2S peripheral and DMA but there's no mention of that here, and yet you can still get it up to >100kHz. Maybe it's the specific board you have?

  • @muratborazan8337
    @muratborazan8337 Жыл бұрын

    hello, I couldn't find instructions for turning the leds vertically and horizontally in the arduino code, can you help? Since I connected the leds vertically, a horizontal image was formed. how can i rotate

  • @JosephM101
    @JosephM1019 ай бұрын

    I would like to be able to use an FFT to decode AFSK on an ESP32 from a microphone, but the process is super sensitive to latency. Any suggestions?

  • @snoophogg8342
    @snoophogg83423 жыл бұрын

    I see since this video, you've changed the matrix "serpentine" unused and use the neomatrix library instead. So if my configuration of leds goes from bottom left going upwards, zigzag, when I edit the neomatrix setup with those in mind it should work without any other edits to the code right?

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    That should work, but I haven't tested it as I don't have lot's of different matrix arrangements to test with.

  • @snoophogg8342

    @snoophogg8342

    3 жыл бұрын

    @@ScottMarley i just got it working with my specs, the neomatrix makes it quite easy to manage. thanks for the guide!

  • @mtjmassiv
    @mtjmassiv3 жыл бұрын

    Scott - this is so good! I built my own using your instructions and an 8 x 32 matrix. Looks great :) One thing I'm finding is that if I power both the ESP32 and lights from 5V 10A female adaptor, the ESP32 reboots if current is too high (this is qualitative based on observing my brightness setting/no. of LEDs on display). If I power ESP32 separately via computer's 2A USB, I don't see this problem. Any clue what might be going on? Happy to share code / diagram if you're up for it :)

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    Sounds like exactly what you said, the LEDs are drawing too much power. At max load, your matrix could theoretically draw 8 X 32 X 60 mA = 15A. If your power supply is a cheap one (you know the eBay type) I wouldn't use it for more than half it's rated current (5A). Or just keep the brightness down, I don't use a birghtness of more than about 100 and that helps greatly.

  • @fabrizioalunnisolestizi434

    @fabrizioalunnisolestizi434

    2 жыл бұрын

    Ciao matt Jones, anche io ho una matrice 8 x 32 ma non riesco a farla funzionare nel verso corretto. Potresti inviarmi i tuoi codici? grazie

  • @babaksalami3616
    @babaksalami36162 ай бұрын

    Hello Scott, I used your code and made a spectrum analyzer and edited your code a little, which of course turned out to be very beautiful. I made this device in 24 bands and 18 pixels high. But the audio analysis speed is a little lower than your device... Is there a way to increase the speed? In addition, I tried a lot to create a peak pause, but unfortunately I haven't succeeded yet... Do you have a way to solve these issues? Thank you very much.. by the way I am new to coding!

  • @achrafoujjaker4806
    @achrafoujjaker48063 жыл бұрын

    Can you show me please how you get the Frequency multiplier per band and the low and the high bin that exist in the Excel

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    You need to complete everything in the green box on the Excel sheet and everything else is populated automatically. To see how I calculated these, look at the equations in the Excel sheet.

  • @androidtelefon
    @androidtelefon3 жыл бұрын

    Tell me on the MSGEQ7 microcircuit will it show the frequencies more accurately, or can you achieve the same effect using the Fourier transform in Arduino method as shown in yours?

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    The MSGEQ7 is great for low perfornamce micros such as the nano, uno etc. The advantage of an FFT is that you can specify the number of bands you want to look at, where your frequency cutoffs are etc. Presonally I would use an FFT on a higher performance micro like the ESP32 and a MSGEQ7 on something slow like a nano.

  • @androidtelefon

    @androidtelefon

    3 жыл бұрын

    @@ScottMarley It turns out that on your ESP32 the frequency reproduction quality will be the same as on the MSGEQ7 chip? I would like to create a better quality playback, your video displays everything in a very high quality. So I'm thinking of doing it like you do or on the MSGEQ7 microcircuit. Ideally, you want to make a project like this, so that the colors change. kzread.info/dash/bejne/nIilrciBoaWXcrQ.html&ab_channel=PLATINUM

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    @@androidtelefon I don't know, I've only really done it using the ESP. Doing it this way worked well enough for me.

  • @androidtelefon

    @androidtelefon

    3 жыл бұрын

    @@ScottMarley I also really liked your project, thank you for your answers, I'll try to do it.

  • @souravdas6530
    @souravdas65302 жыл бұрын

    Hello sir please help How to add (EEPROM memory) for last pattern save option to the software. I don't know anything about coding it possible kindly help me please

  • @knalsgtes6684
    @knalsgtes66842 жыл бұрын

    Hi sir,would like to ask if the led you are using was created manually using ws2812 led strip or not? Thanks.

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    This one was made with LED strip. See here for more info kzread.info/dash/bejne/kWSVm6yTfKrbZLA.html, although before I made this video (the vu meter) I rewired it so that data went in a zig zag rather than always in one direction

  • @awrhodes1
    @awrhodes12 жыл бұрын

    Great video... I'm still just getting my feet wet with Arduino IDE and ESP32 programming. I've made a few matrices but I have one in mind specifically for use as a spectrum analyzer/VU meter which would be integrated into another project, but if I follow along with this code and tutorial I believe my display will be skewed 90 degrees from how I'd like it to display. It would be a 12x12 matrix in terms of pixels, but the horizontal and vertical spacing wouldn't be equal (overall dimensions approx 10"x32". Specifically it'd be 12 strips of 12 60/m WS2812b's (so about 7" in length) spaced about 2.5" apart, and I'd want to view it horizontally. I believe if I wired it as you have, it would produce 12 3' tall bands vertically. Do you know if there Is there a way to modify the code to essentially shift what is being displayed 90°?

  • @ScottMarley

    @ScottMarley

    2 жыл бұрын

    The code is written using the neomatrix library making it possible to use on any wiring direction and in any orientation. See learn.adafruit.com/adafruit-neopixel-uberguide/neomatrix-library for how to set it up.

  • @acquireelectricity1458
    @acquireelectricity14582 жыл бұрын

    Hi, is there any way of increasing the speed of esp32? I have ESP32 devkit microcontroller, and this project on mine seems slower than yours (I can notice latency)

  • @fragiggle

    @fragiggle

    Жыл бұрын

    It has to do with analogread. It takes forever. I had to adjust parameters of it to get a raw value, it's less accurate, but the speedup is huge. Or get a serial interface adc and implement that. The speedup there would be massive and only limited by fft times.

  • @yusuf120581LED
    @yusuf120581LED4 жыл бұрын

    Cool

  • @XPS805
    @XPS805 Жыл бұрын

    Hello everyone. i got a question and hopefully someone can help me :) i wired up my ESP32 (Dev KitC V2 ESP32-WROOM-32) Line in version as you can see @10:48 and dont know what i got to set in the WLED app to make it respond to the sound

  • @prestondraper513
    @prestondraper513 Жыл бұрын

    Can you also use a MAX9814? I'm thinking the auto gain could be nice for adapting to volume? I'm making a similar project, it'll actually be a sound reactive infinity cube inspired by one of your other videos. Hopefully it turns out.

  • @ScottMarley

    @ScottMarley

    Жыл бұрын

    Yeah, I dont see why not. I think I've used that before for something. These days I tend to just use digital mics like the INMP441. Much more complicated to set up, bit much better audio quality.

  • @prestondraper513

    @prestondraper513

    Жыл бұрын

    @@ScottMarley Cool, thanks! Can't believe how fast you responded too!

  • @NavodKiriwaththuduwa
    @NavodKiriwaththuduwa3 жыл бұрын

    Heyy, I'm doing a project for detecting high frequency. Were you able to find a method to detect higher frequencies? What is the maximum frequency that we can detect using Arduino?

  • @hagoopeeshoo123

    @hagoopeeshoo123

    3 жыл бұрын

    The way the ADC is set, the sampling rate is about 9 KHz, but there are ways to take that up to to roughly 75 KHz found here: www.optiloading.be/willem/Arduino/speeding.pdf , meaning you should be able to detect frequencies up to 35 KHz. I have no idea about the resolution/accuracy though.

  • @FrankIha
    @FrankIha3 жыл бұрын

    Good job. Is it possible to change the code to use a led strip ws2812b instead of the matrix? I would like to cut the led strip in 8 parts with 30 led and create 8 channels, the first being starting at led 0 to 30 for "center bin 2", from led 31 to 60 for "center bin 4", led 61 to 90 for "center bin 9" ..... It's possible? sorry for my English.

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    Yes, that will work fine. Just wire the strips up from one to the next and edit the xy code for however yours is wired up. Mine is simply 16 strips of 16 LEDs wired from one to the next. You will need to understand how the xy code works to make the changes yourself.

  • @FrankIha

    @FrankIha

    3 жыл бұрын

    @@ScottMarley For me it is impossible to change the code, I did not understand the code. Scott Marley could you send me the changes? thank you.

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    I'm afraid not, I don't have the time. Spend some time learning how this all works and you'll be able to create your own amazing things!

  • @phillipzx3754
    @phillipzx37542 жыл бұрын

    " It can have any number of bands" Does the ESP32 have the muscle to support 31 bands? Not that it's needed (I have a 128 band RTA) but the eye-candy would be fantastic.

  • @quyet1176
    @quyet11763 жыл бұрын

    so i've tried this and it works so far. I also tried to split the line in so that I can plug in my headphone but then it stopped working for some reasons. Could it be the voltage drop after splitting?

  • @ScottMarley

    @ScottMarley

    3 жыл бұрын

    This seems to work with some inputs and not others. I believe it is to do with the impedence of the things that are plugged into it, causing a voltage drop as you say. The 'proper' way to do this would be to use an opamp as a buffer between the connected devices (as they have very high input impedance), but was a bit complicated to show in this video.

  • @snoophogg8342

    @snoophogg8342

    3 жыл бұрын

    Adding on to this, if I slap a buffer/voltage follower with an ne5532 right before the esp32 input pin, that should work a treat for this problem right?

Келесі