In this project, we will connect Arduino with Vibration sensor and LED. When no vibration is detected, Vibration sensor output is 0 (low voltage),otherwise its output is 1(high voltage)。 If Arduino get 0 (no vibration) from vibration sensor it will turn on green LED and turn off Red LED. If Arduino get 1 from vibration sensor, it will turn on Red LED and turn off green LED.
🛠️ เจาะลึกเบื้องหลังการทำงาน (Deep Dive / Technical Analysis)
The Vibration Sensor (specifically the SW-420 or similar piezoelectric modules) is the core component of car alarms, washing machine balancers, and smart security systems. It detects physical shock and vibration that tilt sensors might miss.
The Mechanics of Shock
Inside the SW-420 module is a small metal rod and a spring mechanism (or a piezo crystal).
- At Rest: The circuit is open; the sensor outputs a digital LOW.
- During Impact: Vibration causes the internal elements to touch rapidly, creating a series of digital HIGH pulses.
- The Amplifier: An onboard LM393 comparator chip cleans up these messy signals and sends a clean digital trigger to the Arduino.
Components Needed
- Arduino Uno/Nano: To monitor the digital pin.
- SW-420 Vibration Sensor Module: The impact detector.
- LED and Buzzer: To provide instant feedback.
- Potentiometer (on the module): To dial in the exact sensitivity required.
Typical Uses
You can attach this sensor to a window pane to detect if the glass is being broken, or to a desk drawer to act as a tamper alarm. It's a highly responsive sensor that adds a robust layer of physical security to any project.