0
\$\begingroup\$

I am attempting to determine the frequency of an instrument from its vibration using a piezo disc and an mbed LCP1768.

I attempted this with a raspberry pi but couldn't get the sample frequency high enough to get accurate readings. I've now moved onto using an mbed which gives much higher conversion rates using less parts.

The piezo is stuck to my guitar using blue-tac and I play an E note (82Hz).

The schematic shows the set up I have. The code that runs just reads the input every millisecond and writes the values to a text file. Then I get the text file and put the values into excel and generate a graph.

schematic

simulate this circuit – Schematic created using CircuitLab

I would expect to see a very flat line where the DC offset is, before the guitar is played then a wave like format for the rest centered around the offset but I get a fluctuating offset to start with with values ranging from 1.52 and 1.48, which then jumps up to 1.65 between the first 163-358 samples and then back down again. enter image description here Can anyone explain how I can reduce the noise of the DC offset to get a more accurate signal?

Thank you.

\$\endgroup\$
  • 1
    \$\begingroup\$ I really don't like how you're generating a DC offset here. \$\endgroup\$ – Scott Seidman Dec 2 '15 at 17:09
  • \$\begingroup\$ I did try and put the offset into the op amp but the fluctuation was greatly magnified. How would I generate 1.65V in a different way? \$\endgroup\$ – JamesDonnelly Dec 2 '15 at 17:13
  • \$\begingroup\$ Try using an additional op amp. You are currently SHORTING your DC offset to the output of your op amp. That just won't work. \$\endgroup\$ – Scott Seidman Dec 2 '15 at 17:21
  • \$\begingroup\$ Also, your voltage follower can't go negative unless you provide a negative power supply to the op amp. Start over. Search for "guitar tuner circuit" and move on from there. \$\endgroup\$ – Scott Seidman Dec 2 '15 at 17:25
  • \$\begingroup\$ I intend to try Spehro's response. (I've been at work) but will something like this suitable? Swapping the guitar for the piezo of course. courses.cit.cornell.edu/ee476/FinalProjects/s2004/ddb25/… \$\endgroup\$ – JamesDonnelly Dec 2 '15 at 22:35
1
\$\begingroup\$

You could try something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

The two resistors give you the offset at about half the supply voltage. The capacitor gives a low pass filter at about 1/3 Hz. R4 helps prevent damage to the op-amp from shocking the piezo. R3 provides a DC path for U1 bias current. U1 should be a low bias current type that will work on the provided single low supply voltage, it cannot be a TL081.

\$\endgroup\$
  • \$\begingroup\$ The 100K divider might not play nice with the piezo, but it might be good enough. \$\endgroup\$ – Scott Seidman Dec 2 '15 at 17:48
  • 1
    \$\begingroup\$ It'll be fine, given that 10uF capacitor. \$\endgroup\$ – Brian Drummond Dec 2 '15 at 19:00
  • \$\begingroup\$ I will try this in a moment, but a quick question. Because I'm offsetting the signal and I want a range of 0-3.3V or as close as, that means I can power the op amp with a single power supply (+3.3V - 0V) rather than a rail-to-rail (3.3V - -3.3V) is that correct? \$\endgroup\$ – JamesDonnelly Dec 3 '15 at 16:51
  • \$\begingroup\$ Yes, assuming your ADC accepts 0..3.3V and your have an appropriate op-amp (say RRIO = rail-to-rail input and output, or close to that). In fact having a negative supply complicates things because you have to clamp possible excursions of the amplifier at something like -0.3V to protect the ADC/MCU). \$\endgroup\$ – Spehro Pefhany Dec 3 '15 at 17:45

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.