When Your Sensor Lies: Building Circuits That Catch Themselves

Picture this: you’ve built a precision displacement sensor, placed it in a factory floor environment with EMI, thermal drift, and cable parasitics all conspiring against you — and your instrument still spits out readings accurate to ±0.1%.

That’s the promise of a relaxation oscillator built around an SR latch and two RC networks. Jordan Dimitrov, an electronics engineer and PhD with 40 years of experience, just published a Design Idea on EDN that shows how to interface differential capacitance sensors without the usual complexity or cost.

The Core Innovation: Periodic Capacitor Swapping

Traditional capacitance-to-digital converters tend to be expensive and intricate. This circuit works differently: one capacitor charges through a resistor while the other is simultaneously discharged via a parallel switch. When the charging capacitor hits the gate trip voltage, the latch flips — and the two capacitors swap roles. The process repeats indefinitely, creating a self-sustaining oscillator where duty cycle directly reflects the ratio of the two capacitances.

The math is elegant: VAVR = VDD × t1 / (t1 + t2). A microcontroller measures t1 and t2, and the average value tells you whether C1 is greater than, less than, or equal to C2. No expensive ADC required.

Linear Response, Not Just Theory

Testing with a bank of ten 50-pF capacitors, the duty cycle response turned out to be perfectly linear (R² = 1) across a wide range. But the error analysis revealed a bump-shaped nonlinearity of ±0.3% — which turns out to be a second-order effect. Fitting a second-order polynomial: y = 1×10⁻⁵x² + 0.182x + 4.21 reduces the error to just ±0.1%.

This correction is trivial to implement in firmware. A few lines of code and you’re there.

Where Differential Capacitance Sensors Actually Work

The list is longer than most engineers realize: linear displacement, angular displacement, pressure, proximity, humidity, fluid level, inclination, and acceleration. These sensors show up everywhere from automotive brake fluid level detection to medical catheter tip pressure monitoring.

The circuit’s simplicity and low cost make it attractive for high-volume commercial applications where the bill-of-materials matters as much as the specs.

The Takeaway for Engineers

If you’re working with differential capacitance sensors and hesitating because of the perceived complexity of interface electronics, this circuit deserves your attention. It’s based on an SR latch — a two-nor-gate device that costs pennies — and two RC networks. The entire interface can be built for a few dollars, calibrated with a polynomial correction in firmware, and deployed in the field with confidence.

The full paper includes test data, circuit diagrams, and the polynomial calibration approach. Worth bookmarking.