Many Applications can created by measuring Vibration level, but sensing vibration accurately is a difficult job. This article describes about vibration sensor SW-420 and Arduino interface then it may help you to design effort less vibration measurement.
- Osoyoo UNO Board (Fully compatible with Arduino UNO rev.3) x 1
- Breadboard x 1
- Vibration Sensor Module x 1
- USB Cable x 1
- PC x 1
Arduino IDE (version 1.6.4+)
About Vibration Sensor Module
Vibration Sensor Module comes with SW-420 vibration sensor, integrated with adjustable sensitivity via on board potentiometer. There are also LED indicators for power and the digital output status on board. It has a simple and straight forward 3-pin interface, VCC, GND and the DO (digital output). It supports 3.3V or 5V power.
This vibration sensor module is compatible with any microcontroller that has a digital input, so of course any popular microcontroller such and PIC, Arduino and Raspberry Pi are compatible. A direct interface is essential to using this sensor.
The DO pin will be LOW when there is no vibration, and indicator LED will lit up.
- SW-420 using the company’s production of normally closed type vibration sensor.
- The comparator output, the signal is clean, the waveform, the driving ability to exceed 15mA
- Operating voltage 3.3V-5V
- The output in the form: Digital switching outputs (0 and 1)
- A fixed bolt hole for easy installation
- Small board PCB size: 3.2cm x 1.4cm
- Wide voltage LM393 comparator
This Vibration Sensor can be used to detect vibration from any angle. There is an on-board potentiometer to adjust the threshold of vibration. It outputs logic HIGH when this module not triggered while logic Low when triggered.
•Vibration detecting Applications Features
Connect Vcc pin of sensor board to 5V pin of Arduino board, connect Gnd pin to Gnd pin of Arduino, Connect DO output signal pin of sensor board to Arduino digital pin D3. Do some calibration and adjust the sensitivity threshold, then upload the following sketch to Arduino board.
|Vibration Sensor Module
Arduino Code for Logic State Output
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.(Please choose the correct board type and correct port com for your Arduino IDE)
Arduino Code for Value Reading
Arduino Code for Value Reading and serial printing Vibration value, this code turns ON the onboard LED when measurement goes greater than 1000, you can adjust this threshold to your need.
Finally, you should open the Arduino IDE serial monitor at a 9600 baud rate and you’ll see: