Introduction Differential capacitive sensors offer high sensitivity and low nonlinearity error. They also reduce the influence of electrostatic attraction on measurements and effectively mitigate errors caused by environmental factors such as temperature. Therefore, differential capacitive sensors are frequently used in many measurement and control applications. However, the capacitance of a capacitive sensor is extremely small, requiring signal conditioning circuits to convert changes in capacitance into proportional changes in voltage, current, or frequency for display, recording, and transmission. Currently, most capacitive sensor signal conditioning circuits use discrete components or are developed using dedicated application-specific integrated circuits (ASICs). Because of the small capacitance of differential capacitive sensors, the sensor's conditioning circuits are often affected by parasitic capacitance and environmental changes, making high-precision measurements difficult. The CAV424 integrated circuit developed by AMG in Germany effectively reduces errors caused by these influences, thus offering greater application flexibility. The tilt sensor designed here is a novel variable-area capacitive tilt sensor. This tilt sensor technology is one of the few tilt sensor technologies that combines the advantages of simple structure, high reliability, and the availability of general-purpose sensor integrated circuits. It has wide applications in measuring instruments, construction machinery, antenna positioning, robotics, and automotive four-wheel alignment. 1. System Working Principle The system hardware structure block diagram is shown in Figure 1, mainly composed of differential capacitors, CAV424 chips, operational amplifiers, a microcontroller, and a display circuit. The system detects the tilt angle of the tilt sensor's installation position using differential capacitors and converts the angle change into a capacitance change. While one differential capacitor increases, the other decreases, and the changes in capacitance are fed into two CAV424 chips, which convert these changes into two different voltage values. These two voltages are differentially amplified and then sent to the microcontroller for processing. Finally, the display circuit shows the tilt angle of the detected object. As can be seen from the above principle, the tilt angle of the detected object undergoes three stages of differential processing. Simultaneously, the CAV424 chip has a built-in temperature sensor. The output signal of this sensor is then sent to the microcontroller for temperature compensation processing. Therefore, the system has high accuracy and sensitivity. 2. Circuit Design of Each Part of the System 2.1 Design of Differential Capacitor/Voltage Conversion Circuit Considering that the capacitance of the differential capacitor is very small, the conditioning circuit of the sensor is often susceptible to the influence of parasitic capacitance and environmental changes. Therefore, the CAV424 developed by AMG in Germany is used as the signal conditioning circuit for the differential capacitor. Since a single CAV424 can only detect one capacitor, two CAV424s are used to complete the detection of the differential capacitor. (1) Introduction to CAV424 The CAV424 is a multi-purpose integrated circuit that completes the conversion interface for processing various capacitive sensor signals. It has the functions of signal acquisition (relative capacitance change), processing and differential voltage output, and can measure the difference between a measured capacitor and a reference capacitor. Within a range of 5% to 100% relative to the reference capacitance value (10 pF to 1 nF), capacitance values of 0 pF to 2 nF can be detected, and its output differential voltage can reach a maximum of ±1.4 V. At the same time, the CAV424 also has a built-in temperature sensor, which can directly provide a temperature signal to the microprocessor for temperature compensation, thereby simplifying the entire sensor system. The principle is shown in Figure 2. (2) Detection principle of CAV424 A reference oscillator whose frequency is determined by the capacitor Cosc drives two symmetrically constructed integrators and synchronizes them in time and phase. The amplitudes of the two integrators are determined by capacitors Cx1 and Cx2 (as shown in Figure 2). Here, Cx1 is used as the reference capacitor, and Cx2 is used as the measured capacitor. Since the integrator has a high common-mode rejection ratio and resolution, the signal obtained by comparing the difference between the two amplitudes reflects the relative change of the two capacitors Cx1 and Cx2. The differential signal is converted into a DC voltage signal through a two-stage low-pass filter and output through an adjustable differential stage. The filter constant and amplification factor of the low-pass filter can be changed by simply adjusting a few components. The reference oscillator charges the external oscillator capacitor Cosc and its associated internal parasitic capacitors Cosc, PAR, INT, and the external parasitic capacitors Cosc, PAR, EXT, and then discharges. The capacitance of the oscillator is approximately taken as Coc = 1.6Cxl. The reference oscillator current Iosc = VM / Rosc. The measured output waveform of the oscillator, i.e. the output waveform of pin 12 of any CAV424, is shown in Figure 2 of reference [1]. The working mode of the capacitor integrator is similar to that of the reference oscillator. The difference is that the discharge time of the former is half that of the reference oscillator. Secondly, the discharge voltage of the former is clamped to an internal fixed voltage VCLAAMP. The output waveforms of pins 14 and 16 (output voltage of the capacitor integrator) of two CAV424s can be found in reference [1]. The output voltage of the two integrators, after internal signal conditioning, should ideally be VLPOUT=VDIFF+VM, where the differential signal VDIFF=3/8(Vcx1-Vx2) and VM is the reference voltage. (3) Actual hardware circuit and circuit parameter design The actual differential capacitor/voltage conversion circuit is shown in Figure 3. When the tilt sensor is placed in a horizontal position, the differential capacitor C10=C20=50pF, so the reference capacitor of CAV424 should be selected as C11=C21=50pF, the oscillation capacitor C12=C22=1.6C11=80pF, the low-pass filter capacitor C13=C14=C23=C24=200C11=10nF, the capacitor load for stabilizing the reference voltage VM is C15=C25=100 nF, and the current adjustment resistor R11=R12=R21=R22=500kΩ. The reference oscillator current setting resistors R13 and R23 are 250kΩ. To adjust VLPOUT, all output stage resistors are adjusted to 100kΩ potentiometers. Additionally, to improve circuit stability, 10nF capacitors C16 and C26 are connected between pin 4 of the CAV424 and ground. 2.2 Operational Amplifier Circuit Design: The operational amplifier circuit is used to synthesize and amplify the voltage signals output from the two CAV424 chips, converting them into a 0-5V DC voltage easily processed by the microcontroller. According to general design principles, an instrumentation amplifier should be used here; however, considering the higher cost of instrumentation amplifiers, and the already high output voltage due to the use of two CAV424 chips in the pre-stage, a cost-effective quad operational amplifier TL084 is chosen as the signal conditioning circuit. Experiments show that its accuracy fully meets the predetermined design requirements. Considering the simplicity of the subsequent circuit, a two-stage operational amplifier is used here. The first stage uses the VLPOUT pins of two CAV424 chips as the inverting and non-inverting inputs of the op-amp, respectively, so that the Vol output is ±2.5V when the tilt sensor changes by ±90°. Either VM pin of the two CAV424 chips is used as the non-inverting input of the second-stage op-amp, making the V02 output voltage 0–5V. This signal is then used as the analog input signal for the microcontroller. The actual circuit is shown in Figure 4. Here, we select R1=R2=R3=R4=R5=Rf2=10 kΩ, Rf1=Rp1=100 kΩ, then Uol=Rfl/R1(Vlpout1-Vlpout2) (1) Uo=VM-Uol (2) Substituting equation (1) into equation (2), we can get Uo=VM+Rf1/R1(Vlpout1-Vlpout2); at the same time, we adjust Rf2 and Rp1 so that when the tilt sensor changes within ±90°, Uo changes within 0~5V. 2.3 Software and hardware design of microcontroller and its display system (1) Hardware design Considering that the operational amplifier outputs a 0~5V analog voltage signal, and the CAV424 temperature sensor output is also an analog voltage signal, which cannot be directly processed by a microcontroller, we choose the PIC16F872 produced by Microchip as the microprocessor of the system. In addition to the features of a typical PIC series microcontroller, such as a Reduced Instruction Set Computer (RISC), Harvard dual-bus, and two-level instruction pipeline, it also has five 10-bit A/D conversion units and 2K×14-bit Flash memory, which greatly facilitates system development. Furthermore, considering that the tilt sensor needs to display both the magnitude and sign of the tilt angle, and taking into account both programming convenience and the display accuracy of the tilt sensor, this design uses the HD7279 as the 8-segment LED display driver circuit to display the magnitude and sign of the tilt angle. The circuit design for this part is shown in Figure 5. (2) Software Design The software design of this system mainly includes A/D conversion, engineering quantity conversion, and display. The main program flow is shown in Figure 6. Conclusion Experiments have shown that the measurement accuracy and sensitivity of this tilt sensor meet the expected requirements. This design is a general-purpose module. By replacing the differential capacitor of the tilt sensor with other differential capacitor sensors, it is possible to perform accurate measurements of vibration, acceleration, differential pressure, liquid level, etc., based on the principle of differential capacitance. Therefore, the design of this system has great application value.