CMOS flip-flop used “off label” implements precision capacitance sensor

Article By : Stephen Woodward

Different ways to use the CD4013B dual-D CMOS flip-flop for purposes that it was not originally intended for.

When applied to pharmaceuticals, the term “off-label” suggests the (frequently discovered) practical and beneficial uses for a drug that are different from the one it was originally developed for. This happens for electronic components too, such as the venerable CD4013B dual-D CMOS flip-flop.  Despite the 4013’s labeling as a traditional bi-stable logic element, it nevertheless has terrific off-label potential as an analog part.

For example, here’s how it works as a capacitance comparator as shown in Figure 1.

Figure 1 Circuit diagram with the CD4013B used as a capacitive humidity sensor.

The #2 flip-flop has its Q outputs (pins 12 and 13) and S/R inputs (8 and 10) cross-connected through the associated R, C, and diode networks, turning it into a ~100kHz RC oscillator. The duration (T+) of the positive oscillation half-cycle (pin 13 high) is controlled by R2C2, while R1t (the trimmer’s top half) and Cx (humidity-sensor capacitance) control the duration (T-) of the negative (pin 13 low) half-cycle.

Increasing humidity increases Cx, thereby increasing R1tCx and T- and vice-versa. Meanwhile, as R1t is coupling the T- pulse to the timing ramp on Cx and S#2 pin 8, the bottom half of the trimmer (R1b) is coupling it to a very similar ramp on Cref and S#1 pin 6.

The relative difference between time constants R1tCx versus R1bCref forms the basis of the capacitance measurement. If R1tCx < R1bCref, indicating that humidity is below the setpoint on R1, then the ramp on pin 8 will cross the 0/1 threshold and end T- before the ramp on pin 6 does.  This will allow FF#1 to be reset when clocked by the rising edge on pin 13 at the end of T-, asserting Cref > Cx.

Contrarywise, if R1tCx > R1bCref, then pin 6 will cross threshold first, holding FF#1 set and asserting Cx > Cref.

Because both flip-flops inhabit the same chip, their respective S input thresholds will track each other closely despite variations in temperature and supply voltage, enhancing switch-point precision and stability.

The same circuit works equally well in many other capacitance-sensing applications, such as a non-contact position sensor/motion limit switch (Figure 2).

Figure 2 Motion limit/position sensing proximity switch using the CD4013B.

Detection and control of the level of liquid in a reservoir is another suitable application, as Cx increases because rising liquid level increases capacitance between the liquid and an insulated probe.

Figure 3 Liquid level sensor using the CD4013B.


This article was originally published on EDN.

Stephen Woodward’s relationship with EDN’s DI column goes back quite a ways. In all, a total of 64 submissions have been accepted since his first contribution was published in 1974.


Leave a comment