Datasheet
5
4. Usage
4.1 With Arduino
The Grove - Piezo Vibration Sensor outputs a logic HIHG when vibration was detected. We can
use any of Arduino pins to read the data. Here is an example of Piezo Vibration Sensor
controlling LED. When the vibration was detected, this sensor outputs a logic high signal ( the
sensitivity can be changed by adjusting the potentiometer), an LED lights up.
Note: It may output low level even though originally output high level when you increase the
threshold voltage by clockwise adjusting the potentiometer.
1. Connect the module to the Analog port 0 of base shield using the 4-pin grove cable and
connect LED to Pin 12.
2. Plug the Grove - Basic Shield into Arduino.
3. Connect Arduino to PC by using a USB cable.
4. Copy and paste code below to a new Arduino sketch. Please click here if you do not know how
to upload.
const int ledPin=12;
void setup() {
Serial.begin(9600);
pinMode(ledPin,OUTPUT);
}
void loop() {
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(1000);
if(sensorValue==1023)
{
digitalWrite(ledPin,HIGH);
}
else
{
digitalWrite(ledPin,LOW);
}
}
5. Touch the piezo sensor to make it vibrate, of course, any way to make it vibrate would be OK
too. The LED would be on when vibration detected. You can also Open the serial monitor to see
the sensor outputs.










