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:
- Current Limiting: Always use current-limiting resistors with LEDs.
- 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.
- Ghosting: Rapid multiplexing can sometimes result in ghosting (unintended LEDs showing faint light). Ensure you're switching rows off before moving to the next.
- 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.
- Power Consumption: Multiplexing can reduce average power consumption since only one row of LEDs is on at any given time.
- 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