Proximity Detection in the Presence of Metal Objects

AN42851
Author: Victor Kremin, Andriy Ryshtun, Vasyl Mandzij Associated Project: Yes Associated Part Family: CY8C21x34, CY8C24x94 GET FREE SAMPLES HERE Software Version: PSoC Designer™ 4.4 Associated Application Notes: AN2352

Application Note Abstract
This application note describes implementing proximity detection at the presence of large metal objects. Recommendations about sensor mechanical construction and proximity sensing best practices are provided. An example of proximity sensing implementation for microwave ovens is also provided.

Introduction
The ability to use proximity detection in white goods and automotive applications is often essential. For example, proximity detector is used to turn on the backlight in a kitchen stove or the internal lamp in a microwave oven when the palm is close to the door. In various home appliances a proximity sensor turns on the display when the user tries to adjust some parameters. Cypress provides a CY3235 kit that demonstrates proximity sensing. The CY3235 kit has a detection range of 30 cm when the sensor is located far away from conductive objects such as metals. When a wire sensor is placed on a metal surface, detection range dramatically decreases from 30 cm to 2 cm. Most white good and automotive applications have a metal frame or case that is a challenge for proximity sensing devices. This CY3235 kit contains a wired sensor and small PCB with CY8C21434 chip on board, as shown in Figure 1. The reasons why the proximity detection range reduces dramatically when conductive objects are placed close to the sensor are: 1. The sensor stray capacitance increases. Stray capacitance reduces the proximity response value by providing a higher full scale range. Larger stray capacitance often requires operation frequency reduction, causing the additional detection distance to decrease. 2. A grounded metal plane catches a part of the sensor electric field and reduces the added by palm capacitance.

Figure 1. CY3235 Proximity Detector Demonstration Kit

January 25, 2008

Document No. 001-42851 Rev. **

1

[+] Feedback

AN42851

Electrical Field Simulation
Simulations using the tool Comsol Multiphysics V.3.2 are made to clarify the influence of a metal presence near the proximity detection sensor. This tool has a powerful interactive environment for modeling and solving most scientific and engineering problems based on Partial Differential Equations (PDEs). Using the built in physics modes, it is possible to develop models by defining the relevant physical quantities such as material properties (geometric dimensions, object conductivity, dielectric constant, and so on) and sources, rather than by defining the underlying equations. Comsol Multiphysics internally compiles a set of PDEs representing the entire model. The electrical field from a single proximity detection sensor with and without metal object simulation is shown in Figure 2 and Figure 3. Figure 2. Electrical Field from a Single Wire Sensor without a Metal Object Electrical field lines Palm Figure 3. Electrical field from a single wire sensor with a metal object Electrical field lines

Palm

Metal surface

Wire sensor

The simulation conditions are:

     

The palm is modeled as a 10cm x 15cm x 1.5cm metal substrate with zero potential (grounded). The sensor wire has a diameter of 2 mm and length of 150 mm. The wire potential is 5V. The wire to palm distance is 80mm. The wire to metal distance is 2mm. The grounded metal plate dimensions are 500 x 500mm.

Wire sensor

The simulation results show that the metal surface catches a part of the proximity detector sensor electrical field and greatly decreases the electrical field strength. This causes the proximity sensor detection range to decrease. To get the quantitative data there is an estimated addedby-palm capacitance with and without a metal object using the Gauss theorem in the section Interelectrode Capacitance Calculation on page 3.

January 25, 2008

Document No. 001-42851 Rev. **

2

[+] Feedback

AN42851

Interelectrode Capacitance Calculation
Using the simulation results you can determine the electrical field vector tension in any point of the medium. These results are used in calculating the mutual capacitance of a system of electrodes. The capacitance is defined by the formula: c) Dividing the result of the last equation by the value of a potential of the object inside our image cube to find the value of the mutual capacitance:

C

q
i 1

n

Cmutual 
i

q
i 1

n

i


repeating

(5) the

(1)

Calculate the own capacitance, by aforementioned steps without the palm: Using the equations (3)-(5) you find:

According to the Gauss theorem, the flux of the vector of tension of the electrostatic field in a vacuum through the closed surface is equal to the algebraic sum of the charges concluded into this surface divided by electric permanent(1):

Cown 

q
i 1

n

i

 E  dS     q
S 0 i 1

1

n

(6)

i

(2)

Then intercapacitance between sensor and palm is equal to:

S - Any closed surface that includes wire sensor.

Cint  Cmutual  Cown

(7)

Where:

 0  8.85 10 12 F / m ,   5 V
