Close

Keyboard Matrix Scanning

A project log for 2020 HDP Dream Team: UCPLA

The 2020 HDP Dream Teams are participating in a two month engineering sprint to address their nonprofit partner. Follow their journey here.

rubenfixitRubenFixit 08/06/2020 at 18:091 Comment

Early in my college years I came across this very useful and web based animated circuit simulator, falstad.com/circuit. Since I'm a hands on and visual learner, this tool really helped me grasp the behavior of electronic and logic circuits.

While I was working on the firmware for our concept prototype keyboard, I thought it would be fun to create an animation of how keyboard matrix scanning works.

Click on the image or here to visit falstad.com/circuit and try it out for yourself.

As you can see the micro-controller drives the rows low one at a time and reads the columns as inputs. If both the row and the column are low, then a key-press is detected.

This allows us to read key presses without needing a single input for every single key! In this example we are able to detect key presses for 15 keys with only 8 GPIO pins. Almost all keyboards or TV remote controls follow the same principle.

You can also check out our Arduino code for the keyboard test-kit at the Github project.

Discussions

Ken Yap wrote 08/06/2020 at 22:25 point

Nice work!

  Are you sure? yes | no