I am trying to make a pressure sensor to use with my raspberry pi zero. I would like to avoid making another purchase, so while an ADC or FSR would be easier I would like to figure this method out.

Basically, I am trying to read a change in pressure using a piezo transducer on my raspberry pi. This is problematic because Pi is digital, and I cant measure voltage change accurately.

However, I found this method of measuring capacitance (using timer): this article

I was wondering if I would be able to use the piezo transducer as a capacitor whose capacitance is dependent on pressure change.

Here is a diagram of the ciruit I have in mind:


simulate this circuit – Schematic created using CircuitLab

Would this possibly work?

  • \$\begingroup\$ piezo is not a thing to be used like capacitor. I don't think its gonna work. \$\endgroup\$ – Alper91 Jun 16 '16 at 21:50
  • \$\begingroup\$ Piezo transducers give a voltage output proportional to the rate of change of pressure / flexing / strain or whatever. It doesn't work the way you seem to think. Read up on it and edit your question in the light of your research. \$\endgroup\$ – Transistor Jun 16 '16 at 22:43
  • \$\begingroup\$ I realize that they operate on a change in pressure, however, i'm hoping that the voltage created by this will create a capacitive effect on the circuit. Is this possible? I was able to detect quick impulses (very slight even), however, steadily increasing pressure isn't noticed. \$\endgroup\$ – axwege Jun 16 '16 at 23:22
  • \$\begingroup\$ What has your extended research shown you? ;^) What sort of capacitance value do you think the piezo has? If this method even worked what discharge time constant would you have between the piezo and your analog input? How would it both generate and store charge? (Hint, it would have to have a built in rectifier as well.) You are using the wrong transducer for your task. \$\endgroup\$ – Transistor Jun 17 '16 at 8:18

I was able to measure a rate of change in pressure using a similar circuit to this. I replaced r2 in the circuit with a 40k pot, and after much calibration was able to detect the scale of pressure depending on the time values between high voltages (above1.3v) on the gpio pin. However, I achieved hardly any resolution due to horrendous noise problems, as well as the fact that the piezo is not a capacitor (as people commented) and I was essentially just scaling the piezo's voltage response. Basically, it works as a knock sensor, not as intended.

  • \$\begingroup\$ Thanks for the update. The piezo "knock sensor" was (and probably still is) used in some electronic drum kits. \$\endgroup\$ – Transistor Jun 19 '16 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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