Working of keyboard in a nutshell

In general, there are number of keyboard architectures, getting matured over the years. In this article, we will talk about two widely used keyboard technologies — switch-based keyboards and capacitive keyboard.

Keyboard is a simple electro-mechanical device. Behind every keystroke, there is a electrical and mechanical action. What if, I say a keyboard is a computer? Yes, keyboard is a low-power independent computer powered by a microprocessor, ROM, buffers, flag registers.

Working of switch-based keyboard:

They are varieties of keyboards, based on switch. But, they all follow a common working with some changes. Underneath every key, there is an open circuit and a switch. When no keys are pressed, all the circuits in the keyboard will be open. When a key is pressed, it in turn presses the switch underneath it, which will close the circuit. When a circuit is closed, it generates a minimal amount of current. This current will signal the microprocessor in the keyboard, that some key is pressed. Well, how does the microprocessor finds a key which is pressed? There is a mapping table stored in the read-only memory (ROM) present in the keyboard. With the help of this table, the microprocessor will find the key pressed. Then, it will store the ASCII value of the key pressed in a buffer. A flag will be set in the keyboard, intimating the CPU that there is some input for you. Now, the CPU will take the content from the keyboard buffer.

Switch based keyboads

Working of capacitive keyboard:

A slight variation of switch keyboards, will result in capacitive keyboard. Here, a change in current will help the microprocessor to detect the key press. In capacitance keyboard, there is no play for switches. Current will be continuously passed in the keyboard circuits. On the account of key press, current passed in the circuit will be altered, which signals the microprocessor about the key press. Rest of the working is the same as the switch-based keyboard as discussed previously.

Durability of capacitive keyboard is higher than the switch-based keyboards, as the switches may be weakened or damaged due to usage.