3
\$\begingroup\$

I am building 3D printed keyboard. I am probably going to use some off-brand cherry MX switches (probably outemu switches). Since mechanical keys simply allow current when pressed in, I do not need a resistor to protect the key switch.

So my question is “do I need a resistor for a keyboard key switch?”

Edit. So I am going to put it on a “keyboard matrix” that looks like the picture given (hopefully it was given. I don’t know how pictures work on the app)enter image description here

And each output from the matrix will go into the input on an arduino.

I think I got my answer, dim. The switch itself doesn’t need a resistor. But the Arduino might. Thanks all who had input. Much appreciated

\$\endgroup\$
  • \$\begingroup\$ Depends on where you are going to connect it... \$\endgroup\$ – Eugene Sh. Mar 1 '18 at 20:35
  • 2
    \$\begingroup\$ You are building your own keyboard, but you don't know how to wire a switch? How do you plan on making the rest of the circuit!? The answer to your question is that it would depend on (the rest of the circuit)...Which you haven't explained to us. \$\endgroup\$ – Bort Mar 1 '18 at 20:35
  • \$\begingroup\$ Um... I’m still planning out the layout...but it will be in a “keyboard matrix”... I guess to answer your question, it will be between power and an input on a micro controller \$\endgroup\$ – Zeno Mar 1 '18 at 20:38
  • \$\begingroup\$ "Since mechanical keys simply allow current when pressed in..." What do non-mechanical keys do? \$\endgroup\$ – Bort Mar 1 '18 at 20:38
  • 1
    \$\begingroup\$ Inputs on microcontrollers are almost certainly going to be high-impedance/resistance. If the received voltage is in-range, you won't need a resister. The switch itself should be able to handle the current without issue. I don't have much else to go on until you add more details. \$\endgroup\$ – Bort Mar 1 '18 at 20:44
5
\$\begingroup\$

You need resistors to protect the outputs of the keyboard controller, at least.

If you scan rows and read columns, then pressing two keys in the same column at the same time will connect two row outputs, while one is high and the other is low, leading to a short. So the bare minimum are current limiting resistors in the row lines, around 10k should be sufficient.

However, if you press two keys in the same column, the column line will then be driven to half the supply voltage, and you cannot get a clear reading then.

If you instead add one diode per key and a weak pulldown for each of the columns, you can build the matrix so that the column readback will capture the true state of each key, even if multiple keys are pressed at the same time. This is a bit more expensive, but definitely worth it if you ever want to use your keyboard for gaming.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.