IDUINO DEBO SEN3 VIBRA Datasheet

Page 1
IDUINO for Maker’s life
www.openplatform.cc
Easy Vibration Shock module(SE025)
1 Introduction
This module is a shock switch module, and if it can detect a jolt ,it output low level signal. It’ similar with the Vibration Shock module (SE053), the difference is that this module has one indicator light, which would be on when this module’s voltage signal is changed. And, this module has integrated 3-pin terminal, which can be simply and tidily connected with Arduino sensor expansion board, like the following picture:
Specification
Operation voltage: 5V With 3-Pin Jumper Size:25*15mm Weight: 6g
2 Pinout
Pin
Description
OUT
If the sensor detect a jolt, this pin output low level signal
VCC
Power
Page 2
IDUINO for Maker’s life
www.openplatform.cc
GND
Ground
3.Example
This example show you how to use this module, connection as below, and upload the sketch, open the serial monitor session, see how it will go~
Example code :
******Code begin******
int shockPin = 10; // Use Pin 10 as our Input int shockVal = HIGH; // This is where we record our shock measurement boolean bAlarm = false;
unsigned long lastShockTime; // Record the time that we measured a shock
int shockAlarmTime = 250; // Number of milli seconds to keep the shock alarm high void setup () { Serial.begin(9600); pinMode (shockPin, INPUT) ; // input from the KY-002 } void loop ()
Page 3
IDUINO for Maker’s life
www.openplatform.cc
{ shockVal = digitalRead (shockPin) ; // read the value from our sensor
if (shockVal == LOW) // If we're in an alarm state { lastShockTime = millis(); // record the time of the shock
if (!bAlarm){ Serial.println("IDUINO Shock module"); bAlarm = true; } } else { if( (millis()-lastShockTime) > shockAlarmTime && bAlarm){ Serial.println("no alarm"); bAlarm = false; } } }
******Code End******
Loading...