Detecting Frequency w/ PBasic Stamp
Austic
Posts: 2
Hey guys, I'm a student at Louisiana Tech and I'm looking for some help on one of my engineering projects. My project involves using the Board of Education with the PBasic stamp to detect the frequency of a guitar/bass and have an LED light up based on a specific note played. The method I tried was to use the pulscount command to try to capture the time that the note played would remain over the voltage threshold (which is what the count command measures), but I cannot find a specific pattern to use for a note. Is there a way I can measure frequency via patch cable in a guitar or bass?
Comments
Well, sort of. You can measure frequency using the COUNT statement, but you need pulses that cross the 0->1 voltage threshold of the Stamp. What's available from the guitar pickup? I doubt that the pickup produces what you need. There are a lot of harmonics in any signal from a stringed instrument. What are you going to do about those? The COUNT statement will count the signal transitions of the harmonics too. Have you looked at the signal using a 'scope?
Bean
Both Mr. Green and Bean have offered some useful insight.
The notes from pluckinig an open string are chock full of harmonics which need to be filtered.
One way to do this is to construct a low pass filter for each string's fundamental frequency, then manually switch those filters in/out as needed when measuring a particular string. You've seen the tuners with a slide switch for each note? That's what's being done.
The output of typical guitar and bass pickups (non-powered type, not EMGs) is in the range of 200mV to 400mV, far below the Stamp's threshold for the COUNT statement. Using an op-amp to buffer and gain the signal would be required. You could run the op-amp with no feedback (gain) resistors and that would force the op-amp output to swing from rail-to-rail, creating a reasonable square wave that the Stamp could easily detect.
Regards
Do a Google search on:
Basic Stamp Guitar tuner site:forums.parallax.com
This brings up a few threads, and shows some OpAmp front ends that people have used.
Jim
[guitar signal] -> [filter] -> [freq-to-volt converter] -> [A/D converter] -> [Stamp] -> [display]
In the above, instead of using the Stamp to COUNT and calculate the note value, run the note value into a frequency-to-voltage converter; this will produce a DC level related to a particualr frequency. Run that DC level into an analog-to-digital converter; this will produce a digital number (binary) related to DC voltage level. Then use the Stamp to crunch the numbers and display the frequency value.
Pros/Cons? Not sure - kinda thinking out loud. Just another way to approach the issue.
DJ
The use of a Johnson counter is curious - care to elaborate?
Thanks,
DJ
Yeah we installed an amp of sorts into the breadboard which gives us a gain of R2/R1. So we put a huge resistor for R2 and ran a few 10 ohms in parallel to give us a pretty large gain; enough to pass the threshold.
That is actually a really interesting idea. I'll give that a shot and see what comes from it.
I'll post an update on the progress of the project as soon as I work out some kinks. Thanks a ton for all you guys' help!
Yes, it is very fine looking circuite/code for a Guitar tuner. Unfortuately I can't remember the web link of
this Guitar tuner, I have find it for same times ago and I'm thinking to try to make it...well, some day.
Take care
EL
Here is the thread that contained that schematic.
http://forums.parallax.com/showthread.php?p=641934
Jim
Thanks a lot