Beat Detection using an op-amp
Posted: Sun Feb 27, 2011 2:15 am
I thought I would make this new post as it might be usful for anyone looking through the forum and who might be looking for using beat detection in there project, the original post was from my DMX controller.
I like to thank Brad for his input and Graham at digital-diy.com, but I found this circuit works fine for the application I was making.
the circuit: The Microphone and the Amplifier (op-amp on the left)
As you can see from the picture above, we have an electret microphone connected to the ground line, and to one end of a 10k resistor. The other end of the resistor is tied to the 5v line. when an audio sound is sensed by the micrpphone, it changes that audio signal into a voltage that emulates the tone picked up. We AC-couple the signal using a coupling capacitor. This signal will be extremely small, so we must first amplify it. I am doing that using a LM385 dual op-amp IC.
Go here for the data sheet:
http://www.national.com/ds/LM/LM158.pdf
The pull-down resistor to the right of the coupling capacitor is necessary for the operation of the non-inverting amplifier stage to work. In fact, all components in the above diagram are crutial. The way a non-inverting op-amp works, is it takes two values RA, which is the 1k resistor connected to the (-) input and ground, and RF (100k potentiometer), which is the feedback resistor, which is connected between the (-) input, and the output, and creates a voltage gain factor.
The voltage gain factor (AV) is a multiplier. Once we determine the AV, we multiply the voltage at the input by the AV, and we have our output voltage.
The 100k pot is used to vary the voltage gain. This will either increase the sensitivity or decrease the sensitivity of the circuit. The equation for AV = RF/RA in a non-inverting amplifier circuit.
The Comparator (op-amp on the right)
I wanted to turn our now amplified waveform into a 0-5VDC square wave that can be used by a I/O Pin of a microcontroller.
What im going to emply here is the comparator circuit. A comparator does exactly as you'd think. It compares voltages. If the voltage at the (-) input is higher than the voltage at the (+) input, then the output will be 0v. If the voltage at the (+) input is higher than the voltage at the (-) input, then the output will be 5v.
We have a resistor voltage divider network at the negative (-) input. This will keep a constant 1.5v at the negative input. When a loud sound is generated and amplified to a voltage higher than 1.5v, then the output will go from 0-5v until the voltage at the (+) falls below 1.5v. We only need for the output of the comparator to be high for a micro second or so, so don't worry too much about the time duration of the output of the comparator being high.
a video showing the circuit in operation:
I like to thank Brad for his input and Graham at digital-diy.com, but I found this circuit works fine for the application I was making.
the circuit: The Microphone and the Amplifier (op-amp on the left)
As you can see from the picture above, we have an electret microphone connected to the ground line, and to one end of a 10k resistor. The other end of the resistor is tied to the 5v line. when an audio sound is sensed by the micrpphone, it changes that audio signal into a voltage that emulates the tone picked up. We AC-couple the signal using a coupling capacitor. This signal will be extremely small, so we must first amplify it. I am doing that using a LM385 dual op-amp IC.
Go here for the data sheet:
http://www.national.com/ds/LM/LM158.pdf
The pull-down resistor to the right of the coupling capacitor is necessary for the operation of the non-inverting amplifier stage to work. In fact, all components in the above diagram are crutial. The way a non-inverting op-amp works, is it takes two values RA, which is the 1k resistor connected to the (-) input and ground, and RF (100k potentiometer), which is the feedback resistor, which is connected between the (-) input, and the output, and creates a voltage gain factor.
The voltage gain factor (AV) is a multiplier. Once we determine the AV, we multiply the voltage at the input by the AV, and we have our output voltage.
The 100k pot is used to vary the voltage gain. This will either increase the sensitivity or decrease the sensitivity of the circuit. The equation for AV = RF/RA in a non-inverting amplifier circuit.
The Comparator (op-amp on the right)
I wanted to turn our now amplified waveform into a 0-5VDC square wave that can be used by a I/O Pin of a microcontroller.
What im going to emply here is the comparator circuit. A comparator does exactly as you'd think. It compares voltages. If the voltage at the (-) input is higher than the voltage at the (+) input, then the output will be 0v. If the voltage at the (+) input is higher than the voltage at the (-) input, then the output will be 5v.
We have a resistor voltage divider network at the negative (-) input. This will keep a constant 1.5v at the negative input. When a loud sound is generated and amplified to a voltage higher than 1.5v, then the output will go from 0-5v until the voltage at the (+) falls below 1.5v. We only need for the output of the comparator to be high for a micro second or so, so don't worry too much about the time duration of the output of the comparator being high.
a video showing the circuit in operation: