You can set an alarm by accessing menu -> “Clock” -> Select “New” in “Alarm” -> “Time” -> Select time -> “SAVE” -> Select “Repeat/Sound/Vibrate ...
It act like a normal open switch. When it senses vibration, the terminals touches together and create a short circuit. This sample code read value of sensor and if it detect "HIGH" or the vibration ...