Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
EE Times-Asia > Sensors/MEMS

Capacitive sensing makes a splash

Posted: 18 Feb 2008 ?? ?Print Version ?Bookmark and Share

Keywords:capacitive sensing? controller? mechanical switches? capacitive switch?

By Dave Van Ess
Cypress Semiconductor Corp.

Capacitive sensing offers developers a new way to interact with users that overcomes the traditional problems associated with mechanical levels or push-button switches that engage a solenoid-controlled value. Exploring the use of capacitive sensing in a water cooler illustrates not only how capacitive sensing can make devices more reliable, but also how the controller managing capacitive sensing can take on additional functions to add further value to customers and reduce maintenance costs.

Cooler troubles
A big problem with mechanical spigots is that they can be forced on, or even broken off, causing all the water to be dispensed. It is also easy to override a push button, by taping it pressed "on" or by jamming some object into its housing to force it to be continuously on. Mechanical switches wear out and also must penetrate their product's case, allowing contamination into crevices or crannies. A capacitive sensor does not penetrate the case, so there are no crevices to trap gunk. And capacitive sensors do not wear out. This makes them well suited for a device that dispenses food or food-grade products.

(Click to view Figure 1.)

In Figure 1, a capacitive switch is a capacitor formed from two adjacent traces, and the laws of physics determine how much capacitance exists between them. If a conductive object such as a finger is brought in close proximity to these plates, a parallel capacitance couples with this sensor. Place a finger on the capacitive sensor, and the capacitance increases; remove the finger, and the capacitance decreases. Measure this capacitance and you can determine the presence or absence of a finger.

All that is needed to make a capacitive sensor is a trace, a space and a trace. These traces can be made part of a circuit board with an insulated overlay placed directly over them. They can also be made to conform to a curved surface. To construct the capacitive switch, a designer needs a capacitor, capacitance-measuring circuitry and local intelligence to translate the capacitance values to a sense state.

A typical capacitive sensor has a value of 10-30pF. Typical finger-coupling capacitance to the sensor, through 1mm of insulating overlay, is in the range of 1-2pF. For thicker overlays, the coupling capacitance decreases. To sense the presence or absence of a finger, it is necessary to implement capacitance sensing circuitry that can resolve better than 1-part-in-100 capacitance change.

A delta-sigma modulator is an effective and simple circuit for measuring capacitance. A typical topology is in Figure 2:

(Click to view Figure 2.)

Phased switches cause the sensor capacitor to inject a charge into the integrating capacitor. This voltage increases until it is greater than the reference voltage. The comparator goes high, causing the discharge resistor to be engaged. The resistor is removed when the integrating voltage falls below the reference voltage. The comparator supplies the negative feedback needed to make the integrator voltage and reference voltage match.

Design factors
During O1, the sense capacitor (Csensor) is charged to the supply voltage. During O2, the charge is transferred to the integrating capacitor (C Cint). Feedback is holding its value to the reference voltage (Vdd x k). Each time this switch combination is actuated, a quanta of charge is transferred. These quanta are transferred at the rate of the switch clock (f c) for a charge current, Equation 1:

The discharge current is implemented with a resistor. When the comparator is high, it engages a switch to connect the discharge resistor. The comparator will cycle high and low in some ratio, attempting to keep the integrating capacitor voltage equal to the reference voltage. The percentage that this comparator is high is defined as its "DensityOut". The charge is only removed this percentage of the time. The current is shown by Equation 2:

In steady state, the charge and discharge current must match. Setting IC to ID results in Equation 3:

The sensor capacitor is proportional to the density. The sample frequency, discharge resistance and reference value (Vdd x k) are known. Measure the density, and the sensor capacitance can be calculated. The reference voltage was made proportional to the supply voltage (ratiometric), so that the supply voltage would cancel out of the capacitance/density equation. This makes the circuitry tolerant to power-supply fluctuations.

Digital circuitry is used to measure this density. One such circuit is illustrated in Figure 3.

(Click to view Figure 3.)

The pulse-width modulator gates the density input to the enable gate of a counter. This allows "m" cycles to be counted. Suppose the counter accumulated "n" sample during this period, then the density would be n/m. Running this for 100 cycles results in a resolution of 1 part in 100. Running 10 times longer results in a resolution of 1 part in 10,000. The greater the number of cycles observed, the better the resolution.

