How to DIY 32 band LED Audio Music Spectrum Analyzer | Arduino based DIY project 2022

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

КОМЕНТАРІ • 17

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

    I'm not sure how it called "32-Band Spectrum Analyzer"? The most is 8. Am I missing something?

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

      same thing here, did you find a way to do so?

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

    Amazing video good informated

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

    Hey! nice work, I was wondering how can I do the same thing but 8x32 ? no clue

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

    I have connected everything appropriately but my 8x8 matrix seems to be stagnant. Please what have I done wrong?

  • @SC.243k
    @SC.243k 2 роки тому +2

    Very professional work, Thanks my friend, Big liked+sub 👍💙💙

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

    Good work bro

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

    Nice brother

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

    Nice bro

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

    Can you please create a code without 8x8 matrix driver

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

    hi why my project show
    ''compilation terminated.
    exit status 1
    LedControl.h: No such file or directory
    ''
    what that mean? and how can i fix it?

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

    Bro, I am not able to open the file so would you mind copy pasting the code? Thanks.

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

      Brother, tell me what I can do for you

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

      @@electrodoctorofficial I am not able to open the google drive for the code so can you copy paste it here?

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

      @@rishijain2228
      #include "LedControl.h"
      /* Led matrix - Max7219 Declared */
      LedControl lc = LedControl(12, 10, 11, 1);
      const int maxScale = 11;
      /* Sensor - Max9812 Declared */
      const int sensorPin = A4;
      const int sampleWindow = 50; // 50ms = 20Hz
      unsigned int sample;
      unsigned long startMillis;
      unsigned long timeCycle;
      unsigned int signalMax = 0;
      unsigned int signalMin = 1024;
      unsigned char index = 0;
      unsigned int peakToPeak[8];
      unsigned int displayPeak[8];
      unsigned int temp[8]={0,0,0,0,0,0,0,0};
      unsigned int signalMaxBuff[8];
      unsigned int signalMinBuff[8];
      void setup() {
      // Led matrix
      lc.shutdown(0, false); // bật hiện thị
      lc.setIntensity(0, 1); // chỉnh độ sáng
      lc.clearDisplay(0); // tắt tất cả led
      Serial.begin(9600);
      }
      void loop() {
      startMillis = millis();
      //peakToPeak = 0;
      signalMax = 0;
      signalMin = 1024;

      // Get data in 50ms
      while (millis() - startMillis < sampleWindow) {
      sample = analogRead(sensorPin);

      if (sample < 1024) {
      if (sample > signalMax) {
      signalMax = sample;
      }
      if (sample < signalMin) {
      signalMin = sample;
      }
      }
      // 20Hz - 64Hz - 125Hz - 250Hz - 500Hz - 1kHz (timeCycle = 1/F)(ms)
      timeCycle = millis() - startMillis;
      if (timeCycle == 1 || timeCycle == 2 || timeCycle == 4 || timeCycle == 8
      || timeCycle == 16 || timeCycle == 32 || timeCycle == 40 || timeCycle == 50) {
      signalMaxBuff[index] = signalMax;
      signalMinBuff[index] = signalMin;
      index = (index + 1) % 8;
      delay(1);
      //Serial.println(timeCycle);
      }
      }
      // Delete pointer to array
      index = 0;
      // Calculation after get samples
      for (int i = 0; i < 8; i++) { // i = row (led matrix)
      // sound level
      peakToPeak[i] = signalMaxBuff[i] - signalMinBuff[i];

      // Map 1v p-p level to the max scale of the display
      displayPeak[i] = map(peakToPeak[i], 0, 1023, 0, maxScale);
      // Show to led matrix
      displayLed(displayPeak[i], i);

      // Led drop down
      if (displayPeak[i] >= temp[i]) {
      temp[i] = displayPeak[i];
      }
      else {
      temp[i]--;
      }

      lc.setLed(0, i, temp[i], true);
      delayMicroseconds(250);
      }

      }
      void displayLed(int displayPeak, int row) {
      switch (displayPeak) {
      case 0 : lc.setRow(0, row, 0x80); break;
      case 1 : lc.setRow(0, row, 0xC0); break;
      case 2 : lc.setRow(0, row, 0xE0); break;
      case 3 : lc.setRow(0, row, 0xF0); break;
      case 4 : lc.setRow(0, row, 0xF8); break;
      case 5 : lc.setRow(0, row, 0xFC); break;
      case 6 : lc.setRow(0, row, 0xFE); break;
      case 7 : lc.setRow(0, row, 0xFF); break;
      }
      }