Basics and implementation of capacitive proximity sensing

Not rated 19,369

Circuit Image

Capacitive proximity sensing has gained significant interest among audiences over the past year. At the end of this article, a list of related articles published at Planet Analog is provided for further reading. A simple proximity sensor is designed to detect an approaching hand and activate an LED. A 0.5 mm² wire, 10 cm long, is selected as the sensor. The schematic of the proximity sensor circuit utilizes the CY8C21434 mixed-signal array from Cypress Semiconductor. The sigma-delta modulator is configured with a resolution of 14 bits, and only two external components, CINT and Rdis, are required. The count value from the sigma-delta modulator is processed through an IIR filter to establish a reference count known as the Baseline. This filter is designed to reject high-frequency noise while tracking slow changes caused by environmental factors such as temperature and humidity. When the difference between the instantaneous count and the baseline exceeds a predefined threshold, the firmware indicates the presence of proximity. The accompanying C code for this process is illustrated in a flowchart. A debug port and PC GUI are employed to display the instantaneous counts, baseline, and difference counts from the sensor. The HYSTERESIS value in the firmware should be adjusted to prevent oscillations in the output due to noise, with a few counts above the noise level being sufficient. This configuration allows the LED to turn ON and OFF in response to hand movements near the sensor. Capacitive proximity sensing offers various applications.

Capacitive proximity sensors operate based on the principle of capacitance variation caused by the presence of an object, typically a human hand. The sensor's design involves a simple circuit that integrates the CY8C21434 mixed-signal array, which is adept at handling analog and digital signals. The choice of a 0.5 mm² wire as the sensing element ensures a compact and efficient design, while the 10 cm length provides an adequate sensing range.

The sigma-delta modulator plays a crucial role in converting the analog signal from the sensor into a digital format. With a resolution of 14 bits, it allows for precise measurements of capacitance changes. The external components, CINT (integrating capacitor) and Rdis (discharge resistor), are essential for the modulator's operation, enabling it to achieve the desired sensitivity and response time.

The IIR filter is a key component in the signal processing chain, where it smooths the instantaneous count readings to create a stable baseline. This baseline serves as a reference point, allowing the system to differentiate between genuine proximity events and transient noise. The firmware processes the filtered counts, and when the difference between the instantaneous and baseline counts exceeds a set threshold, it triggers the LED, providing a visual indication of proximity.

To enhance the reliability of the sensor, the HYSTERESIS value is carefully calibrated. This adjustment prevents false triggering due to noise fluctuations, ensuring that the system only responds to significant changes in capacitance. The implementation of a debug port and a graphical user interface (GUI) facilitates real-time monitoring of the sensor's performance, allowing for adjustments and optimizations during development.

Overall, capacitive proximity sensing technology has diverse applications, ranging from user interface enhancements in consumer electronics to automation systems in industrial settings, making it a versatile solution for modern electronic designs.Capacitive proximity sensing has been a very popular topic with our audience over the past year. For your convenience, at the end of this article, there is a hot-linked list of related articles published at Planet Analog. To read Part 1 of this article, click here. ) Now that we have discussed the theory about the sigma-delta modul ator, let us design a simple proximity sensor that will detect an approaching hand and switch on an LED. A 0. 5 mm2 wire, 10 cm long, is chosen as a sensor. Figure 7 shows the schematic of a proximity sensor circuit built using the CY8C21434 mixed-signal array from Cypress Semiconductor.

The resolution of the sigma-delta modulator is set to 14. CINT and Rdis are the only external components required for the sigma-delta modulator. The count value from the sigma-delta modulator is passed through an IIR filter to form a reference count called Baseline. By selecting the filter response of the IIR filter, high-frequency noise on the instantaneous counts are rejected, but slow changes caused by temperature, humidity, and other factors are tracked.

If the difference between the instantaneous count and the baseline exceeds a threshold, the firmware reports proximity. Figure 9 is the C code for the above flowchart. This is the most important stage of the development. Using the debug port and a PC GUI, display the Instantaneous counts, Baseline and Difference counts from the sensor.

Perform the following steps: 5. The HYSTERISIS value in the firmware should be set in such a way that noise in the system does not create oscillations in the output. A few counts more than the noise level should work fine. We now have a proximity sensor. Watch the LED being turned ON and OFF as you bring your hand near and away from the sensor. Proximity sensing can be used in a number of interesting ways: Ganesh Raaja of Cypress Semiconductor Corp.

received his degree in Electronics and Communication Engineering from Motilal Nehru Government Polytechnic, Pondicherry. His expertise lies in developing with analog circuits, embedded systems, designing PCBs, and working with Assembly and C.

1. Capacitive Sensors, Larry K. Baxter, IEEE Press, ISBN: 0-7803-5351-X (Chapter 2: Equation for capacitance of a Cylinder to a Plane, Chapter 6: Proximity sensor basics) 2. Fundamentals of Physics, J. Walker, E-book (Chapter 26: Capacitance and Dielectrics, Equation for Capacitance of sphere to infinity, Equation for Capacitance of parallel plate capacitance)

🔗 External reference