6 Data and Results

A PWM signal is generated using the CCP peripheral, and the length of it must be equal to half of the period of the oscillating signal. To define the period of the PWM signal, use the formula of the resonant frequency of the LC sensor to calculate the period signal. The figure below illustrates the length of the PWM signal (violet) compared to the oscillating signal (blue).

Note: The signal period can vary due to the tolerance of the components.
Figure 6-1. LC Resonant Signal and Charging Pulse Comparison

The specific LC parallel circuit formula describes the oscillating signal. The signal from the OPA is filtered using the RC circuit that defines the RC Time Constant. This RC time constant specifies a charge rate. The signal from the RC circuit is the envelope that processes to determine the nature of an object. The figure below shows the oscillating signal (blue), the envelope (turquoise), and the comparator output (violet) with no metal object around the LC sensor. The comparator output represents the necessary time for the envelope to drop to the set threshold.

Figure 6-2. Comparator Output on Default State

The amplitude, the period, and the attenuation rate decrease resulting in significant differences if a metal object is in the proximity of the LC sensor. The output of the comparator shows a shorter time than before, showing that a metal object is in the LC sensor proximity.

Figure 6-3. Comparator Output on Metal Detection