Electronic – Negative voltage ADC and op-amp

adcanalogpiezosound

I have this circuit and I am running code on the raspberry pi which checks the input pin continuously and converts the 10-bit digital signal to a readable voltage. So I can accurately see the voltage being generated.

I intend to stick the piezo disk onto an instrument to detect the note being played by the instrument this would require mimicking a sound wave so I can find the frequency and then the pitch of the note.

This is a graph showing the voltages when the E string of a guitar is played and the piezo is stuck to the body. To get a more accurate reading I would need the negative voltages. (x-axis is time and y-axis is volts)

enter image description here

The circuit only gives me values between 0-5v (0-1023), however, a sound wave would have negative voltage. Could anyone explain to me how I would alter my circuit to give readings between -5v -> +5v instead of 0-5v.

I have read this link and a few others : Read Positive and Negative Voltage in Arduino
but don't fully understand how they work.

Also, the datasheet recommends using an op-amp to buffer, filter and gain the original signal, but I am already getting 5V readings when I hit the piezo so could someone explain to me what an op-amp would do to my readings (other than amplify them)?

Also, can anyone tell me when I have a 0.02V reading all the time?

Thank you.

schematic

simulate this circuit – Schematic created using CircuitLab

Datasheet for the ADC: http://www.ee.ic.ac.uk/pcheung/teaching/ee2_digital/MCP3002.pdf

Piezo I am using: https://www.sparkfun.com/products/10293

Best Answer

Also, can anyone tell me when I have a 0.02V reading all the time?

This is likely the basic error in the ADC when connected to a source of very high impedance (1Mohm in parallel with the piezo). It is likely that ADC "doesn't like" high impedance signals and also any input bias currents will create a sizable DC error as you have seen. This is what the data sheet says: -

For the A/D converter to meet specification, the charge holding capacitor (CSAMPLE) must be given enough time to acquire a 10-bit accurate voltage level during the 1.5 clock cycle sampling period. The analog input model is shown in Figure 4-1. In this diagram, it is shown that the source impedance (RS) adds to the internal sampling switch (RSS) impedance, directly affecting the time that is required to charge the capacitor, CSAMPLE. Consequently, larger source impedances increase the offset, gain, and integral linearity errors of the conversion. Ideally, the impedance of the signal source should be near zero. This is achievable with an operational amplifier such as the MCP601 which has a closed loop output impedance of tens of ohms. The adverse affects of higher source impedances are shown in Figure 4-2.

As for centralizing the signal, and assuming 1Mohm shunt resistor, split it into 2x 2Mohm resistors; one to ground and one to the reference voltage used by the ADC. You might also consider putting a 1 kohm resistor in series with the ADC input pin because, from what you said in your question, there could be significant voltages produced by the piezo and the 1 kohm would off some protection.