0
\$\begingroup\$

I want to build a 7 Rows x 15 Columns keyboard from scratch, thus I have started from the theoretical design of the matrix. The classic way should be to assign directly the Rows and Columns to (7+15) I/O of a microcontroller and also connect 7X15 diodes to every each switch in order to prevent the "ghost" effect.

Yet, I redesigned a matrix using multiplexers - demultiplexers as follows:

enter image description here

Just to keep it simple, let's say that I have a 8x4 matrix, the columns connected to a demultiplexer and the rows connected to a multiplexer. That should work with the pseudocode:

for each output of the demux:
 for each input of the mux:
 check if a individual button has been pressed, else \\
 send HIGH due to pull up resistors

Since in every each loop only one switch can be inspected and there is not any physical connection to other switches, I think I could prevent the "ghost effect" without the need for any diode component.

Also, for a 15x7 matrix, instead of using (15+7) pins, I could use a 16:4 demux and a 8:3 mux, thus only 4+3 = 7 pins.

Please, tell me your opinion, or point any flaws of the design.

asked Nov 28, 2019 at 11:27
\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

There is still a ghost effect.

Let's say that the user has pressed R4C9, R4C10 and R3C10. When C9 is energized by the demultiplexer, current can flow onto line R4 via R4C9, then line C10 via R4C10, then line R3 via R3C10. The R3 line will be energized. When you energize C9 and check R3, you will see the signal present that means the key is pressed, even though the key is not pressed.

There's no problem with using multiplexers instead of separate I/O pins. It might affect how quickly you can scan all the keys.

answered Nov 28, 2019 at 12:19
\$\endgroup\$
3
  • \$\begingroup\$ Yes, you are absolutely right. Yet, I wonder if connecting all columns to pull down resistors could prevent the ghost effect because any exceed current flow would be drained to Ground instead of recirculating to other rows. Your opinion would be appreciated. \$\endgroup\$ Commented Nov 28, 2019 at 13:14
  • \$\begingroup\$ @user3060854 the resistor for each line will also pull down the other connected ones \$\endgroup\$ Commented Nov 28, 2019 at 13:30
  • \$\begingroup\$ ghost effects are avoided with diodes, not pull down \$\endgroup\$ Commented May 5, 2021 at 7:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.