# Liquid Level Sensing Using Capacitive-to-Digital Converters

### Introduction

Procedures such as infusions and transfusions require exact amounts of liquid to be monitored, so they need an accurate, easy-to-implement method for sensing liquid level. This article describes the 24-bit capacitive-to-digital converters and level-sensing techniques that enable high-performance capacitive sensing of liquid levels.

### Capacitance Measurement Basics

Capacitance is the ability of a body to store electrical charge. The capacitance, C, is given by

where Q is the charge on the capacitor and V is the voltage across the capacitor.

In the capacitor shown in Figure 1, two parallel metal plates with area A are separated by distance d. The capacitance, C, is

where

• C is the capacitance in Farads
• A is the area of overlap of the two plates = a × b
• d is the distance between the two plates
• εR is the relative static permittivity
• εO is the permittivity of free space (εO ≈ 8.854 × 10−12 F m−1) Figure 1. Capacitance of two parallel plates.

### Capacitance-to-Digital Converter (CDC)

The single-channel AD7745 and two-channel AD7746 high-resolution, Σ-Δ capacitance-to-digital converters measure capacitances connected directly to their inputs. Featuring inherently high resolution (21-bit effective resolution and no missing codes at 24 bits), high linearity (±0.01%), and high accuracy (±4 fF factory calibrated), they are ideal for sensing levels, position, pressure, and other physical parameters.

Functionally complete, they integrate a multiplexer, an excitation source, switched-capacitor DACs for the capacitive inputs, a temperature sensor, a voltage reference, a clock generator, control and calibration logic, an I2C-compatible serial interface, and a high-precision converter core, which includes a second-order Σ-Δ charge-balancing modulator and a third-order digital filter. The converter works as a CDC for capacitive inputs and as an ADC for voltage inputs.

The measured capacitance, Cx, is connected between the excitation source and the Σ-Δ modulator input. A square-wave excitation signal is applied to Cx during the conversion. The modulator continuously samples the charge going through the Cx and converts it to a stream of 0s and 1s. The digital filter processes the modulator output to determine the capacitance, which is represented by the density of 1s. The filter output is scaled by calibration coefficients. The external host can then read the final result via the serial interface.

The four configurations shown in Figure 2 demonstrate how the CDC senses capacitance in single-ended, differential, grounded, and floating sensor applications. Figure 2. Configurations for single-ended, differential, grounded, and floating sensor applications.

### Capacitive Level-Sensing Techniques

A simple technique for monitoring liquid levels is to immerse a parallel-plate capacitor in the liquid, as shown in Figure 3. As the liquid level changes, the amount of dielectric material between the plates changes, which causes the capacitance to change as well. A second pair of capacitive sensors (shown as C2) is used as a reference. Figure 3. Capacitive level sensing.

Since εR(Water) >> εR(Air), the capacitance of the sensor can be approximated by the capacitance of the submerged section. Thus, the level of the liquid can be calculated as C1/C2:

where

• Level is the length submerged into liquid
• Ref is the length of the reference sensor

### Capacitive Level-Sensing System Hardware

With its two capacitance measurement channels, the 24-bit AD7746 is ideally suited for level-sensing applications. Figure 4 shows the system block diagram. The sensor and reference capacitances are converted to digital and the data is transmitted via the I2C port to the host PC or microcontroller. Figure 4. Capacitive level-sensing system.

The PCB design is critical for accurate measurements. Figure 5 shows the sensor board and CDC connection. To maintain accuracy, the AD7746 is mounted on the top surface of the PCB as close as possible to the two metal plates inside the 4-layer PCB. The ground plane is exposed on the back side of the PCB. Both input channels are used in the application. The sensor board is shown in Figure 6. Figure 5. Sensor board and CDC connection. Figure 6. Picture for top-side and bottom-side PCB.

The sensor board is designed using two coplanar metal plates instead of two parallel plates. With parallel plates on a PCB, the dielectric is formed by the PCB material, air, and liquid. In contrast, the inner coplanar layer doesn’t have to contact the liquid directly. For coplanar plates the approximate capacitance per length of track is

where

• d is the distance between the midpoints of the two parallel tracks
• l is the length of the tracks
• w is the width of each track (assuming they are the same)
• t is the thickness of the track
• The effective εR is determined by the ratio of d to h (h is the thickness of the PCB board)
• For d/h >> 1; εR(eff) ≈ 1
• For d/h ≈ 1; εR(eff) = (1 + εR)/2

From this equation, the measured capacitive is proportional to the length submerged into water, as the approximate capacitance per length of track for a coplanar sensor remains constant. Performing system calibration using LabVIEW® software can help achieve higher accuracy.

### LabVIEW Software

A LabVIEW program running on the PC retrieves data from the CDC via the I2C serial interface. Figure 7 shows the graphical user interface (GUI) on the PC monitor. When the liquid level demonstration system is on, the real-time level data, ambient temperature, and supply voltage are displayed. Figure 7. System GUI shown on PC monitor.

The level of liquid is derived as

The LabVIEW program includes basic calibration and advanced calibration to achieve a more accurate measurement. Dry (basic) calibration is used to determine C1DRY and C2DRY. The gain and offset can be derived from 0" and 4" calibration, since each calibration determines one equation with two first-order unknowns. The reference capacitor must be submerged into liquid during the calibration and measurement processes.

### Conclusion

This article provides an introduction to the capacitive liquid-level sensing demonstration system.

### Ссылки

AD7746 Evaluation Kit

AD7746 Evaluation Board Technical Documentation

Jia, Ning. “ADI Capacitance-to-Digital Converter Technology in Healthcare ApplicationsAnalog Dialogue, Volume 46, Number 2, 2012.

Scarlett, Jim. “Capacitance-to-Digital Converter Facilitates Level Sensing in Diagnostic SystemsAnalog Dialogue, Volume 48, Number 2, 2014.

Walker, Charles S. Capacitance, Inductance and Crosstalk Analysis, Artech House, 1990, ISBN: 978-0890063927.