Design example
In a typical water cooler, the water is dispensed from a mechanical spigot. The level must be close to the nozzle. Using capacitive sensing, the lever is replaced with a solenoid valve. The switch can be placed for the ergonometric convenience of the user. The CPU can also determine the length of time the switch is pressed, so as to not allow vandals to force the valve to stay on. This vandal protection can be as simple or as complicated as desired.

This project is implemented with a Cypress CY24x94 PSoC device (Figure 4). One pin will be used for a sensor, one for the discharge resistor and one for the integration cap, for a total of three pins. One output is used to drive the water value.

(Click to view Figure 4.)

A conventional water cooler consists of a water tank, a refrigeration compressor and a thermal relay. The thermal relay monitors the temperature of the water in the tank. When the tank goes above a specific temperature, the thermal relay engages, causing the compressor to run. Adjusting the water temperature requires adjusting a screw on the relay. It is an open-loop, hit-or-miss operation.

Instead of using a thermal relay, the same controller managing the capacitive sensor can be used to measure the temperature and then control the power to the compressor. Rather than require a second controller, the first can be reconfigured to also take on the task of measuring temperature.

Temperature can easily be measured using a thermistor (a semiconductor device whose resistance decreases as the temperature increases). Measure the resistance and the temperature can be calculated. Figure 5 shows a circuit for measuring resistance.

By measuring the voltages across the thermistor and the reference resistor, it is possible to determine the thermistor's resistance, Equation 4.

The same circuitry that is used to sense capacitance can be reconfigured to allow the temperature to be measured. When converted back to a temperature, this value is used to determine if the refrigeration compressor should be turned on.

Extra thermistors can be provided to measure the room temperature and compressor temperature, since an overheated compressor can be the cause of a premature failure.

The sensing controller can disable operation of the unit whenever a problem is detected, flag the user that the unit has malfunctioned, and wait for the unit to be repaired.

Better with capacitive
So, what steps should be taken if the compressor is running hot? One of the first troubleshooting suggestions is to measure the input voltage. This is a diagnostic that can be accomplished with relative ease with dynamic reconfiguration. Reconfiguring the controller to be a voltmeter enables measurement of the main voltage. In addition, other system voltages can also be measured. Figure 6 shows an expanded block diagram with all these extra features.

Figure 6: An improved system with water-temperature control is shown.

With temperature being easy to measure, it would also be very beneficial if the user could set the desired temperature. This only requires a keypad and a display.

The keypad is simple and can be built with capacitive sensors that use the capacitive sensing user module already placed. The controller can also control an LCD driver IC using a standard industry protocol. By following these simple procedures, it is now possible for the user to set the desired water temperature and see it displayed. Sixteen inputs will be reserved for a user interface.

With the addition of a clock crystal, the capacitive-sensing controller is able to keep accurate time, so the cooler can be turned off or the operation-temperature set point increased when it is traditionally not used. Figure 7 illustrates an expanded block diagram with these features.

Figure 7: With the addition of a clock crystal, the capacitive-sensing controller is able to keep accurate time.

A major cost of ownership of a water cooler is the expense of repair service calls. If the capacitive sensing controller also has a USB interface, Figure 8, it could be used for a diagnostic port. When the repair technician visits, troubleshooting begins by plugging a laptop into the service port. It would also be possible to connect the owner's PC to the port and have a remotely located technician assess the problem.

Given the large number of I/O pins and the dynamic, reconfigurable nature of a capacitive sensing controller, there are nearly endless features that can be added. The addition of a stress gauge to measure the weight of the remaining water in the bottle, or a wireless interface to allow even easier diagnostics, are just a couple of possibilities.

Figure 8: When the capacitive sensing controller also has a USB interface, it could be used for a diagnostic port.

Since they have no mechanical parts and they easily conform to curved surfaces, touch-sense capacitor switches can be a near-ideal technology for today's product applications. With dynamic reconfiguration, it is possible to reuse hardware to perform additional system functions with little or no additional cost.

About the author
Dave Van Ess
is an applications engineer at Cypress Semiconductor Corp.

Article Comments - Capacitive sensing makes a splash
*? You can enter [0] more charecters.
*Verify code:


Visit Asia Webinars to learn about the latest in technology and get practical design tips.

Back to Top