

The SW-420 is a vibration sensor designed to detect vibrations and movements. It operates as a switch that changes its state when subjected to physical disturbances. This sensor is widely used in applications such as security systems, alarms, and robotics, where detecting vibrations or motion is critical. Its compact design and ease of use make it a popular choice for both hobbyists and professionals.








The SW-420 vibration sensor module typically includes the SW-420 sensor and a comparator circuit for signal processing. Below are the key technical details:
The SW-420 vibration sensor module typically has three pins. The table below describes each pin:
| Pin Name | Description |
|---|---|
| VCC | Power supply input (3.3V to 5V DC) |
| GND | Ground connection |
| DO | Digital output signal |
Below is an example of how to connect and use the SW-420 vibration sensor with an Arduino UNO:
// SW-420 Vibration Sensor Example with Arduino UNO
// Connect the DO pin of the sensor to digital pin 2 on the Arduino
const int sensorPin = 2; // Digital pin connected to the sensor's DO pin
const int ledPin = 13; // Built-in LED pin on Arduino
void setup() {
pinMode(sensorPin, INPUT); // Set sensor pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication
}
void loop() {
int sensorState = digitalRead(sensorPin); // Read the sensor's output
if (sensorState == LOW) {
// If vibration is detected, turn on the LED
digitalWrite(ledPin, HIGH);
Serial.println("Vibration detected!");
} else {
// If no vibration is detected, turn off the LED
digitalWrite(ledPin, LOW);
Serial.println("No vibration.");
}
delay(100); // Small delay to stabilize readings
}
Sensor Not Responding
False Triggers
No Output Signal
Q: Can the SW-420 detect continuous vibrations?
A: The SW-420 is designed to detect sudden vibrations or movements. For continuous vibration detection, additional signal processing may be required.
Q: Is the SW-420 suitable for outdoor use?
A: The SW-420 is not waterproof or weatherproof. It is recommended to use it in a controlled indoor environment or protect it with a suitable enclosure.
Q: How do I increase the detection range?
A: The detection range can be adjusted by turning the onboard potentiometer clockwise to increase sensitivity.
Q: Can I use the SW-420 with a 3.3V microcontroller?
A: Yes, the SW-420 operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V microcontrollers like the ESP8266 or ESP32.