I'm working on a project to read a sensor using a phase difference approach. The original circuit to validate the sensor was rather complex, with an AD9837 sine generator, variable attenuation, and two fast comparators generating a pulse to detect zero crossing for the excitation signal and the signal thru the sensor. The pulses start and stop a counter, which is then read by a microprocessor to derive the sensor value.
I need to use a much simplified circuit to do the same, now that we know the frequency (10kHz), voltages and sensor ranges. The processor I'm using (nRF52840) has no DAC, very limited PWM, and no PDM functionality. And the BLE stack is running on the same core, forcing me to use only HW functionality for my project. I tried many tricks to generate a clean 10kHz sine, but there's still way too much noise especially at zero crossing, which is the most important part of the signal.
The sensor doesn't need a clean sine. Just a signal that is "sinusoidal enough", 10kHz in frequency, and very clean around zero crossing. I'm running at 1.8V, so "zero crossing 'is defined by 0.9V, and I need a sine centered on 0.9V, with enough Vpp to properly excite the sensor. I will use the built in comparator to start and stop a hardware timer, and since the sensor will also induce an attenuation, having a reliable value for zero crossing is critical: I need to make sure that the value I choose for the comparator zero is actually the sine zero reference for both the excitation signal and the sensor signal.
So, I’m planning to generate a 10kHz square wave (0-1.8V), a triple RC filter and some amplification. The triple RC filter works, but as expected, it reduces the signal to a 400mVpp one, still 0.9V centered (0.7-1.1V), which is too low for the sensor. Here is what I came up with, which works perfectly for what I need, but uses 3 opamps: U2 shifts the filtered 0.7-1.1V sine down and amplifies it to 0.2V to 1.4V or so, then U1 works as a voltage follower for an AC signal, centering it around 0.9V. I need U3, because the RC filter signal would be distorted if sent directly into a capacitor (C5). So U3 acts as a buffer. Brute force, not elegant at all, I know. But it works
I can simplify the circuit, using a divider and amplifier in one and only 2 opamps, but the values of the R4/R5 voltage divider and amplification factor were too critical. I would need to use a trimmer for R4/R5 and R6/R7 to ensure that the resulting sine is perfectly centered and properly amplified without clipping (any resistor tolerance would get amplified). On the contrary, in the circuit above, even if the resistors have high tolerance, the signal is always guaranteed to be amplified enough and centered (within the tolerances of R4/R5, but without extra amplification error)
Is there a simpler way to start from a 0-1.8V square wave and get a >1.4Vpp sine, perfectly centered on 0.9V? Maybe using active filters, instead of passive one?
I'm really a beginner when it comes to analog stuff. If you are providing a suggestion like "simply use a third order Sallen-Key lowpass filter", I'd appreciate more info like the cutoff frequency and a pointer to a simple example circuit implementing it
I guess I know that a third order Sallen-Key should work, I just keep getting lost trying to figure out if there's a way to do one using only one opamp