Vous êtes sur la page 1sur 10

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 2. A grounded metal plane catches a part of the sensor
automotive applications is often essential. For example, electric field and reduces the added by palm
proximity detector is used to turn on the backlight in a capacitance.
kitchen stove or the internal lamp in a microwave oven Figure 1. CY3235 Proximity Detector Demonstration Kit
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.

January 25, 2008 Document No. 001-42851 Rev. ** 1

[+] Feedback
AN42851

Electrical Field Simulation


Figure 3. Electrical field from a single wire sensor with a
Simulations using the tool Comsol Multiphysics V.3.2 are
metal object
made to clarify the influence of a metal presence near the
proximity detection sensor.
This tool has a powerful interactive environment for Electrical
Palm
modeling and solving most scientific and engineering field lines
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. Metal Wire
The electrical field from a single proximity detection sensor surface sensor
with and without metal object simulation is shown in Figure
2 and Figure 3.
The simulation conditions are:
Figure 2. Electrical Field from a Single Wire Sensor
without a Metal Object
 The palm is modeled as a 10cm x 15cm x 1.5cm
metal substrate with zero potential (grounded).
Electrical Palm
field lines  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.


Wire  The grounded metal plate dimensions are 500 x
sensor 500mm.
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 added-
by-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 c) Dividing the result of the last equation by the value of a
electrical field vector tension in any point of the medium. potential of the object inside our image cube to find the
These results are used in calculating the mutual value of the mutual capacitance:
capacitance of a system of electrodes.
n
The capacitance is defined by the formula: q
i 1
i
n Cmutual  (5)
q i

C i 1 (1) Calculate the own capacitance, by repeating the
 aforementioned steps without the palm:
According to the Gauss theorem, the flux of the vector of Using the equations (3)-(5) you find:
tension of the electrostatic field in a vacuum through the
n

q
closed surface is equal to the algebraic sum of the
charges concluded into this surface divided by electric i
permanent(1): Cown  i 1 (6)

  1 n

 E  dS     q
S 0 i 1
i
(2) Then intercapacitance between sensor and palm is equal
to:

S - Any closed surface that includes wire sensor. Cint  Cmutual  Cown (7)

Where: The simulations are repeated several times with different


sensor configurations. The summary of the results is
 0  8.85 10 12 F / m ,   5 V shown in Table 1.

If there is a system of some objects displaced in a medium Table 1. Simulation Results


and you add one or more other objects, you can evaluate Configuration Cmutural, pF Cowm, pF Cint, pF
the intercapacitance by subtracting the value of the mutual
capacitance in a system without the additional objects, No metal objects 8.89 8.36 0.53
from the value with the additional objects. Metal object,
The algorithm to calculate the intercapacitance of a connected to 22.53 22.46 0.07
system of electrodes is: ground
Metal object with
Calculate the mutual capacitance of an arbitrary
same potential as 110.6 110.3 0.3
electrodes system by:
sensor
a) Calculating the flux of the vector of tension of the
electrostatic field through a closed surface that concludes
wire sensor: As shown in simulation results for this configuration, the
grounded metal surface decreases the added-by-palm
 
ФE  E  dS
S
(3) 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
b) Finding the algebraic sum of the charges included into level as the proximity detection sensors, the added
this closed surface using the Gauss theorem: capacitance is 0.3pF, which is only two times less than
n 0.57pF for a configuration without metal object presence.
q  Ф
i 1
i E  0 (4) 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.

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 Figure 5. Electrical Field Propagation for a Single Sensor
configuration without metal is shown in Figure 4. Electrical Configuration with a Solid Metal Object
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 Finger
some threshold values.
The detection distance depends on the sensor electrical Sensor
Detection distance
field propagation (electrical field strength). A longer
propagation distance provides a longer detection range. A PCB
metal surface can catch a part of the electrical field and
decrease the propagation distance, that is, the detection
range.
Earth Ground Metal Surface
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 Figure 6. Using a Shield Electrode to Decrease the Metal
as the sensor. The shield electrode’s charge and Object’s Influence
discharge cycles are synchronous with the sensor cycles.
Finger
Note A shield electrode must always have the same
potential as the sensor. Detection
distance
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 Sensor
Shield PCB
Electrode Isolation
Finger
Detection
distance Earth Ground Metal Surface

PCB Sensor

January 25, 2008 Document No. 001-42851 Rev. ** 4

[+] Feedback
AN42851

Figure 8. Using Wire as Sensor


Using CSD for Proximity Sensing
The CSD UM (User Module) is selected for proximity Finger
Detection
sensing because of its ability to form a signal for the shield distance
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 Shield Sensor wire
Electrode
PCB
Vref

Vdd Reference source

Earth Ground Metal Surface


Ph1
Sw1
Sw4
C ss Sw2 Latch
Shield VCfilt CMP

Rb
CapSense PCB Ground to Metal Case
Ph2
Sw5
Ph2
Sw. cap
Sw3
Connection
Cx Cfilt
The PCB to metal case connection is very important for
Sigma-delta modulator proximity detector sensitivity. Some possible methods are
shown in Figure 9.
In the CSD User Module the same phase signal used for Figure 9. PSoC Board Ground to Metal Case Connection
the precharge clock is supplied to the shielding electrode.
The difference between the sensor signal and the shield PCB PCB