If there is a system of some objects displaced in a medium and you add one or more other objects, you can evaluate the intercapacitance by subtracting the value of the mutual capacitance in a system without the additional objects, from the value with the additional objects. The algorithm to calculate the intercapacitance of a system of electrodes is: Calculate the mutual electrodes system by: capacitance of an arbitrary

The simulations are repeated several times with different sensor configurations. The summary of the results is shown in Table 1. Table 1. Simulation Results
Configuration Cmutural, pF Cowm, pF Cint, pF 0.53 0.07

No metal objects Metal object, connected to ground Metal object with same potential as sensor

8.89 22.53

8.36 22.46

110.6

110.3

0.3

a) Calculating the flux of the vector of tension of the electrostatic field through a closed surface that concludes wire sensor:

  ФE  E  dS


S

(3)

As shown in simulation results for this configuration, the grounded metal surface decreases the added-by-palm capacitance by eight times, from 0.53pF to 0.07pF. This explains why the detection distance drops so much. When you change the metal plane potential to the same level as the proximity detection sensors, the added capacitance is 0.3pF, which is only two times less than 0.57pF for a configuration without metal object presence. This demonstrates that you can improve the detection distance by placing a large shield electrode with the same potential as sensor, between the metal case and the proximity detection sensor.

b) Finding the algebraic sum of the charges included into this closed surface using the Gauss theorem:

q  Ф
i i 1

n

E

 0

(4)

January 25, 2008

Document No. 001-42851 Rev. **

3

[+] Feedback

AN42851

Sensor Electrical Field Propagation from Metal Presence Dependence
Electrical field propagation for a single sensor configuration without metal is shown in Figure 4. Electrical field propagation for a single sensor configuration with a solid metal object is shown in Figure 5. Detection distance is the distance where the added capacitance exceeds some threshold values. The detection distance depends on the sensor electrical field propagation (electrical field strength). A longer propagation distance provides a longer detection range. A metal surface can catch a part of the electrical field and decrease the propagation distance, that is, the detection range. The influence of a metal surface on a sensor is decreased by placing a shield electrode between the proximity detection sensor and the metal object as shown in Figure 6. The shield electrode charges up to the same potential as the sensor. The shield electrode’s charge and discharge cycles are synchronous with the sensor cycles. Note A shield electrode must always have the same potential as the sensor. Electrical field strength from a single wire sensor with a close metal object and a shield electrode is shown in Figure 6. Figure 4. Electrical Field Propagation for a Single Sensor Configuration without a Metal Object
Finger Detection distance
Shield Electrode Sensor PCB Isolation

Figure 5. Electrical Field Propagation for a Single Sensor Configuration with a Solid Metal Object

Finger Sensor PCB Detection distance

Earth Ground

Metal Surface

Figure 6. Using a Shield Electrode to Decrease the Metal Object’s Influence
Finger Detection distance

Earth Ground

Metal Surface

PCB

Sensor

January 25, 2008

Document No. 001-42851 Rev. **

4

[+] Feedback

AN42851

Using CSD for Proximity Sensing
The CSD UM (User Module) is selected for proximity sensing because of its ability to form a signal for the shield electrode. The CSD conversion part basic block diagram is shown in Figure 7. CSD is the standard UM for CY8C21x34 and CY8C24x94 PSoC devices. You can get more information about module operation in the data sheet 001-13535 - CSD User Module (UM) Data Sheet. Figure 7. CSD Basic with Shield Electrode
Vref

Figure 8. Using Wire as Sensor

Detection distance

Finger

Shield Electrode

Sensor wire PCB

Vdd

Reference source

Ph1 Sw4

Earth Ground
Sw1 C ss Sw2

Metal Surface

Shield
Sw5 Ph2

VCfilt

CMP Rb

Latch

Sw. cap
Ph2 Cx Cfilt Sw3

CapSense PCB Ground to Metal Case Connection
The PCB to metal case connection is very important for proximity detector sensitivity. Some possible methods are shown in Figure 9. Figure 9. PSoC Board Ground to Metal Case Connection
PCB Ground to Metal connection Via inductor 33 uH
Solid Metal
PSoC

Sigma-delta modulator

Direct PCB Ground to Metal connection

Shield Proximity Electrode(Bottom) Sensor(TOP)

