Shift registers for switch matrix and LED matrix

I reverse engineered the PCB of a cheap mechanical full-size keyboard so that I can interface it with an ESP32-S3 but I don't have enough GPIOs for both matrices.

The matrices share the column pins.
The switch matrix is wired in 21 columns and 6 rows.
The LED matrix is wired in 22 columns and 6 rows (there is an extra column for the status LEDs) (rows = anode, columns = cathode).
The transistors on the LED matrix are all 2TY for the columns and for the rows (1 = Base, 2 = Emitter, 3 = Collector).

Which type of shift registers do I need for the switch matrix, and which type for the LED matrix? According to this website it seems that I should use the HC164 for the switches and the HC595 for the LEDs, is this correct?

Parallel to serial? All I know is 74HC165...

I bought a triple TM74HC595 module for this project, but I have multiple doubts about how to wire it to the keyboard's matrices.

  • Can the columns be wired to the output pins of the 74HC595? (rows directly to MCU)
  • If I use 5V for powering the LEDs, will it be safe to use a 3.3V microcontroller?

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