Mechanical Keyboards: Switches & Sensors

Gamers love clicky keyboards. Engineers use them too. Learn how the mechanism inside a Cherry MX switch is identical to robot limit switches.

Mechanical Keyboards: Switches & Sensors

Click-clack-click. The sound of a Mechanical Keyboard (Blue Switches, preferably) is music to a gamer’s ears. But why do we pay $150 for a Keychron or a Ducky when a $10 Dell membrane keyboard works fine? It’s about the Switch Mechanism. It’s about precision.

Unlike a membrane keyboard (squishy rubber contacts), a mechanical switch uses a physical metal contact and a spring. In robotics, we use this exact same technology, but we call it a Limit Switch.

The Anatomy of a Click

When you press a key (like a Cherry MX Blue):

  1. Stem: Pushes down.
  2. Spring: Resists (giving you “Actuation Force” or feel).
  3. Leaf: Two gold-plated pieces of metal snap together.
  4. Signal: The circuit closes. 0 becomes 1.

This is a Tactile Digital Sensor. “Digital” means it is either ON or OFF. There is no “Halfway.”

How Robots Use “Keyboards”

We mount these switches all over the robot to give it a sense of touch (Proprioception).

  • The Elevator: When the lift goes all the way down, it hits a switch. Click. The robot code knows: “Reset Height to 0.” This is a Home Switch.
  • The Intake: When a ball enters the bucket, it presses a sensitive switch. Click. The robot knows: “I have ammo. Stop the intake wheels.”
  • The Wall: Measuring bumpers with switches lets the robot know when it has backed up perfectly against the wall to align itself.

Debouncing (The Ghost Click)

Here is a fun engineering problem that plagues both keyboard firmware and robots: Bounce. Metal is elastic. When you slam a key, the metal leaf doesn’t just touch once; it vibrates. It touches-releases-touches-releases extremely fast (microseconds).

  • The Problem: The computer sees “AAAAAAAAA” instead of “A”. The robot thinks the intake is full-empty-full-empty.
  • The Fix: We have to write “Debounce Code.”
    • Logic: “If I detect a click, I will ignore all further signals for 20 milliseconds.”

Conclusion

Your gaming keyboard is just a grid of 104 industrial sensors. The satisfaction you feel from a good switch is the feeling of a reliable mechanical machine. That’s why engineers love them—we trust things we can feel. Next time you build a robot, think about the “Actuation Force” of your sensors. Do you want a “Red Switch” (linear, no click) for a smooth slide, or a “Blue Switch” (clicky) for a definitive bumper hit? The choice matters.

Explore FIRST® Robotics

FIRST® (For Inspiration and Recognition of Science and Technology) is a global robotics community preparing young people for the future. Discover the ultimate sport for the mind and see how you can get involved in STEM and robotics!

Learn More at firstinspires.org