Hello,
I am building a guitar tuner using a PIC18F452. My tuning algorithm works great, and can accurately tune notes when the input is a sine (or square) wave from a generator. The input wave needs to swing high enough so that the PIC can recognize it as logic level 1 on an input pin, and it also needs to swing low enough that the PIC can recognize logic level 0. Essentially I am implementing a Schmitt trigger in software and using TMR0 to count the time for one period and use a look-up table to compare to known values for notes.
Now the problem becomes, how do I actually get an audio signal from an instrument, say an electric guitar's pickup output, into the PIC and amplify the signal enough so the PIC will recognize logic levels? When I connect the pickup output from my guitar to a scope, the pk-pk is only about 50mV. What can I use to jack up the gain, keeping in mind that I don't care about distortion, clipping, or degradation of signal quality? All I need is to turn the guitar output into a sine/square wave that has a high enough amplitude for the PIC to read logic 1 and 0. At that point my algorithm will kick in and be able to measure the frequency.
Any ideas? I have been toying with rail-rail op-amps, NPN common emitter amplifiers, etc, but no luck so far. I am running off a +5V power supply.
Thanks, responses are very much appreciated! Let me know if more information is needed.
I am building a guitar tuner using a PIC18F452. My tuning algorithm works great, and can accurately tune notes when the input is a sine (or square) wave from a generator. The input wave needs to swing high enough so that the PIC can recognize it as logic level 1 on an input pin, and it also needs to swing low enough that the PIC can recognize logic level 0. Essentially I am implementing a Schmitt trigger in software and using TMR0 to count the time for one period and use a look-up table to compare to known values for notes.
Now the problem becomes, how do I actually get an audio signal from an instrument, say an electric guitar's pickup output, into the PIC and amplify the signal enough so the PIC will recognize logic levels? When I connect the pickup output from my guitar to a scope, the pk-pk is only about 50mV. What can I use to jack up the gain, keeping in mind that I don't care about distortion, clipping, or degradation of signal quality? All I need is to turn the guitar output into a sine/square wave that has a high enough amplitude for the PIC to read logic 1 and 0. At that point my algorithm will kick in and be able to measure the frequency.
Any ideas? I have been toying with rail-rail op-amps, NPN common emitter amplifiers, etc, but no luck so far. I am running off a +5V power supply.
Thanks, responses are very much appreciated! Let me know if more information is needed.