Op-amp Schmitt trigger with RC feedback: what charges, what trips, and why the output keeps flipping.
Both thresholds are ±βVSAT and the capacitor charges toward ±VSAT. VSAT scales the start, target and threshold equally, so it cancels in the log term: \(T=2RC\cdot \ln [(1+\beta )/(1-\beta )]\). Only R, C and the resistor ratio set the period.
With one threshold, the capacitor would sit at the crossing and noise would make the comparator chatter. Two thresholds give the capacitor a defined swing of 2βVSAT to cover, and the time to cover it is the half-period. The same hysteresis is the noise margin right after each trip.
The output has to slew 2VSAT each trip. A general-purpose op-amp at 0.5 V/µs needs about 40 µs for 20 V, comparable to the 110 µs half-period here. Use a comparator (ns propagation delay) with a pull-up, and keep R large enough that the output can drive it.
Any noise on VC or on the threshold shifts the crossing time by \(\Delta t\approx v_{\text{n}}/(\mathrm{d}V_{\text{C}}/\mathrm{d}t)\). The exponential is slowest near the threshold, so a wide hysteresis band (larger β) means a flatter slope at the trip point and more jitter per µV. A crystal is orders of magnitude better.
Make the sense electrode the C. A finger adds ΔC, the period grows, and the MCU counts edges in a fixed window: \(\Delta f/f\approx -\Delta C/C\). 2 pF on 20 pF of parasitic gives about a 9% shift. It is simple but weak against injected noise such as motor PWM, which is why modern controllers use charge amplifiers with synchronous demodulation.