The SW-420 Vibration Sensor is a device designed to detect vibrations and movements. It operates using a piezoelectric sensor that generates a voltage when subjected to mechanical stress. This makes it an ideal choice for applications requiring motion detection or vibration monitoring. The sensor is commonly used in security systems, industrial equipment monitoring, and motion-triggered devices.
Below are the key technical details and pin configuration for the SW-420 Vibration Sensor:
The SW-420 Vibration Sensor typically has three pins. The table below describes each pin:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply pin. Connect to 3.3V or 5V DC. |
2 | GND | Ground pin. Connect to the ground of the circuit. |
3 | DO (Digital Output) | Outputs a digital signal: HIGH when no vibration, LOW when vibration is detected. |
Below is an example of how to use the SW-420 Vibration Sensor with an Arduino UNO:
// SW-420 Vibration Sensor Example Code for Arduino UNO
// Connect the sensor's DO pin to Arduino digital pin 2
const int sensorPin = 2; // Digital pin connected to the sensor's DO pin
const int ledPin = 13; // Built-in LED pin for visual feedback
void setup() {
pinMode(sensorPin, INPUT); // Set sensor pin as input
pinMode(ledPin, OUTPUT); // Set LED pin as output
Serial.begin(9600); // Initialize serial communication for debugging
}
void loop() {
int sensorValue = digitalRead(sensorPin); // Read the sensor's output
if (sensorValue == LOW) {
// Vibration detected
digitalWrite(ledPin, HIGH); // Turn on the LED
Serial.println("Vibration detected!");
} else {
// No vibration
digitalWrite(ledPin, LOW); // Turn off the LED
Serial.println("No vibration.");
}
delay(100); // Small delay to stabilize readings
}
No Output Signal:
False Triggers:
Sensor Not Detecting Vibrations:
Erratic Behavior:
Q: Can the SW-420 detect very small vibrations?
A: Yes, but you may need to adjust the sensitivity using the potentiometer.
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.
Q: How do I know if the sensor is working?
A: Monitor the DO pin. It should output HIGH when no vibration is detected and LOW when vibration is detected.
Q: Can I use multiple SW-420 sensors in the same circuit?
A: Yes, but ensure each sensor has a stable power supply and does not interfere with others.
By following this documentation, you can effectively integrate the SW-420 Vibration Sensor into your projects and troubleshoot common issues.