• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeArduinoLinkSprite Sensor Pack 101Use Vibration Sensor on Arduino
Previous Next

Use Vibration Sensor on Arduino

Posted by: Alvin Jin , March 3, 2014

[vc_row][vc_column width=”1/1″][vc_tour][vc_tab title=”Introduction” tab_id=”1393912008-1-22″][vc_column_text]The Vibration sensors use a spring based sensor. When there is vibration, it will output a digital signal.

There are three pins: power supply, ground, and output signal.

Vibration.jpg[/vc_column_text][/vc_tab][vc_tab title=”Hardware List and Wiring Diagram” tab_id=”1393912008-2-60″][vc_column_text]Hardware:

[bigcommerce link=”/arduino-usb-board-uno-r3/” target=”_blank”]Arduino UNO R3[/bigcommerce] *1

Vibration Sensor *1

Male to female DuPont line *3

Wiring Diagram

wifi0s077794548220140304_105702

Vibration Sensor                    Arduino

VCC                                                  5V

GND                                                GND

S                                                          A0

[/vc_column_text][/vc_tab][vc_tab title=”Test code” tab_id=”1393913488995-2-7″][vc_column_text]

int sensorPin = A0;
int ledPin = 13;
int sensorValue = 0;

void setup() {
  pinMode(ledPin, OUTPUT);  
  Serial.begin(115200);
}

void loop() {
  sensorValue = analogRead(sensorPin); 
  Serial.println(sensorValue);  
  digitalWrite(ledPin, HIGH);  
  delay(100);          
  digitalWrite(ledPin, LOW);   
  delay(100);                  
}

[/vc_column_text][/vc_tab][vc_tab title=”Test result” tab_id=”1393913545525-3-9″][vc_column_text]Due to structural reasons vibration switch module requires a larger force to see the experimental results, as shown below:

xiao

When the module do not have shacking the value is larger than 360, if the value is less than 100, that means the vibration sensor is open. According to the above data, we can define that when the value is less than 80, the module is connecting; When the value is larger than 300, the module is disconnection. That can eliminate switching shacking problem.
[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]

Tags: LinkSprite Sensor Pack 101

Share!
Tweet

Alvin Jin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors