Hi
I am using an UNO and a piezeo element connected directly between ground and A0
The additional wires (red + orange) are only being used to hold the very small Piezeo wires in place - nothing else.
My code is
int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
sensorValue = 1023-analogRead(sensorPin);
// turn the ledPin on
Serial.println(sensorValue);
delay(100);
}
This runs full speed and generally returns 0 if nothing is going on. But if I touch/tap the piezeo element it changes values say jumps to 600 and then slowly reduces back to 0.
This reduction to 0 can take 30 seconds.
I would have expected a much quicker drop to 0
If I was using this to record audio (such as a rain drop or hail) I would need much quicker reduction to 0 since one strong hail stone would be only a few ms not 30 seconds.
Any ideas on what I need to ensure a quicker drop and why it is doing this?
Could there really be that much energy being released over 30 seconds?
Chris