2
\$\begingroup\$

Okay, so I posted this question before but my design has changed and has become unmanageable.

I am attempting to create an electric tuner device which uses a piezo disk to accurately measure the vibration of a guitar. The piezo's voltage is passed through an op-amp to buffer it and convert it from a high to a low impedance signal.

The op-amp is connected to the ADC which converts it for the digital-only raspberry pi.

schematic

simulate this circuit – Schematic created using CircuitLab The raspberry pi then uses the data and creates a graph.

At the moment when I plug it in I expect to see 0 voltage and then whenever vibration is made the voltage to only increase and return to 0. like a waveform cut down the middle. However, I get incredibly erroneous results and spikes. Shown below. enter image description here

It might add some clarity, here is what the setup looks like. From the top is the Rpi Cobbler, ADC, Op-amp, piezo and pull-down resistor and the voltage regulator ensuring 5.09V from the battery.

On the bottom right-hand side rails is the 5.09V, the top right is 5V and top left is 3.3V (The colours are inverted because of the pin configuration of the cobbler so blue is actually positive on that rail.) I'm not using the 5V to power the ADC because the actual voltage fluctuated making it useless for a Reference. enter image description here

Any suggestions are welcome at this stage, it's been driving me crazy for a few days.

Cheers.

\$\endgroup\$
  • \$\begingroup\$ Can you post a schematic? \$\endgroup\$ – HighInBC Oct 22 '15 at 14:36
  • \$\begingroup\$ Schematic at the top :) \$\endgroup\$ – JamesDonnelly Oct 22 '15 at 14:40
  • \$\begingroup\$ At first glance: you've got no gain in your circuit, and a piezo is a very small-signal device. And your input is biased - extremely weakly - to 5.09V, so that's where it's going to settle without input. Biasing it to VCC/2 and amplifying it would probably make more sense. \$\endgroup\$ – Nick Johnson Oct 22 '15 at 14:49
  • 1
    \$\begingroup\$ Out of curiosity, though - why not just use a sound card? \$\endgroup\$ – Nick Johnson Oct 22 '15 at 14:50
  • \$\begingroup\$ It is impossible to see at the breadboard but it looks like GND of the opamp is different than GND of everything else on the breadboard, is that intended? \$\endgroup\$ – PlasmaHH Oct 22 '15 at 14:52
1
\$\begingroup\$

Your battery does not share a common ground with the rest of your circuit. Its negative end is connected to the ADC's ground, but neither it nor the ADC ground are connected to the ground everything else references. Without a common ground reference, you're not going to get sensible results

If all you want is a stable voltage reference, you don't need to use a battery - you can use a high accuracy voltage regulator or precision voltage reference powered from the system's 5v supply. In either event, connect all grounds together.

You'll also want to bias your piezo element to half the reference voltage, with a resistor divider, so it has a resting point in the middle of your ADC's range.

\$\endgroup\$
  • \$\begingroup\$ The negative battery is connected to the negative rail on the bottom right. Does this not simulate a common ground (everything but the op-amp) is connected to it. I tried to bias it but it wouldn't work properly so I thought I'd get the piezo reading first. \$\endgroup\$ – JamesDonnelly Oct 22 '15 at 15:37
  • \$\begingroup\$ @JamesDonnelly In your schematic, the negative terminal of the battery connects only to CH1 and VSS of the battery, nothing else. And no, you can't get your measurements first and get biasing right later - the biasing affects the measurements! \$\endgroup\$ – Nick Johnson Oct 22 '15 at 15:47
  • \$\begingroup\$ So if I connected the op-amp to the 5V rail and ground all of the components would share a common ground and it should work correctly? I have previously tried to bias the signal but I didn't get a constant 2.5v I got a fluctuation between 2.4-2.6V which makes it useless. That's why I've changed over to using a voltage regulator and the battery because the 5V connection on the RPi seemed unstable for a Ref voltage. \$\endgroup\$ – JamesDonnelly Oct 22 '15 at 16:04
  • \$\begingroup\$ @JamesDonnelly If by that you mean connecting OA1 GND, U3 GND, RPi GND and the battery negative terminal together then yes, that is what you should do. RPi's 5v out may well be unreliable as a reference voltage - but the correct solution is to use a regulator or a voltage reference IC powered from that 5v rail - you don't need to use a separate battery. \$\endgroup\$ – Nick Johnson Oct 22 '15 at 16:17
  • \$\begingroup\$ Why does the DC level of the bias matter, though? If you're using this as a microphone, you can filter out very low frequency variation and just end up with the components you care about. \$\endgroup\$ – Nick Johnson Oct 22 '15 at 16:18
1
\$\begingroup\$

When you are starting in electronics you often build the whole circuit, find it doesn't' work, and then wonder what went wrong. (At least I made that mistake in the past.) Now days I get one piece at a time up and running and then put the pieces together. I'd start with the piezo pickup. Search for a better schematic.
This looks OK but I haven't tried it. http://cdo.seymourduncan.com/blog/wp-content/uploads/chargeamp.gif

Do you have a 'scope? You'll need some way to see your signal.

\$\endgroup\$
  • \$\begingroup\$ I don't have an oscilloscope, no. But I may try and make this circuit and put the ADC at the output. Thank you \$\endgroup\$ – JamesDonnelly Oct 22 '15 at 16:10
  • \$\begingroup\$ @JamesDonnelly, If you are serious about electronics you'll need a 'scope. Till then you can use the sound card on your computer.. that should work fine for your signals... search for "sound card as oscilloscope". \$\endgroup\$ – George Herold Oct 22 '15 at 16:48

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.