Electronic – arduino – Unusual behavior when controlling a Button Matrix

arduinobuttonmatrixpulldownpullup

I have a 4×4 matrix for 16 buttons. Each row/column is directly connected to the pins of an unknown microcontroller. When I connect the pins directly to each other, the microcontroller behaves correctly, as if the respective button was pressed.

I want to control the pins directly with an Arduino or connect them directly to GND/VCC. However, when I turn them on this way, the microcontroller either:

  • does nothing
  • behaves as if several buttons are pressed at once.

Why is that? Am I missing something, like pullup-resistors?

The microcontroller supports certain button presses at the same time. I think it has to do with the row scanning. <- This turned out to be true, the microcontroller checked one row at the time. So it was necessary to activate the column pin only when the right row was selected.

Best Answer

The question is: how are you "controlling" the wires using an arduino? The microcontroller is probably pulling the rows (or columns) up (or down) one at a time, an then checking the voltage on the other axis to detect button presses in that row/column.

To emulate this using an arduino, you would have to monitor the energized axis, and then output to the sensing axis in a synchronized fashion. Depending on how the unknown microcontroller is programmed, this may be very difficult, because it could read very soon after energizing. Perhaps too fast for your arduino to react.

It's also worth noting that other arrangements exist besides row/column. Are you sure this is how the keypad is arranged?