

The SW-420 is a vibration sensor designed to detect vibrations and movements. It is widely used in security systems, alarm systems, and other applications requiring motion detection. The sensor outputs a digital signal when the detected vibrations exceed a predefined threshold, making it ideal for applications such as anti-theft systems, earthquake detection, and industrial monitoring.








| Pin Name | Description |
|---|---|
| VCC | Power supply pin. Connect to 3.3V or 5V DC. |
| GND | Ground pin. Connect to the ground of the circuit. |
| DO | Digital Output pin. Outputs HIGH when no vibration is detected and LOW when vibration is detected. |
Below is an example of how to connect and use the SW-420 vibration sensor with an Arduino UNO:
// SW-420 Vibration Sensor Example Code
// Connect the SW-420 DO pin to Arduino Digital Pin 2
const int sensorPin = 2; // Pin connected to the SW-420 DO pin
const int ledPin = 13; // Built-in LED on Arduino for indication
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 sensorValue = digitalRead(sensorPin); // Read the sensor output
if (sensorValue == LOW) {
// Vibration detected
digitalWrite(ledPin, HIGH); // Turn on LED
Serial.println("Vibration detected!");
} else {
// No vibration
digitalWrite(ledPin, LOW); // Turn off LED
Serial.println("No vibration.");
}
delay(100); // Small delay for stability
}
No Output Signal
False Triggers
Sensor Not Responding to Vibrations
Interference with Other Components
Q: Can the SW-420 detect small vibrations?
A: Yes, the sensitivity can be adjusted to detect small vibrations by using the onboard potentiometer.
Q: Is the SW-420 suitable for outdoor use?
A: The SW-420 is not waterproof or weatherproof. For outdoor use, ensure it is enclosed in a protective casing.
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.
Q: How do I know if the sensor is working?
A: The onboard LED will light up when vibrations are detected, and the DO pin will output a LOW signal.
This concludes the documentation for the SW-420 vibration sensor.