I'm making a musical instrument, where you pluck "teeth" which have piezo disc sensors attached to them, and I want to get the output of the piezo into a microcontroller so I can interpret it and trigger musical notes:
I'm using a Teensy 4.0, which has 14 ADCs, and I'll have 13 parallel piezo circuits. I'm a software engineer, so once I get the signal into the microcontroller I think I know what to do, but the electrical engineering I'm less sure about.
Here's the idea I have for the circuit, though I've drawn it with only one piezo for simplicity:
The idea is that the Teensy's ADC reads from 0V to whatever you put on the V_REF pin, so I'll send 5V to the V_REF and the use R1 and R2 to make a voltage divider to bias the piezo up by 2.5V. I've measured the piezo output, and they're just about in the right range, but if you hit it quite hard it can make very large (positive or negative voltages) which I think I need to protect the microcontroller from. So I've put a pair of diodes (D1, D2) on the other side of the piezo so that if the voltage goes above 5V or below 0V they send the excess out.
Before I build this and risk wrecking my Teensy if I got it wrong, does this look right? And are Schottky diodes a good choice for D1 and D2?
EDIT 2024-03-29: here's an updated schematic taking into account the feedback from Justme:
I've lowered the voltage reference to 3.3V, marked the R1 and R2 voltage divider resistors 10k, and added a 1M resistor in parallel with the piezo.
I'll try this circuit out feeding an oscilloscope before I try it with the Teensy.
EDIT 2024-03-31: I've made a new circuit to take into account that the diodes are not perfect. Now there's a margin, both positive and negative:
I also switched it from an external voltage reference to the microcontrollers 3.3 volt pin.
After testing with the oscilloscope I connected it to the microcontroller, and I'm getting good results! Here is the signal as observed by the ADC: