Sensor Digital

Mercury Tilt Switch Module

A KY-017 mercury tilt switch module changes state when the sealed conductive bead shifts with tilt.

Part images

KY-017 Module Photo. Module Photo for the KY-017 Mercury Tilt Switch Module. Image source: Joy-IT SensorKit KY-017 module documentation
KY-017 Pinout / Module Diagram. Pinout / Module Diagram for the KY-017 Mercury Tilt Switch Module. Image source: Joy-IT SensorKit KY-017 module documentation
KY-017 Arduino Wiring Diagram. Arduino Wiring Diagram for the KY-017 Mercury Tilt Switch Module. Image source: Joy-IT SensorKit KY-017 module documentation
KY-017 Raspberry Pi Wiring Diagram. Raspberry Pi Wiring Diagram for the KY-017 Mercury Tilt Switch Module. Image source: Joy-IT SensorKit KY-017 module documentation

What it is

A KY-017 mercury tilt switch module changes state when the sealed conductive bead shifts with tilt.

How students use it

Students use it for orientation, movement, wake-up triggers, and tilt-state demos.

Pins and power

Signal, VCC, and GND on common KY-017 boards.

Passive/digital switch module. Use Pico-safe pull-up or pull-down wiring.

Read it like a switch and debounce the signal because contacts can chatter while moving.

Voltage and safety

Keep switch signal wiring Pico-safe.

Do not crush, cut, heat, or open the switch capsule. Dispose of damaged modules properly.

Module internals

Main component: Sealed tilt switch.

Tilt switch capsule, resistor/support parts, PCB, and header.

Datasheet notes

Some kit listings call this a mercury opening, ball switch, or tilt module.

Common libraries

Use machine.Pin with pull-up or pull-down configuration.

Common mistakes

Using it as an angle sensor, ignoring bounce, and mounting it at the wrong resting angle.