Using Wire as CapSense Sensor
Using a PCB plate as a capacitance sensor is described in Figure 6. The PCB plate is easy to manufacture but it is not optimal for sensitivity. Using a wire as a sensor electrode and placing the wire and shield on the same side of PCB is illustrated in Figure 8. Using a wire as a sensor provides higher shield electrode effect and better sensitivity because the wire is located farther from the shield electrode. The isolation space between the board and the metal body is not needed. But the mechanical construction with a wire as a sensor is more complicated for mass production.

Solid Metal

Case Ground

Case Ground

Figure 9 shows the direct ground connections. A ground connection using a small inductor above several uH provides 50% higher sensitivity and a galvanic board to the metal case connection. This is not the optimal solution for high sensitivity proximity sensing because in this case the EMI radiation can be higher.

January 25, 2008

Document No. 001-42851 Rev. **

Shield Proximity Electrode(Bottom) Sensor(TOP)

In the CSD User Module the same phase signal used for the precharge clock is supplied to the shielding electrode. The difference between the sensor signal and the shield electrode decreases as the modulator reference decreases. The switches Sw1 and Sw4 are on in phase Ph1, the switches Sw2 and Sw5 are on in phase Ph2. The Css is discharged in phase Ph1 phase and is charged in Ph2 phase. Therefore, the shield electrode always has approximately the same potential as the sensor and guards the sensor from the metal objects’ influence.

PCB

PCB

PSoC

5

[+] Feedback

AN42851

Proximity Sensor Testing
Some sensitivity tests are done with different test construction configurations to provide practical recommendations. The test conditions are shown in Figure 10. Figure 10. CSD Test Conditions
A

Table 3. CSD Test Table Summary.
Ground Connection Direct ground connection short. B, cm 0 0 5 5 A, mm Detection Distance, cm 10 15 16 22

10 10 20 20

CSD Wire Sensor Shield Isolation
B

Ground connection via inductor. Direct ground connection Ground connection via inductor.

Table 4. CSD Test Results

Metal Surface
A, mm A, inch B, cm B, inch

Detection distance cm inch

A=0.5…4сm, Shield to metal distance B=0…15mm. Tests metal surface is 400mm x 400mm x 2mm grounded steel plate. The CSD UM parameters are shown in Table 2. The raw 2 counts are monitored using CY3240 I C-USB bridge kit. Table 2. CSD UM Parameters
User Module Parameter Finger Threshold Noise Threshold Baseline Update Threshold Sensors Autoreset Hysteresis Debounce Negative Noise Threshold Low Baseline Reset Scanning Speed Resolution Modulator Capacitor Pin Feedback Resistor Pin Reference Ref Value Shield Electrode Out 45 30 200 Disabled 15 3 20 50 Slow 15 P0[3] P1[5] ASE11 0 Row_0_Output_3 Value

5 5 5 5 5 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40

0.2 0.2 0.2 0.2 0.2 0.4 0.4 0.4 0.4 0.4 0.8 0.8 0.8 0.8 0.8 1.2 1.2 1.2 1.2 1.2 1.6 1.6 1.6 1.6 1.6

0 5 10 15 No metal 0 5 10 15 No metal 0 5 10 15 No metal 0 5 10 15 No metal 0 5 10 15 No metal

0 2 4 6 No metal 0 2 4 6 No metal 0 2 4 6 No metal 0 2 4 6 No metal 0 2 4 6 No metal

10 13 17 22 25 10 17 20 22 28 10 16 18 21 26 10 14 17 20 28 10 15 20 25 30

4 5 6.7 8.6 10 4 6.7 8 8.6 11 4 6 7 8 10 4 6 6.7 7.8 11 4 6 8 10 12

Experimental results are shown in Table 3 and Table 4. Ground connection is direct short. Wire is used as the sensor and the sensor length is 30 cm (12 inch). The tests are done using the palm to proximity sensor. The test setup schematics are shown in Appendix 1 and a PSoC project is provided along with this application note. The detection distance estimated when added-by-palm difference signal is more than five times larger than noise level (peak-to-peak value). This technique matches the recommendations given in AN2394 - CapSense™ Best Practices.

January 25, 2008

Document No. 001-42851 Rev. **

6

[+] Feedback

AN42851

Figure 11. Detection Distance vs. Shield to Metal Distance Summary
30

25

Detection Distance, cm

20

Shield width (A)
0,5 cm / 0,2 inch 1 cm / 0,4 inch

15

2 cm / 0,8 inch 3 cm / 1,2 inch 4 cm / 1,6 inch

10

5

0 0 5 10 15

Shield to Metal Distance (B), mm

