I realise I am asking what might seem to be a fairly common question here, at least I have found this question online several times, but really never / rarely an answer with some sort of follow-up which could make me conclude that the solution is valid for my instance.

The idea is simple, I wish to make a knock sensor to detect a fairly substantial knock (hit airsoft pellet). Since piezo disk can create (very) high, amounts of Voltage I need to protect my microcontroller board against over-voltage on the pin. (so far fairly common)

The general solution is to place a resistor between the VCC and ground, to disipate the energy. Oke I see the value there, but it would leave a lot of questions.

  1. What ohm resistor, to disipate what voltage, or what formula to calculate this with? In theory I can calculate the energy in the pellet, but that still doesn't give me the energy it would dissipate on the shot plate with the piezo element attached. And then again, what amount of this mechanical energy would be transfered into electrical energy. I could test it out, but for that I feel like I would end up in a chicken/egg problem. So the first ?-mark.

  2. The voltage the piezo disk would create would depend on the disk itself, unfortunately the disks generally do not come with much specifics, so this leaves another ?-mark.

  3. Also I believe that using merely a resistor would, decrease the the practical resolution it would detect, because it would basically dissipate the DC part of the AC+DC output to a certain extent. Please correct me if am wrong here. But I would like to use this value to basically detect the quality hit on the shot plate, so the detection resolution is also important to me.

Instead I would like to use some sort of scale-down of the output voltage, Just cutting a DC part sway from the siganel. This way it would "normalise" the output to set the expected (this would still need to be carefully tested one way or another) max. output voltage + a margin back to 3.3 V of the microcontroller which can accept a max. of 3.6 V so there is a small margin still there, which should then be translated to the 12-bit value of the ADC.

Currently I use a sw-420 based, AliExpress sensor module, which delivers a digital signal so I lose all hit "Quality" information.

I have found piezo disks with modules connected to it with a r105 resistor and a diode, so this seems to me similar to the original solution, additionally for Arduino whose pins are 5 V, so also not the safest solution for a guaranteed protection against over voltage on my 3.3 V based board (Wemos ESP32 S2 Mini)

For the more "complex" solutions provided online there usually is not much or any follow up, and many different approaches from multiple diodes to entire networks with transistors in one form or another.

Is there a more advanced standard solution / schematic for a problem like this, and if not, where would I start creating one? As I do not have the faintest idea any help, guidance, and direction would be much appreciated.

  • 2
    \$\begingroup\$ Generally there’s two considerations - scaling the voltage and clamping in order to protect the adc input. For clamping, use a rail to rail clamp using two diodes in series as a totem pole. Gnd to the bottom anode, vcc to the top cathode and the adc signal in the middle. As for scaling, without hard specs it is a guess. I’d suggest using you PC’s sound card as an oscilloscope and tweak the scaling resistors until you get useful readings. There’s examples of electronic drum circuits on the web that might be useful as they do much the same as what you want. \$\endgroup\$
    – Kartman
    Jan 1, 2023 at 23:59
  • 1
    \$\begingroup\$ You could ‘calibrate’ your sensors by dropping something like a ball bearing of known weight from a given height onto the piezo disk. F=MA will give you the force applied so try different drop heights and tabulate the voltage from the sensor. That should give you a fairly repeatable reference. \$\endgroup\$
    – Kartman
    Jan 2, 2023 at 0:05
  • \$\begingroup\$ Thank you kartman, Very informative.. specially together with Qrk's comments and schematics. I will also look specifically at those drum schematics you mentioned but I feel this is indeed the right way to go as both came with comparable thought and also things I had seen before.. \$\endgroup\$ Jan 2, 2023 at 1:14
  • 1
    \$\begingroup\$ I'm not familiar with piezos but what if you collected the pulse into a capacitor and then measured the charge level using the voltage? \$\endgroup\$ Jan 3, 2023 at 8:15
  • \$\begingroup\$ sounds like a simple an interesting approach, but as most capacitors can't handle the high voltages a piezo delivers it seems like i would blow out the capacitor. Please correct me if i am wrong with this assumption. \$\endgroup\$ Jan 3, 2023 at 14:35

