Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 3rd April 2008, 06:40 PM   (permalink)
Default Audio Frequency Detection

Im using a 16f877 PIC to drive an LCD screen which will display the frequency of a note played by a guitar - basically a guitar tuner.

I am having trouble with the frequency detection. There are couple ideas that I came up withafter running the signal through LM386 with 20x gain)
1. Run the LM386 output through 74LS14 schmitt trigger (I have already tried this and i have miserably failed at getting output from schmitt trigger). Take output from 74LS14; time the pulse and detect frequency with 16f877.

2. Run the LM386 output through LM2917 frequency-to-voltage converter and use ADC module of 16f877. (Unfortunately, I am not familiar with this IC and have no clue how to convert audible frequencies into voltage; so any input is highly appreciated)

Which one is a more accurate method? Is there a better way to capture the frequency? Is there specific way to use 74LS14 that I am not aware of? Any schematics or C and R values to help me with LM2917 available?

Thanks in advance,
~transistance
transistance is offline   Reply With Quote
Old 3rd April 2008, 06:55 PM   (permalink)
Default

For a start an LM386 is a really poor choice, it's a power amplifier, you need an opamp.

Next a guitar doesn't output a very pure frequency, so it's not easy to measure like that.

EPE did a PIC based one a number of years ago, they used filters controlled by the PIC in order to give a clearer signal to measure - it wasn't a really a trivial project.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 3rd April 2008, 07:30 PM   (permalink)
Default

I have seen a similar project where 74LS14 Schmitt Trigger gave out a very clear square wave signals at peak points of the guitar notes. I just connected the gained frequency to an input port and got the output from the corresponding pin. Im wondering if there are additional components used to filter out the signal. Unfortunately the project paper does not specify that part of the circuit.

http://72.211.214.102:3001/senior_pr...finalpaper.doc

Last edited by transistance; 3rd April 2008 at 07:34 PM.
transistance is offline   Reply With Quote
Old 3rd April 2008, 08:17 PM   (permalink)
Default

Quote:
Originally Posted by transistance
I have seen a similar project where 74LS14 Schmitt Trigger gave out a very clear square wave signals at peak points of the guitar notes. I just connected the gained frequency to an input port and got the output from the corresponding pin. Im wondering if there are additional components used to filter out the signal. Unfortunately the project paper does not specify that part of the circuit.
http://72.211.214.102:3001/senior_pr...finalpaper.doc
Page 7 of the referenced paper shows two op amps configured to amplify and low-pass filter the output from the microphone. I believe signal V2 is the simulated microphone signal. U2A's output apparently goes to the Schmitt Trigger input.
crutschow is offline   Reply With Quote
Old 3rd April 2008, 11:28 PM   (permalink)
Default

Thans for pointing that out crutschow. I've just been skimming through a lot of papers lately and i missed that. So I see that there is a dual stage LM324 amplifier with low pass filter capacitors. According to the pictures on page 8, this is supposed to give out a clear square wave signal when passed through a schmitt trigger. But i googled the LM324 audio applications and read that the opamp causes heavy crossover distortion. Do you think that LM324 is still gonna be suitable for this project? Can LM741 be a good choice?
transistance is offline   Reply With Quote
Old 4th April 2008, 08:52 AM   (permalink)
Default

Quote:
Originally Posted by transistance
Thans for pointing that out crutschow. I've just been skimming through a lot of papers lately and i missed that. So I see that there is a dual stage LM324 amplifier with low pass filter capacitors. According to the pictures on page 8, this is supposed to give out a clear square wave signal when passed through a schmitt trigger. But i googled the LM324 audio applications and read that the opamp causes heavy crossover distortion. Do you think that LM324 is still gonna be suitable for this project? Can LM741 be a good choice?
Those are all antique low spec devices, something like the Texas TL07x or TL08x series will be many tmes better.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 4th April 2008, 12:52 PM   (permalink)
Default

I built the dual stage amplifier with low pass filter using TL082. Is it normal to not get an audible output?
transistance is offline   Reply With Quote
Old 4th April 2008, 12:55 PM   (permalink)
Default

Quote:
Originally Posted by transistance
I built the dual stage amplifier with low pass filter using TL082. Is it normal to not get an audible output?
No, what you're looking for is a squarewave output of the fundamental input, this will be just as audible as the original, but highly distorted.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 24th April 2008, 02:18 PM   (permalink)
Default

I'm using twisted pair wires for my sound input and outputs and still getting a constant 500 Hz noise that the above low pass filter is not filtering out. Could this be because I'm using an adapter to power my protoboard? should i switch to batteries?
transistance is offline   Reply With Quote
Old 24th April 2008, 02:34 PM   (permalink)
Default

Quote:
Originally Posted by transistance
I'm using twisted pair wires for my sound input and outputs and still getting a constant 500 Hz noise that the above low pass filter is not filtering out. Could this be because I'm using an adapter to power my protoboard? should i switch to batteries?
If your PSU is faulty, or completely useless, then swapping to batteries may well help.

But you might try posting your circuit, EXACTLY as you've built it, it's quite possible you've left out many vital components?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 24th April 2008, 10:04 PM   (permalink)
Default

The very simple circuit has a very simple lowpass filter.
If the guitar is played a little too loudly then its harmonics will trip the Schmitt-trigger, then the output frequency will be wrong.
If the guitar is played a little too softly then the Schmitt-trigger will not be triggered, then there will not be an output.

Unbalanced audio circuits like this one need shielded audio cables, not twisted pairs that are used for balanced telephones.

The schematic of the preamp and lowpsss filter from the little school kids has a few problems.
Attached Images
File Type: png lowpass filter fot guitar.PNG (70.2 KB, 26 views)
__________________
Uncle $crooge
audioguru is offline   Reply With Quote
Old 25th April 2008, 06:33 AM   (permalink)
Default

is there any suggestions that you got to improve this circuit? how can the low pass be built in a better way?
transistance is offline   Reply With Quote
Old 25th April 2008, 08:52 AM   (permalink)
Default

Check the EPE one I mentioned at the start of this thread, it used variable filters controlled by a PIC.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 27th April 2008, 01:40 AM   (permalink)
Default

1. Use a OPA2134 operational amplifier for your low pass filter.
2. Use this 24db/octave low pass filter below
filter
http://synthius.fileave.com/lowpasfilter.jpg
3. Adjust the crossover point by changing the value of R.
4. Make a preamp before the low pass filter which will allow you to attentuate or amplify the audio signal from the guitar. Therefore, you will be able to detect the frequency correctly no matter how loud or softly you are playing the guitar.
synthius is offline   Reply With Quote
Old 27th April 2008, 01:49 AM   (permalink)
Default

1. Use a OPA2134 op amp to design your low pass filter.
2. Use the schematic below if you would like. It is a 24/dB low pass filter
3. Change your crossover point by changing the R values. All R values should be the same.
4. Here is the equation. R= 1/(2*pi*1.414*frequency*c)


c=100n
substitute the desired frequency in the equation to find the resulting R value.

Last edited by synthius; 27th April 2008 at 03:44 AM.
synthius is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Variable capacitor circuits walters General Electronics Chat 83 11th March 2008 02:58 PM
Audio Frequency Driven LED's (HELP!) iONic Electronic Projects Design/Ideas/Reviews 1 29th March 2006 10:42 PM
Audio beat detection jrz126 Electronic Projects Design/Ideas/Reviews 21 12th May 2005 11:27 AM
ADC - Audio Clipping Detection Noggin Micro Controllers 0 7th December 2003 01:54 AM
Audio frequency signal outputs Magic Micro Controllers 2 23rd December 2002 09:28 PM



All times are GMT. The time now is 07:27 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.