I have a problem with this "knock sensor". Piezo disc is glued to a wooden surface and it's signal is amplified by a factor of k=1M2/51k + 1 and then compared to a reference voltage on R12 using comparator.

Both op amp and comparator are in the same package, in this case LPV802.

The problem is I don't ever get high output at RB0. I suspected that maybe 1M2 for R12 is too big so I put fixed voltage divider using 10k resistors so I have 2,5V fixed voltage reference at comparator.

I measured expected output voltage from the first op amp, in the range from 0V to 3-4V depending on the force on piezo but when that 3-4V is compared to the 2,5V reference I don't get high voltage, I only get cca. 100mV when "knocking" and around 20mV when not.

I also tried combination of R11 and R10, 600k - 51k, and 600k - 25,5k. Also I replaced LPV802 dual op amp with some other opamp that are both input and output rail to rail like MCP6002 and MCP6232 but the behaviour is identical.

Zener diode is here to limit the piezo voltage to around 4,7V and it tested OK.

Also, I now know that I should have used separate comparator IC rather than op-amp but the PCB is already made and as I don't need very high speeds I don't think that should be a problem here.

Does anybody have a clue what might cause this strange behaviour?


  • \$\begingroup\$ So, you need to go back to the prototyping stage and play with it on a breadboard. Try that with a "legit" comparator chip and see where that gets you. Also, for all we know there may be an error in your PCB layout. \$\endgroup\$
    – Ian Bland
    Oct 14, 2017 at 10:49

1 Answer 1


What is the frequency of the signal from the first stage?

The LPV802 is an incredibly low power (320nA) but extremely slow opamp (8kHz). It may not come out of saturation rapidly enough for use as a comparator.

Opamps are not generally intended for use as comparators and even normal speed amplifiers may take a long time (microseconds to milliseconds) to come out of saturation.

Do you need such low power?

If not try using a faster opamp, or using a low power comparator for the second stage.

  • \$\begingroup\$ I also tried using MCP6002 that is 1MHz opamp but the result is identical. I don't know the frequency of the first opamp's output but I can record it's waveform and report back tomorow. Using a separate comparator is not an option here because the PCB is already fabricated. Only opamp + comparator in the same package and rail to rail I/O that I could find on the internet is TLV2702 but it's not available in my country. \$\endgroup\$
    – ningbo
    Oct 13, 2017 at 22:25
  • \$\begingroup\$ There is a very good chance your problem is trying to use an opamp as a comparator. Even a faster opamp, sitting hard at it's rail, is going to take some time to come out of saturation. \$\endgroup\$ Oct 13, 2017 at 22:41

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.