1 Answer 1


You can used reversed biased diodes to clip the output as shown in the diagram below. You can use small signal diodes like a 1N4148 or small signal schottky diodes. The voltage divider resistors set the clipping level and can be in the kilo-ohm range. Be sure to take in to consideration the forward voltage drop of the diodes.

Example, VCC = 5V, VEE = -5V. Lets say you want to clip at ±3V. Assume the forward voltage drop of the diodes are 0.5V (silicon diode Vf is in the range of 0.5 to 0.7V depending on current). Thus, you want voltage divider to give a voltage of 2.5V (2.5 + 0.5 = 3V). Using 10k resistors would work fine for this application.

The capacitors are important as they will absorb the over voltage impulse. The capacitors should be at least 100 times larger than the simple capacitance of the transducer.


If the input is unipolar, you can use the same sort of clipper, but shift things above zero volts as shown in the simulation below.
There are four cases shown here with 0.5, 1, 2, and 5 volt peak sine waves for the input signal. The 2 and 5 volt peak waveforms are clipped. You can play with the resistors to suit your needs (bias level, clipping threshold).

C1 and V1 form the simulated piezo electric transducer which is a reasonable low frequency model approximation. The value of C1 (the transducer simple capacitance) needs to be measured using a capacitance meter that uses a frequency less than 0.1 x the resonant frequency of the transducer.

C2 (optional) forms a capacitive voltage divider with the simple capacitance (C1) of the transducer. C2 can be used to lower output voltage (the sensitivity) of the transducer.

enter image description here
LTspice simulation of a unipolar clipper circuit.

  • \$\begingroup\$ Hey Qrk, thank you for this. Sounds good, looked also at the posts from kartman (thank you too kartman) and did recognise his 'totem' of diodes and understand the resistor / capacitor, part.. but do not really understand the physical connection part. \$\endgroup\$ Jan 2, 2023 at 1:06
  • \$\begingroup\$ I think the Amplifier is the Piezo, right... where this cirquit is placed between the connection pin op the board and the piezo element on the red wire (say it this way, to not confuse the Vcc as its drawn in your schematics) and the black to the Ground/Common. which is two wires.... But from your schematics I see Vcc = red, Vee = Black. but then I still have the amplifer. but as said this piezo has only two wires. not a Vcc / Gnd / Din as an Digital sensor. I am probably to tired.. so I will look at it again tomorrow to see if I get it then. but for now I am confused. \$\endgroup\$ Jan 2, 2023 at 1:12
  • \$\begingroup\$ @MatthieuKintsvan The piezo transducer is the symbol with the reference XTAL1 (standard symbol for a piezo electric transducer). The Amplifier is the electronics that processes the signal from the transducer. The circuitry between the transducer and amplifier is the protection network, a simple clipper circuit. For completeness, I should have added a resistor from the amplifier input to ground, probably in the order of 1 megohm to bleed off the DC charge that can develop across the transducer due to changes in temperature and bias the amplifier circuit. \$\endgroup\$
    – qrk
    Jan 2, 2023 at 19:20
  • \$\begingroup\$ Thank you so much again for your response! I googled XTAL and it was answered as “pins connected to an external oscillator (generally a quartz crystal oscillator)” so this confused me. If the “amplifier” is a pin on the ESP32 board, with the mentioned resistor to ground, then this knowledge confuses me in another way.. Where do the Vcc / Vee respectively come from? Is this an external power source? In my case I have indeed + 5v but not a -5v, only ground. I wish to build this circuit to test responses with an oscilloscope before attaching it all to any board, to understand the response. \$\endgroup\$ Jan 3, 2023 at 3:39
  • \$\begingroup\$ @MatthieuKintsvan A crystal used in oscillators is a high-Q piezo electric device which is why a crystal schematic symbol is used for a piezo electric transducer. VCC and VEE are standard nomenclature for power supplies. VCC is the positive supply (supplying power to the collector of a transistor), VEE is the negative supply (supplying power to the emitter of a transistor). There are integrated circuits to create a negative supply voltage from a positive voltage. \$\endgroup\$
    – qrk
    Jan 3, 2023 at 4:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.