Ks0037 keyestudio Vibration Sensor: Difference between revisions

From Keyestudio Wiki
Jump to navigation Jump to search
Line 60: Line 60:
*[https://www.keyestudio.com/free-shippingkeyestudio-vibration-sensor-module-for-arduino-p0155.html  '''Official Website''' ]
*[https://www.keyestudio.com/free-shippingkeyestudio-vibration-sensor-module-for-arduino-p0155.html  '''Official Website''' ]


*[https://www.aliexpress.com/store/product/Free-shipping-Robot-801S-vibration-sensor-vibration-model-analog-output-sensitivity-adjustable-2-pieces-lot/1452162_2051498162.html?spm=2114.12010612.8148356.57.29bd7498iQQUVn  Shop on aliexpress]
*[https://www.aliexpress.com/store/product/Free-shipping-Robot-801S-vibration-sensor-vibration-model-analog-output-sensitivity-adjustable-2-pieces-lot/1452162_2051498162.html?spm=2114.12010612.8148356.57.29bd7498iQQUVn  '''Shop on aliexpress''']




[[Category: Sensor]]
[[Category: Sensor]]

Revision as of 10:27, 15 April 2019


Introduction

What's the simplest way to check vibration with Arduino? Well, use a vibration sensor from keyestudio.
You can directly plug it on our sensor Shield V5, vibrate this sensor, and Arduino can receive a digital signal, making it easy to make computation and programs in Arduino.
Despite its simplicity, you can make full use of it with creative thinking, step counting and crash warning light, etc. 
thumb


Specification

  • IO Type: Digital
  • Supply Voltage: 3.3V to 5V


Connection Diagram


thumb


Sample Code

#define SensorLED     13
#define SensorINPUT   3  //Connect the sensor to digital Pin 3 which is Interrupts 1.
 unsigned char state = 0;
 void setup() 
{ 
  pinMode(SensorLED, OUTPUT); 
  pinMode(SensorINPUT, INPUT);
  attachInterrupt(1, blink, FALLING);// Trigger the blink function when the falling edge is detected
  }
void loop()
{  if(state!=0)
      {
        state = 0;
        digitalWrite(SensorLED,HIGH);
        delay(500);
      }  
      else
        digitalWrite(SensorLED,LOW);
} 
void blink()//Interrupts function
{  state++;
}


Resources

  • Video

http://video.keyestudio.com/ks0037/

  • PDF

https://drive.google.com/open?id=1TW4nQdJhwbk32XirPeBe0Z9cmswg8DMM


Buy from