Maker Pro
Maker Pro

Spectrum analyser Equalizer project how to go about it?

danadak

Feb 19, 2021
782
Joined
Feb 19, 2021
Messages
782
From main menu "Community", then

1693647866876.png

Then "Forums", "Microcontrollers", "PSOC 5, # & 1", "Ask the Community"

The Kicad questions, I am not a user, others will comment.
 

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
Okay found it and have posted there danadak, do you use spice?
 

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
So what are the cheapest CY8CKIT-050 and CYBCKIT-059 chips that you can find because last time you guys pointed me to cheaper alternatives to the LED's that I wanted, and I was wondering if you could do that again?
 

danadak

Feb 19, 2021
782
Joined
Feb 19, 2021
Messages
782
So what are the cheapest CY8CKIT-050 and CYBCKIT-059 chips that you can find because last time you guys pointed me to cheaper alternatives to the LED's that I wanted, and I was wondering if you could do that again?
Use Digikey and look at PSOC 5LP family chip pricing.
 

danadak

Feb 19, 2021
782
Joined
Feb 19, 2021
Messages
782
I just got notified Freesoc2 board still available, it has the I/O also
you may need. check it against the 050 board. Note its an obsolete
board, but not the PSOC on it. I believe you can still get the gerbers for
this board on GitHub, in case you needed more at a later time, check
this out.





Regards, Dana.
 

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
I think I want to take this route!

If you're considering using the 74LS95 (often just referenced as 7495), it's a 4-bit parallel-access shift register. It can be used to expand the number of outputs like the 74HC595, but with some differences in capabilities and setup. When paired with multiplexing, this can be a method to drive a large matrix of LEDs.

Let's delve into the idea of using the 7495 shift register combined with multiplexing for controlling a matrix of LEDs:

1. 7495 Shift Register:​

  • Inputs:
    • Four data inputs (A, B, C, D)
    • Shift/Load Control input
    • Clock input
    • Clock inhibit (to disable shifting)
  • Outputs:
    • Four parallel outputs (QA, QB, QC, QD)
    • One serial output (QS, which is QD shifted out)

2. Setting Up 7495 for LED Matrix:​

  • To control a column of LEDs, use the parallel outputs (QA, QB, QC, QD).
  • Daisy-chain multiple 7495s by connecting the QS (serial out) of one to the A (or any other data input) of the next, allowing you to shift data through multiple registers.

3. Multiplexing:​

Instead of controlling every LED individually, multiplexing allows you to control rows or columns of LEDs by rapidly switching between them:

  • Say, for a 25x20 LED matrix, you'd consider 25 columns and 20 rows.
  • For columns, you'd need seven 7495s (since 7 * 4 outputs = 28, which covers 25 columns).
  • For rows, you'd need five 7495s (since 5 * 4 outputs = 20, which covers all rows).

4. Driving the Matrix:​

  • To light up a specific LED, you'd set the appropriate column to HIGH (or source current) and the corresponding row to LOW (or sink current). All other rows would be set HIGH to ensure they don't sink current from other columns.

5. Rapid Scanning:​

  • In practice, you'd rapidly scan through the rows, one at a time, setting the columns for each row appropriately. This rapid scanning happens faster than the human eye can perceive, so it appears as though multiple LEDs are lit simultaneously, even though only one row is active at a time.

6. Software Control:​

  • Use the ESP32 (or another microcontroller) to shift the right patterns into the shift registers to control which LEDs are on or off.
  • For every cycle:
    • Shift out the data for a row and the corresponding columns.
    • Activate the row.
    • Pause briefly (e.g., 1ms).
    • Move to the next row.

Notes & Tips:​

  1. Current Limiting: Always use current-limiting resistors with LEDs.
  2. Driving Capability: Check the driving/sinking capability of the 7495. You might need transistors to handle the LED current, especially if multiple LEDs in a column are on simultaneously.
  3. Ghosting: Rapid multiplexing can sometimes result in ghosting (unintended LEDs showing faint light). Ensure you're switching rows off before moving to the next.
  4. Refresh Rate: The entire matrix should be refreshed at a rate of at least 60Hz (scanning all rows 60 times per second) to avoid visible flickering.
  5. Power Consumption: Multiplexing can reduce average power consumption since only one row of LEDs is on at any given time.
  6. Alternative Chips: If 7495 isn't readily available, consider other shift registers like the 74HC595 or other suitable alternatives.
The combination of shift registers (like the 7495) and multiplexing provides an effective way to drive large LED matrices with fewer microcontroller pins, though it requires careful design and software control to achieve smooth and consistent visual results.

can you explain it in more detail, if you can? I now want 25 columns and 20 rows utilising 500 LED's and I want 3 decibel to light each led in a column
 

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
I think this method is more pactical for me I need it explaining though so the actual name for the 7459 is 74HC595 and it's a shift reigister I want to know how to utilise 7 of them 4 for the x axis 25 bands and 3 for the y axis 20 for a total of 500 LED's so there will be 7 74HC595 chips. I know I have changed it again but I want to make use of the full 500 LED's and I want to incorpoate it with the esp32 arduino!
 
Last edited:

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
I think this method is more pactical for me I need it explaining though so the actual name for the 7459 is 74HC595 and it's a shift reigister I want to know how to utilise 6 of them, 3 for the x axis 24 bands and 3 for the y axis 20 for a total of 480 LED's so there will be 6 74HC595 chips. I know I have changed it again but I want to make use of the full 500 LED's and I want to incorpoate it with the esp32 arduino! and shift regiters and decade counters
 
Last edited:

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
I am going to have a esp32 nano. I want to build a Led matrix of 480 leds 24bands/columns/channels and 20 in each row. I will be using 74HC595's, 3 for the columns (thats 24) and 3 for the rows (24 but i'm using 20) there are 20 rows the columns are updated each 60hz so across the set of 24 there will be 1440 pulses of the column cycling frequency and updating the amplitude (how many led's it lights in the y direction) and each bar is represented by 3 decibals. 25 times per second for each band. I am using two RCA jacks (white and red) I do not want arduino code at this point . are you following so far. Frequency Band Analysis: This could be done using an FFT I need to calculate the amplitude of each band I want the bands on the left to be low and basey 32hz and the high pitch to be 16khz
 

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
building an LED spectrum visualizer using a LED matrix. You want to use 74HC595 shift registers to manage the rows and columns, and the data should correspond to frequency bands extracted from an audio signal. Let's break it down step-by-step:

  1. LED Matrix Setup:
    • Your matrix consists of 24 columns and 20 rows, totaling 480 LEDs.
    • 3 daisy-chained 74HC595s will control columns and another 3 will control rows.
  2. 74HC595 Control:
    • The shift registers will be connected in series, with the Q7S (serial out) of one connected to the DS (serial in) of the next.
    • Columns: Each bit in a shift register will control one column. For this, you'd use transistors as switches for each column since the 74HC595 cannot source/sink enough current for multiple LEDs.
    • Rows: Similarly, each bit in the row's shift registers will control one row. Depending on the common type of your LEDs (common cathode or common anode), the rows might be sourcing or sinking current.
  3. Frequency Band Analysis:
    • You'll need to perform a Fast Fourier Transform (FFT) on your audio signal to extract the amplitudes of various frequency bands.
    • Your interest lies in the bands from 32Hz to 16kHz. This will likely involve averaging or summing groups of frequency bins from the FFT to get the desired bands.
  4. Sampling Audio:
    • Using the ADC pin on the ESP32, you'll sample the audio signal. If you're using an RCA jack, you need a simple resistor divider or operational amplifier circuit to step down the audio line level to the range readable by the ESP32's ADC (0-3.3V). Also, make sure the input signal is biased around 1.65V (half of 3.3V) since audio is AC, and the ESP32 can't read negative voltages.
    • Pink noise is equal power in bands that are an octave wide. It has more low-frequency components than white noise. If you use pink noise, it can give a more uniform response across your bands, useful for testing.
  5. Potentiometer for Gain Control:
    • Incorporate a potentiometer to allow adjustment of the ADC input's sensitivity. This can help visualize quieter audio sources. It acts as a gain control, making quieter signals appear louder on the matrix.
  6. Timing:
    • Columns are updated 60 times a second for each, resulting in 1440 updates across all 24 columns every second.
    • For the rows, the amplitude data updates 25 times a second for each band, meaning every 40ms. But with your latest specification, you need the amplitude data to update synchronously with the column, 1440 times a second, or roughly every 0.694ms.
  7. Visualization Mechanics:
    • For each column update (which happens very rapidly):
      1. Turn off the previous column.
      2. Load the next column's bit into the column shift register and the corresponding amplitude data into the row shift register.
      3. Turn on the current column's LEDs based on the amplitude data.
    • The process repeats for all columns in a continuous cycle.
Given the high update rate required, the ESP32's dual-core functionality can come in handy, allowing simultaneous processing of audio data on one core while managing LED updates on the other.

However, a word of caution: Depending on the FFT library's efficiency and the chosen FFT size, achieving real-time frequency analysis at such high update rates might be computationally intense for the ESP32. Optimization and efficient coding practices will be crucial.



Can I update the amplitudes with the FFTlibrary fast enouth to get a sample within 0.694ms
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,758
Joined
Nov 17, 2011
Messages
13,758
Can I update the amplitudes with the FFTlibrary fast enouth to get a sample within 0.694ms
I don't know. Run a test to find out.

But why such a fast update rate? Given that the human eye can accept 25 frames per second as video, an update rate of 40 ms (1/25 second) should be good enough for a visually pleasing display. If that's not good enough for you, how about 20 ms? Twice as fast and much faster than your eyes can follow.
 

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
ok so the thing i was looking at says that each of the columns need to be flashed at 60 hz and 1 columb is on one at a time ther're 24 columns so that equal 1440 pulses in a second but if you're say that the update rate of each led in the columns need to only be 25hz then that equal 600 pulses per second (going through the 24 columns)
 
Last edited:

Maglatron

Jul 12, 2023
1,501
Joined
Jul 12, 2023
Messages
1,501
the problem I have is that when each column is is on I need the rows to correspond to the column that is on for example if column 17 is on and the decibels (amplitude) is say 12 decibel (3 decibels per led upward) 4 leds on then when it clicks over to 18 that might have only 9 decibels lighting 3 leds how do you keep the amplitude updates in time with the columns going across, hope this is not too complicated but I'm trying to explain the best I can I want the amplitude of the correct frequency at a time only
 
Top