Using the LDT0-028K piezo sensor to detect water impact


I bought a LDTO-028K (Piezo Vibration Sensor - Large - SEN-09196 - SparkFun Electronics)
I want to use it in a situation to detect water falling on a surface. Water falls from a height of 10 inches onto a surface below which this piezo sensor is stuck. I have connected a 1M resitor in parallel to the sensor and I get readings when water hits the surface and I light an LED using that data.

My problem is the LED keeps blinking. How do i get a stable on/off like situation when water falls on the surface and when it does not. I tried some debouncing but that does not seem to work.

My code is very straight forward :
int sensorPin = A0;
int ledPin = 13;
int sensorValue = 0;

void setup() {
pinMode(ledPin, OUTPUT);

void loop() {
sensorValue = analogRead(sensorPin);
if (sensorValue >70){
digitalWrite(ledPin, HIGH);

digitalWrite(ledPin, LOW);

Anyone has any clues?

Thank you

Have you read through the technical manual and comments on the Spark Fun product page? There are lots of useful details and suggestions.

Have you tried increasing the value 70 in that code? Using a higher value will decrease the sensitivity. Hopefully, you will find a value that is sensitive enough to detect the falling water, but not sensitive enough to pick up noise.

Unless the wires between the transducer and Arduino are very short, use shielded cable to connect the sensor to the Arduino.