In another thread I showed this circuit:
This is supposed to be a peak detector. The piezo creates one pulse (due to a hit on a board by a ball). The capacitor C1 gets charged and holds the voltage. Then Micro:bit reads the voltage at P0 and resets the voltage with a signal from P3. My problem is that a shock from the piezo raises the voltage only a bit. Next shock raises it again, and again and again. The cap is probably too big, the piezo obviously delivers only a very small charge, though the voltage is probably rather high, some 5 V.
So my first question is how to figure out the proper size of the cap. It should reach the max voltage with only one pulse from the piezo (or any lower voltage, if the shock on the piezo is smaller).
My second question is to figure out why there's a continuous raise of the voltage at C1, even if there's no piezo activity. Only sources are P0 and the piezo. The piezo might produce a voltage due to sound, or it just lying somewhere, where there's mechanical vibration. How could I stop leak into the cap from anywhere else, when I'm only interested in the piezo pulse?
This is supposed to be a peak detector. The piezo creates one pulse (due to a hit on a board by a ball). The capacitor C1 gets charged and holds the voltage. Then Micro:bit reads the voltage at P0 and resets the voltage with a signal from P3. My problem is that a shock from the piezo raises the voltage only a bit. Next shock raises it again, and again and again. The cap is probably too big, the piezo obviously delivers only a very small charge, though the voltage is probably rather high, some 5 V.
So my first question is how to figure out the proper size of the cap. It should reach the max voltage with only one pulse from the piezo (or any lower voltage, if the shock on the piezo is smaller).
My second question is to figure out why there's a continuous raise of the voltage at C1, even if there's no piezo activity. Only sources are P0 and the piezo. The piezo might produce a voltage due to sound, or it just lying somewhere, where there's mechanical vibration. How could I stop leak into the cap from anywhere else, when I'm only interested in the piezo pulse?