Component guide · Beginner · 4 min read
Vibration and Tilt Switch Components

SW-18010P, SW-18015P and SW-58010P Spring Switches, SW-200D Ball Tilt Switches, XKB, Shou Han, Hanxia, ROCPU and Saiya SMD Vibration Sensors
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
These are the bare switches used inside vibration and tilt modules. Spring types like the SW-18010P have a coil spring around a pin: any shake makes them touch for a moment, from any direction. Ball types like the SW-200D close when upright and open when tilted. Wire one between a pin and ground with a pull-up, and use an interrupt to catch the short pulses.
Key specs at a glance
- Spring type
- SW-18010P, SW-18015P, SW-58010P: normally open, closes briefly on vibration
- Ball type
- SW-200D, SW-520D style: closed upright, open when tilted
- Mounting
- Through-hole plug-in or SMD
- Rating
- Signal level only, a few mA
- Life
- Up to about 1 million cycles on some parts
- Direction
- Spring types are non-directional
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Shou Han SW-18010P Vibration Sensor 1M Cycles Plugin₹23
Option 2Shou Han SW-58010P Vibration Sensor 1M Cycles Plugin ROHS₹17
Option 3Shou Han SW-200D 053 Plugin Vibration Sensor +40℃~+81℃₹13
Option 4Hanxia HX SW-200 053 DIP Vibration Sensor – 12V, +40℃ to +80℃₹8
Option 5Hanxia HX SW-200D 053 DIP Vibration Sensor +40℃~+80℃₹10
Option 6ROCPU TPSW-105A-B Vibration Switch 100K Cycles 120℃ Plugin ROHS₹7
What the Spring vibration switches and ball tilt switch components (SW-18010P, SW-200D) is
Vibration and tilt switch components, such as SW-18010P spring switches and ball tilt switches, close a contact when shaken or tilted, for alarms and wake-up triggers.
Use spring switches to wake a sleeping microcontroller when a bag, door, bike or machine is moved: the pulse triggers an interrupt and the board wakes up. Use ball tilt switches for orientation alarms and toys.
Pulses from spring switches are very short, often under a millisecond, so polling in loop() can miss them. Attach an interrupt, or add a small capacitor to stretch the pulse. Never pass load current through these switches.
Spring vibration switches and ball tilt switch components (SW-18010P, SW-200D) pinout
The pins on the Spring vibration switches and ball tilt switch components (SW-18010P, SW-200D) and what each one does.
| Pin | Function |
|---|---|
| Pin 1 | To the input pin |
| Pin 2 | To ground |
| Body | Can be the spring contact on some parts |
| Orientation | Matters for ball types only |
| Polarity | None |
- Pin 1
- To the input pin
- Pin 2
- To ground
- Body
- Can be the spring contact on some parts
- Orientation
- Matters for ball types only
- Polarity
- None
Wiring the Spring vibration switches and ball tilt switch components (SW-18010P, SW-200D)
These switches carry signal current only. Use a transistor or relay to drive anything else.
| Spring vibration switches and ball tilt switch components (SW-18010P, SW-200D) pin | Connection | Note |
|---|---|---|
| Pin 1 | D2 with INPUT_PULLUP | Interrupt pin |
| Pin 2 | GND | Common ground |
| Optional | 100 nF from D2 to GND | Stretches short pulses |
- Pin 1
- Connection:
- D2 with INPUT_PULLUP
- Note:
- Interrupt pin
- Pin 2
- Connection:
- GND
- Note:
- Common ground
- Optional
- Connection:
- 100 nF from D2 to GND
- Note:
- Stretches short pulses
Example code
On an ESP32, use the same pin as an external wake-up source to wake from deep sleep on movement.
const int VIB = 2;
volatile unsigned int hits = 0;
void onHit() { hits++; }
void setup() {
Serial.begin(9600);
pinMode(VIB, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(VIB), onHit, FALLING);
}
void loop() {
noInterrupts();
unsigned int n = hits;
hits = 0;
interrupts();
if (n > 0) {
Serial.print("Vibration pulses: ");
Serial.println(n);
}
delay(500);
}Setup and tuning
one lead to a digital pin with INPUT_PULLUP, the other to GND.
use a pin interrupt to catch short vibration pulses.
choose spring stiffness for sensitivity; it is not adjustable.
count pulses in a time window to avoid false triggers.
use them to wake a sleeping microcontroller.
What you need
Shop this list19 of 20 found in our store · ₹301
Shou Han SW-18010P Vibration Sensor 1M Cycles Plugin: the part this guide coversShou Han SW-18010P Vibration Sensor 1M Cycles Plugin₹23
Shou Han SW-58010P Vibration Sensor 1M Cycles Plugin ROHS: another version this guide coversShou Han SW-58010P Vibration Sensor 1M Cycles Plugin ROHS₹17
Shou Han SW-200D 053 Plugin Vibration Sensor +40℃~+81℃: another version this guide coversShou Han SW-200D 053 Plugin Vibration Sensor +40℃~+81℃₹13
Hanxia HX SW-200 053 DIP Vibration Sensor – 12V, +40℃ to +80℃: another version this guide coversHanxia HX SW-200 053 DIP Vibration Sensor – 12V, +40℃ to +80℃₹8
Hanxia HX SW-200D 053 DIP Vibration Sensor +40℃~+80℃: another version this guide coversHanxia HX SW-200D 053 DIP Vibration Sensor +40℃~+80℃₹10
ROCPU TPSW-105A-B Vibration Switch 100K Cycles 120℃ Plugin ROHS: another version this guide coversROCPU TPSW-105A-B Vibration Switch 100K Cycles 120℃ Plugin ROHS₹7
Saiya Sensor SWS-0608-05 SMD Vibration Sensor 1M Cycles 250℃ ROHS: another version this guide coversSaiya Sensor SWS-0608-05 SMD Vibration Sensor 1M Cycles 250℃ ROHS₹22
XKB Connection SW-105AC-10G Plugin Vibration Sensor – 10° Tilt Angle: another version this guide coversXKB Connection SW-105AC-10G Plugin Vibration Sensor – 10° Tilt Angle₹9
XKB Connection SW-168DZW-9G Double Ball Tilt/Vibration Sensor: another version this guide coversXKB Connection SW-168DZW-9G Double Ball Tilt/Vibration Sensor₹22
XKB Connection SW-18015PZR-10G12B3 Plugin Vibration Sensor – ROHS Compliant: another version this guide coversXKB Connection SW-18015PZR-10G12B3 Plugin Vibration Sensor – ROHS Compliant₹7
XKB Connection SW-200CS-19G10G Plugin Vibration Sensor: another version this guide coversXKB Connection SW-200CS-19G10G Plugin Vibration Sensor₹10
XKB Connection SW-200DAC-10G1 Single-Ball Tilt Switch – 10° Activation Angle: another version this guide coversXKB Connection SW-200DAC-10G1 Single-Ball Tilt Switch – 10° Activation Angle₹9
XKB Connection SW-200DW-17T3G Vibration Sensor – Dual-Pass Tilt Switch, Gold-Plated Pins: another version this guide coversXKB Connection SW-200DW-17T3G Vibration Sensor – Dual-Pass Tilt Switch, Gold-Plated Pins₹19
XKB Connection SW-200DW-7T5G Plugin Vibration Sensor – Tilt Switch: another version this guide coversXKB Connection SW-200DW-7T5G Plugin Vibration Sensor – Tilt Switch₹20
XKB Connection SW-200M-20T10G2 Plugin Vibration Sensor: another version this guide coversXKB Connection SW-200M-20T10G2 Plugin Vibration Sensor₹22
XKB Connection SW-58010PZD-7N11S1 Plugin Vibration Sensor – Nickel-Plated Brass Housing: another version this guide coversXKB Connection SW-58010PZD-7N11S1 Plugin Vibration Sensor – Nickel-Plated Brass Housing₹8
XKB Connection SW-58015PD-10B3 Plugin Vibration Sensor: another version this guide coversXKB Connection SW-58015PD-10B3 Plugin Vibration Sensor₹9
XKB Connection SW-58025PD-10B5 Plugin Vibration Sensor: another version this guide coversXKB Connection SW-58025PD-10B5 Plugin Vibration Sensor₹17- Uno R3 development board: the controller used in the wiring tableFind this part
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- SW-420 vibration sensor: ready module with comparator.
- Tilt switch modules: ready boards.
- Piezo sensors and discs: measure vibration strength.
Common mistakes to avoid
- Polling instead of interrupts.
- No pull-up.
- No filtering.
- Expecting vibration level measurement.
Frequently asked questions
How do I detect vibration with a spring switch?
Use an interrupt on the pin and count pulses.
Can I adjust the sensitivity?
Not on the switch; choose a different model or filter in code.
Why do I get random triggers?
Small knocks; require several pulses within a short time.
Can it wake up an ESP32?
Yes. Connect it to an RTC GPIO and use it as an external wake-up source.
Is it a replacement for an accelerometer?
No. It only switches on or off and cannot measure how strong the vibration is.
Parts for this guide
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.


