The SW-420 Vibration Sensor is a compact and reliable device designed to detect vibrations and movements. It operates using a piezoelectric sensor that generates a voltage when subjected to mechanical stress or vibrations. This makes it an ideal choice for applications such as security systems, motion detection, and monitoring equipment for vibrations or shocks. Its simplicity and ease of integration make it popular among hobbyists and professionals alike.
Common applications include:
The SW-420 Vibration Sensor is designed for low-power operation and is easy to interface with microcontrollers like Arduino. Below are its key technical details:
Parameter | Value |
---|---|
Operating Voltage | 3.3V to 5V |
Output Type | Digital (High/Low) |
Sensitivity Adjustment | Adjustable via onboard potentiometer |
Dimensions | 32mm x 14mm x 10mm |
Operating Temperature | -40°C to +85°C |
Output Signal | High (no vibration), Low (vibration detected) |
The SW-420 Vibration Sensor has three pins for easy interfacing:
Pin Name | Description |
---|---|
VCC | Power supply input (3.3V to 5V) |
GND | Ground connection |
DO | Digital output pin (High/Low signal based on vibration) |
The SW-420 Vibration Sensor is straightforward to use in a circuit. Follow the steps below to integrate it into your project:
VCC
pin to a 3.3V or 5V power source and the GND
pin to ground.DO
pin to a digital input pin on your microcontroller (e.g., Arduino).Below is an example of how to connect the SW-420 Vibration Sensor to an Arduino UNO:
VCC
→ 5V on ArduinoGND
→ GND on ArduinoDO
→ Digital Pin 2 on Arduino// SW-420 Vibration Sensor Example Code
// This code reads the digital output of the SW-420 sensor and prints
// a message to the Serial Monitor when vibration is detected.
const int sensorPin = 2; // Connect the DO pin of the sensor to digital pin 2
const int ledPin = 13; // Optional: Use the onboard LED to indicate vibration
void setup() {
pinMode(sensorPin, INPUT); // Set the sensor pin as input
pinMode(ledPin, OUTPUT); // Set the 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 (LOW signal)
Serial.println("Vibration detected!");
digitalWrite(ledPin, HIGH); // Turn on the LED
} else {
// No vibration (HIGH signal)
digitalWrite(ledPin, LOW); // Turn off the LED
}
delay(100); // Small delay to avoid rapid toggling
}
No Output Signal:
VCC
and GND
connections).False Triggers:
Sensor Not Detecting Vibrations:
Interference with Other Components:
Q: Can the SW-420 detect very small vibrations?
A: Yes, the sensitivity can be adjusted using the onboard potentiometer to detect even small vibrations.
Q: Is the sensor waterproof?
A: No, the SW-420 is not waterproof. Avoid exposing it to moisture or liquids.
Q: Can I use the SW-420 with a 3.3V microcontroller?
A: Yes, the sensor operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V systems.
Q: How do I know if the sensor is working?
A: The DO
pin will output a LOW signal when vibration is detected. You can monitor this using an LED or a microcontroller.
By following this documentation, you can effectively integrate the SW-420 Vibration Sensor into your projects and troubleshoot any issues that arise.