Summary
A simple method of proximity sensing close to a solid metal object is to use a shield electrode with a dedicated mechanical construction. This allows you to build a proximity sensor at the metal substrate. When a shield electrode is used as a conductive plane, the shield to metal distance greatly influences sensitivity. Sensitivity increases linearly with distance, increasing in the range of 1 mm to 30 mm. There are several ways of building a proximity sensor with a shield electrode. One way uses a double sided PCB. In this case, the shield electrode is located at the bottom of PCB layer and the sensor is located at the top layer. The sensor trace width must be around 1mm. Another method is to place the proximity sensor on the PCB where other components are installed. The best way is to place the sensing electrode on the board perimeter. The shield electrode must be located under the sensor at the bottom of the PCB layer. Do not use the large ground fill area inside the proximity sensor because this causes sensitivity degradation. If a multilayer PCB is used, fill the top layer by 20 to 25% hatched shield electrode copper pour; the internal layers can be used for ground and signals routing. If the device has a plastic case, glue the wire sensor with a shield electrode on the internal plastic case side to detect distance maximization. The recommended wire length is 10 cm to 20 cm, the recommended distance between the shield and the metal is 10 mm to 20 mm. Note Using CY8C24x94 with Second Order Sigma-Delta Modulator (CSDADC User Module) provides a larger detection range because of better SNR. The proposed technique is implemented for turning on the backlight lamp inside a microwave oven when you place a palm close to front panel. Images of a microwave oven design example are shown in Appendix 2. For this device, the detection distance without a shield was 5 cm, with a shield electrode it increased to 15 cm.

January 25, 2008

Document No. 001-42851 Rev. **

7

[+] Feedback

AN42851

Appendix 1
Note Sensor is connected to P0[2]. Shield electrode is connected to P2[6]. Figure 12. Single Sensor CSD Design Example Schematic
J1 Proximity Sensor C1 0.1uF VCC
1

R1 100

32

31

30

29

28

27

26 P0[4]

P0[3]

P0[5]

P0[7]

Vdd

P0[6]

1 2 3 4 5 6 7 8

P0[2]

Vss

25

P0[1] P2[7] P2[5] P2[3] P2[1] P3[3] P3[1] P1[7]
P1[5] P1[3] P1[1] P1[0] P1[2] P1[4] Vss

P0[0] P2[6] U1 CY 8C21634 P2[4] P2[2] P2[0] P3[2] P3[0] XRES
P1[6]

24 23 22 21 20 19 18 17 1

J2

Shield electrode

10

11

12

13

14

15

R2 20K

J3 C2 0.1uF 1 2 3 4 5 ISSP/I2C

VCC

R2 was selected for providing 70% raw counts value as recommended in CSD UM datasheet.

January 25, 2008

Document No. 001-42851 Rev. **

16

9

8

[+] Feedback

AN42851

Appendix 2
An example design of a microwave oven is shown here. Proximity sensing is limited because of the door’s metal grounded surface. The proximity sensor inside the door turns on the lamp inside the oven. The oven door is made as a large grounded metal surface. Sensing area

Microwave oven

Metal frame with conductive grid

Proximity sensor PCB under metal

Door plastic case

Mounting sensor PCB in plastic case

Proximity sensor PCB

Shield electrode

Relay

January 25, 2008

Document No. 001-42851 Rev. **

9

[+] Feedback

AN42851

About the Authors
Name: Title: Background: Contact: Name: Title: Background: Victor Kremin Ukraine Solution Center Team Leader Victor has more than ten years in the embedded applications design domain Victor.Kremin@cypressua.com Andriy Ryshtun Ukraine Solution Center Applications Engineer Andriy has more than two years in USC, with experience in analog electronics, CapSense and PCB design. Andriy.Ryshtun@cypressua.com Vasyl Mandziy Ukraine Solution Center Applications Engineer Vasyl is experienced in the mathematical simulation of electrical fields. Vasyl.Mandziy@cypressua.com

Contact: Name: Title: Background:

Contact:

PSoC is a registered trademark of Cypress Semiconductor Corp. "Programmable System-on-Chip," PSoC Designer, and PSoC Express are trademarks of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are the property of their respective owners.

Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone: 408-943-2600 Fax: 408-943-4730 http://www.cypress.com/ © Cypress Semiconductor Corporation, 2008. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source Code except as specified above is prohibited without the express written permission of Cypress. Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. Use may be limited by and subject to the applicable Cypress software license agreement.

January 25, 2008

Document No. 001-42851 Rev. **

10

[+] Feedback

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer: Get 4 months of Scribd and The New York Times for just $1.87 per week!

Master Your Semester with a Special Offer from Scribd & The New York Times