Getting Started with Vibration Sensor Module (Normally Off) (SN-VIBRATE-MOD)

Last Updated on 23 June 2017

This article is written by internship student Tan Khim Huang


INTRODUCTION

Vibration Sensor Module comes with SW-420 vibration sensor, integrated with adjustable sensitivity via on board potentiometer. And there are LED indicators for power and also digital output status on board. Simple and straight forward interface, just 3-pin, VCC, GND and the DO (digital output). Support 3.3V or 5V power.

This vibration sensor module is compatible with any microcontroller that has digital input. Of course popular microcontroller such and PIC, Arduino, Raspberry Pi is compatible. Direct interface is essential to use this sensor.

The DO will be logic LOW when there is no vibration, and indicator LED will light.

FEATURES

  • The default state of the swith is close
  • Digital output
  • Supply voltage:3.3V-5V
  • On-board indicator LED to show the results
  • On-board LM393 chip
  • Dimension of the board: 3.2cm x 1.4cm

HARDWARE REQUIREMENT

This tutorial is required the following items:

SOFTWARE REQUIREMENT

Arduino IDE

HARDWARE SETUP

Here are the connections between the Vibration Sensor Module and the Arduino/CT-UNO:

Vibration Sensor ModuleArduino Uno/CT-UNO
VCCVCC
GNDGND
DOPIN 3

Connect the LED to Arduino this way:

ARDUINO GND – Negative terminal of LED
ARDUINO PIN 13 – Positive terminal of LED

SAMPLE CODE

int LED_Pin = 13;
int vibr_Pin =3;

void setup(){
  pinMode(LED_Pin, OUTPUT);
  pinMode(vibr_Pin, INPUT); //set vibr_Pin input for measurment
  Serial.begin(9600); //init serial 9600
 // Serial.println("----------------------Vibration demo------------------------");
}
void loop(){
  long measurement =TP_init();
  delay(50);
 // Serial.print("measurment = ");
  Serial.println(measurement);
  if (measurement > 1000){
    digitalWrite(LED_Pin, HIGH);
  }
  else{
    digitalWrite(LED_Pin, LOW); 
  }
}
long TP_init(){
  delay(10);
  long measurement=pulseIn (vibr_Pin, HIGH);  //wait for the pin to get HIGH and returns measurement
  return measurement;
}

REFERENCES

VIDEO

Note: For further inquiry, please visit our technical forum as we seldom check the comment here. ?

, , , ,

Related Post

Getting Started with Colour Sensor Module (SN-COLOUR-MOD)

Getting Started with Tilt Sensor (SN-TILT)

Getting Started with IR Distance Click

Getting Started with Temperature Sensor (Celsius) (SN-LM35DZ)

Leave a Reply

Your email address will not be published. Required fields are marked *