Author Topic: Key matrix schematic, is this right?  (Read 1820 times)

0 Members and 1 Guest are viewing this topic.

Offline blazini36Topic starter

  • Regular Contributor
  • *
  • Posts: 65
  • Country: us
Key matrix schematic, is this right?
« on: January 08, 2024, 01:46:27 pm »
So I'm working on something and I have to use a matrix to save IO pins on a 32 key panel. Never did one of these but it seems fairly straight forward. Gets a tad more complicated because the buttons I'm using have LEDs and they have to be multiplexed as well. Luckily the Arduino project that this is targeting has this feature. I'm a little foggy on how it's supposed to work but I whipped up a schematic.
https://github.com/AlexmagToast/LinuxCNC_ArduinoConnector/tree/main#matrix-keyboard

The LED mux feature of that project was based on a schematic of a Chinese CNC control panel posted in a forum. I'm posting that picture as well. Just looking for confirmation that I'm doing this right (or wrong)
« Last Edit: January 08, 2024, 01:49:44 pm by blazini36 »
 

Offline Clear as mud

  • Regular Contributor
  • *
  • Posts: 207
  • Country: us
    • Pax Electronics
Re: Key matrix schematic, is this right?
« Reply #1 on: January 09, 2024, 03:49:31 pm »
That github page looks like it was written by AI.  I'm not going to muddle through all of it, because it looks like very little actual thought was put into it.  If that's what you're using as a reference to create your design, see if there's something else you can use instead.

The .pdf of the schematic looks OK, but you may want to completely separate your LED lines from the keypress ones.  The column outputs are shared, with both the keys and the LED negative sides connected to them.  That may give unexpected behavior, unless you have thought carefully about that and you're sure it will still work the way you want.
 

Offline blazini36Topic starter

  • Regular Contributor
  • *
  • Posts: 65
  • Country: us
Re: Key matrix schematic, is this right?
« Reply #2 on: January 16, 2024, 05:53:35 pm »
Didn't realize there was a reply.....

Lol it's not written by AI, the guy has videos explaining the project and he's made posts in the LinuxCNC forum. No idea what the issue with the github page is, it looks fine to me....at least he took the effort for something open source.

There's nothing else to use, it's targeted at communication with LinuxCNC, it's not general Arduino firmware.

The LED cathode lines being shared with the key column lines is specifically the point, it's meant to save IO lines (16 vs 64). There was some discussion about this on the LinuxCNC forum with the author and someone did get it to work with an OEM keypanel shown in that paper schematic I posted but it's largely untested, even by the author as he didn't have the hardware to test. The author's gone quiet or I'd ask him about it. I'm making my own LED/keypanel so I can make whatever changes are necessary. I'm just not totally familiar with the concept of this type of matrix/mux so I figured this the best place to ask.
 

Offline selcuk

  • Regular Contributor
  • *
  • Posts: 116
  • Country: tr
Re: Key matrix schematic, is this right?
« Reply #3 on: January 17, 2024, 06:54:33 pm »
If you are simply going to turn on a led when the related button is pressed, you don't need to connect the leds to the MCU. A button press can turn on led and output a signal to the MCU at the same time.
 

Offline blazini36Topic starter

  • Regular Contributor
  • *
  • Posts: 65
  • Country: us
Re: Key matrix schematic, is this right?
« Reply #4 on: January 19, 2024, 12:27:18 am »
Well that's obviously true but that's I wouldn't be using the mux feature to do that. These are all momentary buttons so just lighting up while the button is pressed doesn't serve any purpose. The LEDs are to show the state of the function that the button is controlling. That's fed back through the firmware. I'm working on the accompanying PCB now, so I'll find out one way or the other.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf