Piezo waterdrop sensor problem

Hi,

I have been building a device to count waterdrops from a leaky ceiling and saving the counts hourly to a sd card (Uno data logger module), as well as the temperature, humidity (DHT22) and time. I am using an Arduino-Clone.

Everything works great, but the piezo sensor. I have connected it just like I have seen on a tutorial (see the attached image), but the problem is that the analog reading is always something like 15 when the sensor is not actuated at all. I "solved" this by inserting a resistor between GND and the analog input directly on the Uno board. I first tried a relatively small resistor which resulted in a lowered analog reading, but it was still >0. After some testing I finally put in a 8k ohm resistor that results in the analog value to be 0 when it is resting steadily.

I fear that the additional resistor may lower the sensitivity of the sensor, would that be possible (sometimes a drop is not registered by the Arduinio-clone)? And I would like to know if there is a logical explanation why the sensor value is not zero.

Thanks :slight_smile:

edit: The device is powered by USB from a Notebook that is running on batteries when the analog readings of ~15 are occuring.
It might be interesting to know that I also perceived a strange behavior: When powering it by a 12V-supply through the circular connector (without the Notebook connected), the Arduino will register a "waterdrop" when I am switching off the lights in the garage.

Arduino pins and piezo sensors means high impedance, and that can easily pick up interference/mains hum.
MUST use shielded (audio) wire if the sensor wires are longer than about 10cm (4").
Try 100k load resistors (with the shielded wire).

The zener diodes are mostly useless, because they don't protect in all cases.
If you feel the need to protect the pin against the tiny piezo current (I don't),
then use two Schottky diodes to VCC/GND (ESD clamp).

Piezos produce AC, so sample often if you don't want to miss a pulse.
Leo..

My wire is not shielded but quite long, I am going to try what you proposed.

I found out that the low sensitivity of the piezo might have been the result of splash water on it. After letting it dry the analog readings of a falling waterdrop were much higher than before (about 70 instead of 2), so it might be enough to enhance the sensor casing and heighten the threshold for detecting a drop.

Why not use the classic piezo circuit:

The divider puts the piezo at mid-rail, and protects the Arduino pin from over-current, the load resistor
(here 1M) can be tuned for sensitivity - lower values reduce the voltage.

MarkT:
Why not use the classic piezo circuit:

The divider puts the piezo at mid-rail, and protects the Arduino pin from over-current, the load resistor
(here 1M) can be tuned for sensitivity - lower values reduce the voltage.

I did try this divider and it does work fine, but the result is not necessarily better than when using the diode and the shielded wire. My (new) main problem does not seem to be related to the piezo-part of the device, but to the power supply:

I had the waterdrop-counter running for about a week without problems, but since yesterday I get faulty measurements all the time (maybe due to external factors?). I then experimented with different power supplys to understand how much they would influence the analog readings.
When powerering the device by my notebook running on batteries the analog readings were perfectly stable, when plugging-in the notebook's power supply I got deviations of up to 4 (and when using non-shielded wire for the piezo sensor, the deviation increased up to 9).

I don't know how much divergence would result in using a power supply on the arduino directly, like I was planning to do, but I guess the analog readings would also fluctuate by about +/- 4. Because of the weak signal generated by a waterdrop it would be nice to have a stable reading without noise. Would it be possible to modify the power input to get a better result somehow, maybe by adding capacitors (and if so, which ones)?