Direct PCB Ground to Metal connection


PSoC PSoC

PCB Ground to Metal connection


electrode decreases as the modulator reference
decreases. The switches Sw1 and Sw4 are on in phase

Via inductor 33 uH
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.
Electrode(Bottom) Sensor(TOP)

Electrode(Bottom) Sensor(TOP)
Proximity

Proximity
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.
Shield

Shield

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 Solid Metal Solid Metal
electrode effect and better sensitivity because the wire is Case Ground Case Ground
located farther from the shield electrode. The isolation Figure 9 shows the direct ground connections. A ground
space between the board and the metal body is not connection using a small inductor above several uH
needed. But the mechanical construction with a wire as a provides 50% higher sensitivity and a galvanic board to
sensor is more complicated for mass production. 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. ** 5

[+] Feedback
AN42851

Proximity Sensor Testing


Table 3. CSD Test Table Summary.
Some sensitivity tests are done with different test
construction configurations to provide practical Detection
B,
recommendations. The test conditions are shown in Figure Ground Connection A, mm Distance, cm
cm
10.
Figure 10. CSD Test Conditions Direct ground 10
0 10
connection short.
A
Ground connection via 15
CSD 0 10
inductor.
Wire Sensor Direct ground 16
Shield Isolation 5 20
connection
B

Ground connection via 22


5 20
inductor.

Table 4. CSD Test Results


Metal Surface
A, A, B, Detection distance
B, cm
mm inch inch
cm inch
A=0.5…4сm, Shield to metal distance B=0…15mm. Tests
5 0.2 0 0 10 4
metal surface is 400mm x 400mm x 2mm grounded steel
plate. 5 0.2 5 2 13 5
The CSD UM parameters are shown in Table 2. The raw 5 0.2 10 4 17 6.7
2
counts are monitored using CY3240 I C-USB bridge kit. 5 0.2 15 6 22 8.6
Table 2. CSD UM Parameters No No
5 0.2 25 10
metal metal
User Module Parameter Value
10 0.4 0 0 10 4
Finger Threshold 45
Noise Threshold 30 10 0.4 5 2 17 6.7
Baseline Update Threshold 200 10 0.4 10 4 20 8
Sensors Autoreset Disabled 10 0.4 15 6 22 8.6
Hysteresis 15 No No
10 0.4 28 11
Debounce 3 metal metal
Negative Noise Threshold 20 20 0.8 0 0 10 4
Low Baseline Reset 50 20 0.8 5 2 16 6
Scanning Speed Slow
20 0.8 10 4 18 7
Resolution 15
20 0.8 15 6 21 8
Modulator Capacitor Pin P0[3]
Feedback Resistor Pin P1[5] No No
20 0.8 26 10
metal metal
Reference ASE11
Ref Value 0
30 1.2 0 0 10 4
Shield Electrode Out Row_0_Output_3 30 1.2 5 2 14 6
30 1.2 10 4 17 6.7
Experimental results are shown in Table 3 and Table 4. 30 1.2 15 6 20 7.8
Ground connection is direct short. Wire is used as the No No
sensor and the sensor length is 30 cm (12 inch). The tests 30 1.2 28 11
metal metal
are done using the palm to proximity sensor.
40 1.6 0 0 10 4
The test setup schematics are shown in Appendix 1 and a
PSoC project is provided along with this application note. 40 1.6 5 2 15 6
The detection distance estimated when added-by-palm 40 1.6 10 4 20 8
difference signal is more than five times larger than noise
40 1.6 15 6 25 10
level (peak-to-peak value). This technique matches the
recommendations given in AN2394 - CapSense™ Best No No
40 1.6 30 12
Practices. metal metal

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

0
0 5 10 15
Shield to Metal Distance (B), mm

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

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

1
C1 VCC
0.1uF

R1
100

32

31

30

29

28

27

26

25
Vdd
P0[3]

P0[5]

P0[7]

P0[6]

P0[4]

P0[2]
1 Vss 24
P0[1] P0[0] J2
2 23 1
P2[7] P2[6]
3 U1 22
P2[5] P2[4] Shield electrode
4 CY 8C21634 21
P2[3] P2[2]
5 20
P2[1] P2[0]
6 19
P3[3] P3[2]
7 18
P3[1] P3[0]
8 17
P1[7] XRES
P1[5]

P1[3]

P1[1]

P1[0]

P1[2]

P1[4]

P1[6]
Vss
9

10

11

12

13

14

15

16

R2
20K

VCC
J3
1
C2 2
0.1uF 3
4
5

ISSP/I2C

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

January 25, 2008 Document No. 001-42851 Rev. ** 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
Metal frame with
oven
conductive grid

Proximity
sensor PCB
under metal

Mounting
Door plastic
sensor PCB in
case
plastic case

Proximity
sensor PCB Shield
electrode

Relay

January 25, 2008 Document No. 001-42851 Rev. ** 9

[+] Feedback
AN42851

About the Authors


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

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

Vous aimerez peut-être aussi