Step 8: Building the circuit
Remove these ads by
Signing Up
Remove these ads by
Signing Up
PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format.
You also have the ability to customize your PDF download.
But I was just wondering, why not just use a diode?
What this circuit does is to halve the input voltage using a voltage divider, then use an opamp / transistor buffer to provide a constant voltage at that level (roughly 2.5 volts). Then when the voltage from the piezo goes negative, it's relative to that 2.5 volt false ground, not to the ground of the arduino.
The program on the arduino does a short calibration when it starts up to work out what the resting voltage from each piezo is. That value is then subtracted from each reading.
There might be better / simpler ways of doing this, but that's the way I did it in my first version, which I'm still using, and it seems to work ok.
I've taken another look at the circuit and brought up the datasheet for the TS912 and noticed a problem. In your schematic you have your ~2.5V output of the voltage divider section going into pin 1 of the TS912. According to the datasheet below, pin 1 is for output....are the pin numbers just incorrect in your schematic, or did you use a slightly different chip?
http://www.st.com/stonline/products/literature/ds/2325/ts912.pdf
Did you also happen to change the resistor values across each piezo from 10M to 1M? Or am I remembering it wrong?
The 2.5v divider should be feeding into the non-inverting input of the op-amp (pin 3), the feedback from the resistor should be on the inverting input (pin 2), and the output to the piezos should be on pin 1. It wouldn't hurt as well to put a high value electrolytic capacitor (100 uf?) across the 100 ohm resistor to make sure that the current into the piezos isn't drawing the ~2.5V rail up or down in voltage.
I had one question: I wasn't able to find the TS912 op-amp locally, but instead found the TL082. The package is labelled "Dual BiFET Op Amp", and here's some specs:
http://www.national.com/mpf/TL/TL082.html
Do you think that would work as a replacement?
Bear in mind that just using this circuit won't make your system more reliable - the reason for creating a 2.5v reference level like this is so that the firmware can detect both positive and negative going pulses from the piezos. Apart from that it will work pretty much like the simple input circuit you are using. Are you using shielded cable for the connection between the piezos and the arduino? This would help with reducing interference.
That opamp might work, but I'm not sure. It looks from the datasheet like it's designed for a higher voltage application, with split power supplies. The useful thing about the TS912 is it is 'rail to rail', which means that its input and output voltage ranges go right from the positive to the negative supply voltages. Also it's designed for low voltage applications (2.7 V minimum).
This isn't a very demanding use for an opamp, but it does need to be able to provide an output voltage of about 3.1V to drive the transistor. I'm not sure from the datasheet whether the TL082 will do that off a 5v single rail supply.
If you search for a general purpose rail to rail op-amp, you should find something that does the trick.