MUSIC VISUALIZER USING 32x8 LED DOT MATRIX DISPLAY

Hi friends,

I am trying to implement a music visualizer using Arduino UNO and MAX7219 matrix. But the matrix displays music for few seconds and then it stops working.

Please help.

I used the below video as reference.

I connected A0 pin of sound sensor to A3 of Arduino.

The code i used is below.

#include <arduinoFFT.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

MD_MAX72XX disp = MD_MAX72XX(MD_MAX72XX::FC16_HW, 10, 4);

arduinoFFT FFT = arduinoFFT();

double realComponent[64];
double imagComponent[64];
int spectralHeight[] = {0b00000000, 0b10000000, 0b11000000,

                    0b11100000, 0b11110000, 0b11111000,


                    0b11111100, 0b11111110, 0b11111111
                   };

int index, c, value;

void setup()

{

disp.begin();

Serial.begin(9600);

}

void loop()

{

int sensitivity = map(analogRead(A3), 0, 1023, 50, 100);
Serial.println (analogRead(A3));
for (int i = 0; i < 64; i++)

{

realComponent[i] = analogRead(A3) / sensitivity;
imagComponent[i] = 0;

}

FFT.Windowing(realComponent, 64, FFT_WIN_TYP_HAMMING, FFT_FORWARD);
FFT.Compute(realComponent, imagComponent, 64, FFT_FORWARD);
FFT.ComplexToMagnitude(realComponent, imagComponent, 64);

for (int i = 0; i < 32; i++)

{

realComponent[i] = constrain(realComponent[i], 0, 80);
realComponent[i] = map(realComponent[i], 0, 80, 0, 8);
index = realComponent[i];
value = spectralHeight[index];

c = 31 - i;
disp.setColumn(c, value);

}

}

First, please fix your code above. You should use code tags. Read the forum guide in the sticky posts to find out how to do that and other important things.

The forum section you posted in says "feel free to talk about anything" but it's not the best place for technical/programming questions. I will move your topic to a part of the forum where you will get better answers.

What do you see on serial monitor, while the display is working and after it stops working?

Thank you so much. Am actually new to Arduino and still learning.

I can see the waves of the music on the RGB matrix. It plays for few seconds and then no display.

Do you know what the serial monitor is?

If not, I suggest you take some Arduino tutorials and come back to your project later.

An RGB matrix is not an LED matrix. Each element in an RGB matrix has three LEDs and an IC for individual addressing each "pixel" color and brightness.

This is an LED matrix. LEDs are on or off. Your code indicates using this.

How are you powering the LED matrix?

My guess is that your power supply can't supply the necessary current and something is "glitching" or shutting down.

I am powering through USB only.


This is the display on serial monitor and these numbers are working like a loop.

The serial monitor displays 0 even i powered the Arduino. The LED matrix works only if the program is compiled and that even too for few seconds.

Thankyou so much.. I learned what is a serial monitor!!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.