Knock sensor - analogRead unstable

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
gabvoir
Posts: 7
Joined: 26 Jun 2017 21:34

Knock sensor - analogRead unstable

Post by gabvoir »

Hello,

I would like to make a knock switch.
I apply the official Arduino tutorial :
https://www.arduino.cc/en/Tutorial/Knock
Unfortunately i'm blocked by an analogRead issue.

Firstly I think it was due to my piezo sensor, but I change, same thing.
Finally, I realized that even the pull-down resistor between analog pin and ground, the analogRead function return an unstable zero when i disconnect piezo.

Have you an idea to solve this problem ?

Thank's for helping !

Gabvoir
p0lyg0n1
Posts: 242
Joined: 04 Aug 2016 07:14

Re: Knock sensor - analogRead unstable

Post by p0lyg0n1 »

Hi,
looks like 1MOhm is too large. Try 100-200K instead of this. Piezo will give you a pulse, so may be there is a problem with this width... If the pulse is too short (<10ms) it's realy a kind of problem to catch that inside poll function. You can make it wider by means of capacitor. The good practice for that is use of oscilloscope for the raw signal to understand the output characteristics of your piezo. What firmware version do you use? Can you give me your piezo part number?
Post Reply