How do Computer Keyboards Work? 🤔⌨⌨🛠

Computer Science
96 followers
1 Video View·Jan 16, 2026
How do Computers Work?
You probably use a computer keyboard for dozens of hours a week, but have you ever wondered what it looked like inside of them or how it worked? Also, what's the difference between a basic and a mechanical keyboard? And what makes that clicking sound? Well, in this video, we're diving into both basic keyboards and mechanical keyboards, so stick around!
You might not think it, but basic computer keyboards have a surprisingly impressive
amount of engineering inside. We're not talking about incredible engineering like a
rocket that can land itself, or a stealth aircraft that can evade radar.
Rather, we're talking about the engineering of cost reduction. Specifically, this keyboard has
only eight critical parts inside, essentially removing all the components' costs, so that you
can buy them in bulk for as little as $1.57 each. Engineering something that is durable,
functional, and costing next to nothing is indeed a feat on its own.
So let's look inside this dirt-cheap keyboard and see how only a few critical components
enables it to work. After that, we'll open a mechanical keyboard that costs over 50 times
as much and see the difference, as well as find out what causes that clicking sound inside the
mechanical keys. So let's jump right in. This inexpensive keyboard is assembled from 148 parts,
and almost all the parts are the keys, screws, and the top and bottom plastic casing,
leaving us only eight critical parts inside. These components are a rubber sheet with domes
under each key and three plastic sheets. The top and bottom sheets have conductive wires printed
onto them with dots under each key, and the middle sheet acts as a spacer with holes cut out of it.
The remaining four components are two batteries, a bracket to clamp down the plastic sheets,
and a small printed circuit board, which has a simple microprocessor, a crystal oscillator,
a switch, a 2.4 gigahertz planar antenna, a pair of wires to connect to the batteries,
and a set of conductive lines to connect to the wires printed on the top and bottom plastic sheets.
So now that we've seen the few components inside, how do they work? Well, the main idea is that the
batteries and microprocessor apply three volts to all the traces on the bottom sheet, while all the
traces on the top sheet are actively being monitored by the processor on the PCB. When a key is pressed,
it presses on the rubber dome, which pushes the conductive circle from the top sheet down through
the air gap created by the middle sheet and into the circle on the bottom sheet, thereby bridging
the connection between top and bottom plastic sheets. The three volts then travels along the
conductive trace of the bottom sheet through the hole of the key that has been pressed
and into the top sheet's trace, and then returns back to the PCB and microprocessor where it's
sensed. When you let your finger off the key, the rubber dome returns the key to the unpressed
position, thereby opening the connection. On the top sheet of plastic are 12 traces, and on the
bottom sheet are 11 traces, with each trace traveling to a different set of keys. It's visually
hard to see here, so let's reorganize these traces into a grid, also called a keyboard matrix, with
the bottom traces forming the columns and the top traces forming the rows. Just as before, the
microprocessor outputs three volts along each column, while actively monitoring the inputs along
each row. With this reorganization, you can more easily see that as you press the Y key,
three volts is sent out along the fourth column and returned along the second row, and thus the
processor can tell that the Y key was pressed. Or with the B key, three volts is output along the
eighth column and input through the first row. With 11 columns and 12 rows, we can have a maximum
of 132 keys, which works out well, because the keyboard only has 111 keys. However, if you
haven't noticed, there's actually a major problem with this keyboard matrix. That is, if we have
three volts running along all these columns and we press a key, three volts will return along a row.
However, because each of these columns output the same three volts, how do we know which key
in the row was pressed? Well, there are a few solutions to this problem. One solution is to
quickly scan three volts along each of the 11 columns, so that at any given time only one column
is active. By correlating the active column with when voltage is received on the input row,
we can determine the exact intersection of column and row, and thus which key is pressed. However,
with this solution, we're continuously scanning three volts across the columns, which takes power,
thereby draining the batteries. So instead, we found that it's more practical to have three volts
on each column, and when the key is pressed, a cycle of pulses of turning off one column at a
time is sent to determine which key in a row is pressed. These pulses are sent for 65 microseconds
to each column, once every four milliseconds. Therefore, if the G key were pressed, then the
third row would see an input that looks like this. Whereas, if the T, L, and A key were pressed,
then the second and sixth row inputs would see a voltage that looks like this, and all the other
rows would see nothing. Now that the microprocessor knows which keys are pressed, it sends the data to
the 2.4 gigahertz transceiver using these printed planar antennas. We'll cover these antennas as
well as the oscillator in another video, but for now, let's close this inexpensive keyboard and
look inside a mechanical keyboard that costs over 50 times more. But before exploring mechanical
keyboards, the next portion of this video is sponsored by Keysight's virtual event, Keysight
World, live from the lab. In this live stream, Keysight will be exploring batteries, DC to DC
converters, and a wide range of IoT devices through hands-on design analysis and Q&A sessions with
industry experts. Sign up quickly, because the next Keysight live event is May 16th, and by attending
this live stream, you'll be entered to win an oscilloscope in their test gear giveaway. In fact,
the only way we were able to reverse engineer this keyboard was with an oscilloscope just like this
one, where we could easily see the cycling of off pulses whenever a key is pressed. At Keysight's
upcoming live from the lab event, you'll learn many useful tools, such as how temperature can
affect battery and device life, as well as techniques and tricks for using DC to DC converters in your
designs. Whether you're an expert engineer or electronics newbie, there'll be plenty of
opportunities to learn new things. Hurry up and register for the May 16th Keysight World live
stream using the branch education link, and you'll get an extra entry into Keysight's huge test gear
giveaway. Go check it out. But now let's get back to the inside of this mechanical keyboard. Instead
of seeing plastic sheets, we find a rather large printed circuit board with mechanical keys soldered
to it. This PCB functions similarly to the keyboard matrix, but now we have an LED under each key to
create attractive designs. However, quite noticeable with a mechanical keyboard is that these keys
have a different tactile feel and make a clicking sound when pressed. So let's look inside one of
these keys, where we find a key cap on top, the stem and slider below that, a top and bottom switch
housing, and inside are a spring and two metal contacts, which are also called metal contact
The main mechanism is that when you press a key down, it moves the stem and slider. The slider is
uniquely shaped such that it pushes one of the contacts away from the other, and when pressed
down, the slider moves out of the way, allowing for one of the metal contacts to spring outwards
and hit the other, thus creating a connection between the two pieces of metal and causing a
click sound when they hit. When you release the key, the spring pushes the slider, the stem, and the
key back up, and the slider re-engages the metal contact, thus separating the two metal contacts
and opening the connection between them. The stem and slider are separate components so that if you
accidentally brush a key, the key cap and stem can travel a small distance down before the slider
is engaged. However, once the slider is pushed a fraction of a millimeter down, the metal contact
quickly forces the slider to jump out of the way, allowing the metal contacts to engage. By having
such a mechanism, each key has a more tactile feel when pressed, different from the key hitting the
rubber dome. That said, having a large PCB such as this, as well as an intricate mechanism inside each
key, causes the keyboard to be significantly more expensive, but depending on your preferences, it can
be worth it. Finally, there are laptop keyboards which have a scissor switch mechanism along with
rubber domes to allow it to have a lower profile, but let's wrap it up for now. This topic is moderately
simple, but we think it properly highlights the cost difference and engineering in two similar items.
We're working on more videos that dive deeper into the engineering inside computer architecture
and other complex technologies, so be sure to subscribe, hit that like button, and share this
video with others. We believe the future will require a strong emphasis on engineering education
and we're thankful to all our Patreon and YouTube membership sponsors for supporting this stream.
If you want to support us on YouTube memberships or Patreon, you can find the links in the
description. This is Branch Education, and we create 3D animations that dive deeply into the
technology that drives our modern world. Watch another Branch video by clicking one of these
cards or click here to subscribe. Thanks for watching to the end.
