Some analog help please... - Page 1
Forum section: electronics / projects

author: JVR
author_rank: Regular Contributor
timestamp: January 24, 2013, 09:09:07 pm
content: I can code, but without 1's and 0's I get confused easily...Have a look at the circuit attached, the idea is to get a digital pulse going high when the input reaches 15Khz, like a carrier detector.The first part works fine, and I get a pretty peak in amplitude at 15kHz, but the second bit does not seem to work, The voltages post Diode just all stay at 0VAny idea's?

author: CarlG
author_rank: Regular Contributor
timestamp: January 24, 2013, 09:18:26 pm
content: The inverting input node of the second OPA is high impedance,. Add a resistor to GND to pull it low when the output of the first OPA is low.EDIT: Sorry, didn't read the last sentence...so the voltages in the schematic isn't what you get in the real circuit?EDIT2: Typical inputcommonmode voltage range of the LM324 is Vee to (about) Vcc-1.5 V. So you will violate that spec when the output of the first stage goes high. [CMVR = Vee to Vcc-1.5 but with NI input at Vcc/2 that's not problem in this case].

author: Bored@Work
author_rank: Super Contributor
timestamp: January 24, 2013, 09:57:28 pm
content: Quote from: JVR on January 24, 2013, 09:09:07 pmhttp://en.wikipedia.org/wiki/Goertzel_algorithm

author: nctnico
author_rank: Super Contributor
timestamp: January 24, 2013, 11:17:05 pm
content: Quote from: Bored@Work on January 24, 2013, 09:57:28 pmAnd it doesn't actually work for detecting tones reliably...To the OP: I'd create a bandpass filter. You can do that with an LC in resonance but keep the Q low to accomodate for component variation (so put a series resistor at the output of the first opamp). You don't need the diode. If you feed the output from the filter through a capacitor and keep the other end at a DC level (for example half the supply voltage through a 1M Ohm resistor) you can use a comparator (NOT AN OPAMP!) to detect the amount of signal.

author: 6502nop
author_rank: Regular Contributor
timestamp: January 25, 2013, 03:41:02 pm
content: Does this project require a 3.3/5V limit?If you can bump this up to 6-24V, theneverythingyou need to do can be done by a decades-old LM2907/2917 Frequency-to-Voltage chip (the 2917-8 is only 8 pins!).The attached circuit is from the datasheet, called "Speed Switch". Note that no pin names are given for the chip, so I assigned them based on what they do or where they go. Just grab three resistors, two caps, a pot, led, and chip. Hook it up to a 6-12V battery, and adjust R1/C1 to trip the led when Fin=15KHz.It looks like the LM29x7s are still in production (for automotive tachs, apparently), and come in both DIP and SOIC packages.What it does: The input frequency pulses the input op-amp, which then pulses into a capacitor (known as a "charge-pump" circuit). The higher the frequency, the more pulses, and the more charge, is placed on the cap. The cap then is fed to a comparator (Tres on my diagram is also Cmp+, and the other input is Cmp-), which then trips a stand-alone NPN transistor (Qc and Qe = Qcollector/Qemitter), which can source 10mA or sink 50mA (perfect for meters and LEDs). Quite simple, really. The 14-pin packages open up the internals a bit, allowing you to do some different things, but I think all you need is the 8-pin variant.nop

author: nctnico
author_rank: Super Contributor
timestamp: January 25, 2013, 04:37:50 pm
content: I guess that will only work if there is no other noise on the signal. Depending on the application the carrier can be some kind of in-band signalling which is filtered out before its send to the speaker. I've build quite some DSP gear for professional radio use to handle all kinds of in-band signalling before everything went digital.

author: jeffreyprinzie
author_rank: Newbie
timestamp: January 29, 2013, 04:03:57 pm
content: In the first stage yout DC gain in 1 (inductor prooves gain = (1+Rf/Rg)).So the DC Voltage at the output will be 2.5V. The common mode voltage at Amp2 necessary will be sufficient.When the AC component has low frequency, it will be passed to the output and NOT attenuated => bad.when the AC component has resonace frequency, it will be highly amplified.Try this approach:The second stage is Ok, but add a parallel resistor to the capacitor, otherwise the maximum will be remembered even if the frequency drops again.Use an invering amplifier with the LRC parallel circuit in negative feedback, and a series resistor from source to - input.What you get:zero gain for LF and HF, large gain for resonance.Put the Plus input of the opamp on lets say 2.5V for DC offset to have enough common mode for stage 2.the dc voltage of your source is of no importance because for DC a low impedance path from -input goes to the output. (simulated with 3V DC input-)components are for 10khz resonance.See attachment. You can use a third opamp to buffer your signal, because input impedance is low (220ohm here). If this comes from a high impedance source, you should bufferhope this helps

author: codeboy2k
author_rank: Super Contributor
timestamp: January 30, 2013, 07:35:42 am
content: I thought I'd throw my thoughts out here too. We don't know much about your source signal, or any noise, or if there are other frequencies nearby that you need to NOT trigger on, etc.... If there is nothing else in the signal except this frequency of interest, then a simple bandpass filter is fine and you stay analog as your post is titled.However, if there are other signals present too, and you want to discriminate more tightly, then you can also use a purpose built frequency counter with just a 555 timer, a gate or two, and a binary counter.You can use a 555 timer generating a 500 Hz square wave, use the falling edge to reset a counter, and the level high of the same timer output to gate the input signal into the clock of the counter. Assuming the 555 has a 50% duty cycle, then the gate will be open for half the period of 500 Hz, or 1 ms. Thus, a count of 14, 15, or 16 (in a 1 ms period) indicates 14 kHz, 15 kHz or 16 kHz. Your counter resolution is equal to the frequency of the 555 timer * 2, in this case 1 kHz.if you want to have a better resolution, say 500Hz resolution, then you need a 250Hz clock, which is a 4ms period. Half of that is a 2 ms gate time. Now each tick of the counter represents 500 Hz and you need to see a count of 28 up to 32. That will correspond to 14, 14.5, 15, 15.5, 16, 16.5 Khz,Notice that your detection time has expanded to 2 ms now. If you need a faster detection time, you need to decrease your gate time, but then you lose resolution.to get a faster detection time and better resolution you need to make a reciprocal counter. It's basically the same, but you count ticks of the master clock, instead of the incoming signal. The incoming signal is used to gate the master clock, instead of the master clock gating the incoming signal. Now make the master clock really fast, and each tick of the counter is the resolution of the master clock. As an example, if the master clock is 1 Mhz, the resolution of a tick is going to be 1us. If this master clock with a period of 1us is gated into the counter for 66us (the period of the signal to measure) then the count will be 66. so 1/(count*period) = frequency = 15.15 kHzAlso you can probably do all this in 1 PIC now.

author: jeffreyprinzie
author_rank: Newbie
timestamp: January 30, 2013, 08:04:10 am
content: The use of a microprocessor will be much easier than analog design. If you have the developpement tools ...if you just use it for frequency detector, analog will use less parts if you do not need a high resolution.What are you building?

author: ion599
author_rank: Newbie
timestamp: January 30, 2013, 09:36:20 am
content: I want to say that the diode is flipped? The input to the second op-amp's - input is higher than the + input when you detect a carrier. Since V- > V+, the output should go to zero. I think if you flip the diode and add a large value resistor(100k-1Mohm)in parallel with C4from V- to Vdd you'll see better results.Edit: I messed up where to place the resistor. Fixed inline.

author: jeffreyprinzie
author_rank: Newbie
timestamp: January 30, 2013, 09:39:50 am
content: Thats not right i think,the second opamp is used in open loop, there is no connection between v+ and v- because there is no feedback from the output.I think the diode is placed right here.