Knock Sensor Module
A KY-031 knock sensor module detects tap or shock events with a contact-style vibration element.
Part images
What it is
A KY-031 knock sensor module detects tap or shock events with a contact-style vibration element.
How students use it
Students use it for tap codes, knock-to-start projects, reaction games, and event logging.
Pins and power
Signal, VCC, and GND on common KY-031 boards.
Passive/digital tap sensor module. Use Pico-safe pull-up or pull-down wiring.
The signal changes briefly during a tap, so code should debounce, latch, or count pulses deliberately.
Voltage and safety
Keep signal wiring Pico-safe.
Tap the surface, not the bare electronics. Do not strike the board hard.
Module internals
Main component: Knock/vibration switch element.
Knock sensor contact, resistor/support parts, PCB, and header.
Datasheet notes
It detects events, not calibrated impact strength.
Common libraries
Use machine.Pin, interrupts, and debounce timing.
Common mistakes
Missing short pulses, no debounce, mounting loosely, and expecting the same sensitivity in every enclosure.