Components / Sensors / Knock sensor module (KY-031)

Knock sensor module (KY-031)

Spring sensor that gives a pulse on a knock.

MeasuresKnock
InterfaceDigital
Supply voltage3.3 to 5 V
SensorsReviewedMPN KY-031Used in 4 projects
KY031
In short

What is the Knock sensor module (KY-031) and what is it used for?

Spring sensor that gives a pulse on a knock. Makers use it for secret knock locks.

How it works

A spring contact closes briefly when the board is knocked.

Key specifications

Sensor specValue
MeasuresKnock
InterfaceDigital
Supply voltage3.3 to 5 V

Pinout

SDigital output
middleSupply 3.3 to 5 V
−Ground

How to use it

Read S with an interrupt, since knocks are very short. Pin order varies between makers, so check the silkscreen.

Applications

Alternatives

Buy at

Common questions

What is the Knock sensor module (KY-031) used for?

In maker projects: secret knock locks.

How does the Knock sensor module (KY-031) work?

A spring contact closes briefly when the board is knocked.

What voltage does the Knock sensor module (KY-031) need?

3.3 to 5 V.

How do I connect the Knock sensor module (KY-031) to an Arduino or ESP32?

Digital. Pins: S (Digital output), middle (Supply 3.3 to 5 V), − (Ground).

What can I use instead of the Knock sensor module (KY-031)?

Piezo vibration sensor (disc).