Page 4
Under the supervision of Seeed Technology Inc., this manual has been compiled and published which covered the latest product description and specification. The content of this manual is subject to change without notice.
1. Introduction Grove - Collision Sensor can detect whether any collision movement or vibration happens. It will output a low pulse signal when vibration is detected. To make the output signal more reliable and neat, we added a necessary exterior circuit to reduce the noise impact. So, normal shaking will not cause any output. The sensor has a high sensitivity, then you can use it to apply to your project, such as automatic wake-up and power-down for battery management.
3. Demonstration With Arduino Based on the output signal will change when a collision happens, we design this demo: each time the sensor detects collision, the LED will light up. Here the LED is as a managed device, and you can refer to the demo to control your device, such as bicycle light.
Page 8
void loop() if(isTriggered()) turnOnLED(); delay(2000); else turnOffLED(); void pins_init() pinMode(LED,OUTPUT); turnOffLED(); pinMode(COLLISION_SENSOR,INPUT); boolean isTriggered() if(!digitalRead(COLLISION_SENSOR)) delay(50); if(!digitalRead(COLLISION_SENSOR)) return true;//the collision sensor triggers return false; void turnOnLED() digitalWrite(LED,HIGH);//the LED is on void turnOffLED() digitalWrite(LED,LOW);//the LED is off 5. Now you can check the status of LED. The LED should light up every time you drum fingers on the table. You can adjust the sensor sensitivity by changing the function delay(50) in code.
return false; With Raspberry Pi You should have got a raspberry pi and a grovepi or grovepi+. You should have completed configuring the development environment, otherwise follow here. Connection. Plug the sensor to grovepi socket D2 by using a grove cable. Navigate to the demos' directory: cd yourpath/GrovePi/Software/Python/ To see the code...
Need help?
Do you have a question about the Grove 101020005 and is the answer not in the manual?
Questions and answers