SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Capacitance Sensing - Waterproof
                                                                              Capacitance Sensing

                                                                                                               AN2398
                                                                      Author: Victor Kremin and Ruslan Bachunskiy
                                                                                          Associated Project: Yes
                                                                  Associated Part Family: CY8C21x34, CY8C24x94
                                                                                       GET FREE SAMPLES HERE
                                                                         Software Version: PSoC Designer™ v. 4.3
                                                                           Associated Application Notes: AN2352
                                                                                      PSoC Application Notes Index

Application Note Abstract
Capacitance sensing systems can be used in applications that are exposed to rain or water. Such applications include
automotive applications, outdoor equipment, ATMs, public access systems, portable devices such as cell phones, PDAs, and
kitchen and bathroom applications. This Application Note discusses using capacitance sensing on systems that must continue
operating under moisture, rain or water drops. The proposed technique prevents false touch detection even when the sense
area is covered completely with water.




Introduction
                                                                Table 1. Keyboard Characteristics
The capacitance sensing technique can be effectively used
in applications where the touch sensing zone is exposed to
                                                                          Characteristic                       Value
moisture, rain, or water drops. PSoC® CapSense allows
                                                                  Number of Keys                  3
you to replace expensive mechanical switches, improve
device reliability, and reduce total system cost.                 Size of Sensors                 15 × 15 mm
                                                                                                  2
There are numerous areas where waterproof capacitance             Host Communications Interface   I C (for debug purposes)
sensing can be used. In vehicle applications, examples            Insulation Overlay Thickness    1-5 mm (glass or plastic)
include door opening devices, code entry systems, alarm
                                                                  Power Supply Voltage            5 ± 0.25V
sensors, and capacitive parking proximity sensors.
Waterproof capacitive sensors can be used in a wide variety
of home applications including kitchen equipment, bathroom      Experimental Arrangement
light switches, automatic faucets, and dish and clothes
                                                                A simple test setup was created to test water’s influence on
washing machines. Water resistant capacitive touch screens
                                                                capacitive sensing. The CYC821x34 PSoC family device
can be used on ATMs, PDAs, cell phones, portable GPS
                                                                was used for testing with the CSD (CapSense Sigma Delta)
navigation systems, and other devices that are used
                                                                User Module sensing method. The PSoC device was placed
outdoors.
                                                                on the sensing board. To display sensor status, several
The project created to test the water resistant capacitive      additional LEDs were located on a small supplemental
sensing technique under simulated application uses three        board and connected to the PSoC board. This board can be
simple buttons on a keyboard. You can expand the project        placed at different locations during tests to aid sensors’
to fit your specific application requirements. For example,     status observations.
you can increase the number of buttons, use different button
                                                                To monitor the sensor, raw counts, and other data during
dimensions and shape, and so on. The technical
                                                                realtime tests, an I2C-USB bridge was used. The bridge GUI
characteristics of the associated project are shown in
                                                                PC tool monitors multiple traces at the same time, logs them
Table 1.
                                                                to a file, and calculates scale and offset factors on the
                                                                collected data. For more details about using the I2C-USB
                                                                bridge to debug CapSense applications, see AN2352, quot;I2C-
                                                                USB Bridge Usage.quot; Figure 1 shows the experimental
                                                                environment.




December 8, 2006                               Document No. 001-14501 Rev. *A                                                 1



                                                                                                                                  [+] Feedback
AN2398



            Figure 1. Experimental Environment                    The sensor board contains three touch sensors, a guard
                                                                  sensor located around the perimeter and two shield
        Sensor Board                                              electrodes connected in parallel.
                                                                  The three touch sensors are surrounded by the internal ring
                                                                  of the shield electrode. The internal shield electrode protects
                                                                  the button sensors from detecting false touches caused by
                                                                  water drops. The guard sensor is located between the
                                                                  internal and external rings of the shield electrode and is
                                  LED Display Board
                                                                  used to detect the presence of a water stream. The external
                                                                  shield electrode ring protects the guard sensor from
        PSoC Board
                                                                  detecting false touches caused by water drops. The
                                                                  shielding electrode also reduces the influence of parasitic
                                                                  capacitance by lowering the sigma delta modulator input
                                                                  current. See the CSD User Module Data Sheet in PSoC
           I2C-USB                                                Designer for more details about shield electrode operation.
            Bridge
                                                                  Water is applied to the sensor board from the insulation
                                                                  layer side. To prevent the sensing electrodes from coming
                                       PC                         into direct contact with water, they are coated with an
                                                                  insulating varnish. The connection wires have waterproof
                                                                  insulation as well. The metal zone of the sensor board is
The sensors are located on a separate plate and are               95*45 mm. Each sensor is a 15 mm square. The guard
connected to the PSoC CapSense board using thin pliable           sensor is 2.5 mm wide.
wires. The sensors are located separately from the
CapSense PCB so that the sensor board can be easily
                                                                  Test Setup Schematic
subjected to different conditions, for example, applying a
stream of water to the sensor board.                              Figure 3 shows the test setup schematic. The LEDs with
                                                                  current limiting resistors are installed on a separate display
The sensor board was created using a 2-mm thick single
                                                                  board. The standard CY3212 or CY3213 board can be used
side foil FR4 material. An illustration of the sensor board is
                                                                  for experiments. The CY3213 board supports the CSD
shown in Figure 2.
                                                                  method. The CY3212 can be modified to support the CSD
              Figure 2. Sensors Board Drawing                     method by installing a modulator feedback resistor.
                   2,52




December 8, 2006                                 Document No. 001-14501 Rev. *A                                               2



                                                                                                                                    [+] Feedback
AN2398



                                                      Figure 3. Test Setup Schematic
                                                                                                         R4 240
                                                      CMOD
                                                                               5V
                                                         C4
                                                      10nF

                                               R6
                                               2.2k




                                                                        32
                                                                        31
                                                                        30
                                                                        29
                                                                        28
                                                                        27
                                                                        26
                                                                        25
                                                                          Vdd
                                                                          Vss
                                                                         P0[3]
                                                                         P0[5]
                                                                         P0[7]

                                                                         P0[6]
                                                                         P0[4]
                                                                         P0[2]
                                      R1 240                                                              R3 240
                                                            1                                       24
                                                                P0[1]                       P0[0]
                                                            2                                       23
                                                                P2[7]                       P2[6]
                                                            3                                       22
                                                                P2[5]                       P2[4]
                                      R2 240                4                  U1                   21
                                                                P2[3]                       P2[2]
                                                            5              CY 8C21434               20
                                                                P2[1]                       P2[0]
                         D1       D2                        6                                       19                  D3             D4
                                                                P3[3]                       P3[2]
                                                            7                                       18
                         Sens2    Guard                                                                                 Sens1          Sens3
                                                                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
                                                       FB
                                                                                                                                J1
                          5V                                                                                       5V
                                                                                                                          1
                                                                                                                          2
                                                                                                                          3
                                                                                                I2CSDA                    4
                                                                                                I2CSCL                    5
                                  +
                          C3           C2
                          100nF        10uF                                                                             IS S P /I2 C
                                                         SENS3
                                                         SENS1                                  SENS2
                                                         SHIELD
                                                                                                GUARD




                                                                        Sens1 Sens2 Sens3




                                                                                            Figure 4. I2C-USB GUI Variables Setting Example
Water Influence Tests
The following was used for all testing of the influence of
water on the raw sensor counts. The sensor board was set
vertically during all experiments. Photos of the tests are
shown in Appendix A. Tap water was used to test the
board. To simulate worst-case conditions, some kitchen
salt was dissolved in the water, resulting in increased
water conductivity.
                                                                                    Additionally, the effect of setting different modulator
The following tests were completed:                                                 reference values during the water droplets test was
                                                                                    examined. These results are discussed ahead.
    Touching the dry sensor with a finger.
                                                                                    The first test checks the keyboard operation when no
    Applying water droplets from a sprayer when the                                 water is present on the board and a finger touches all of
    shield electrode was connected to ground.                                       the sensors sequentially (as shown in Figure 5a). As you
                                                                                    can see in the figure, the finger touches are easily
    Touching the sensor with a finger after a water stream                          detectable.
    was applied and water droplets were left on the
                                                                                    The second test checks the sensor functions when water
    insulator.
                                                                                    drops are present on the sensor, the shield electrode is
                                                                                    enabled, and a finger touches all of the sensors
    Applying water droplets from a sprayer when the
                                                                                    sequentially (as shown in Figure 5b). As can be seen from
    shield electrode was active.
                                                                                    the figure, small signal spikes take place because the
                                                                                    finger first touches the water droplet, then the board.
    Applying a continuous water stream to the board from
                                                                                    These spikes are negligible in comparison to the signal
    a large cup.
                                                                                    from the finger and do not create any problems with touch
The results of these tests are shown in Figure 5. To make                           detection. The finger touch signals are easily detectable.
the collected data easy to visually analyze, the raw count
data from different sensors were biased using the Offset
feature in the I2C-USB bridge GUI PC tool. The settings
from the example are shown in Figure 4.




December 8, 2006                                      Document No. 001-14501 Rev. *A                                                               3



                                                                                                                                                        [+] Feedback
AN2398



                                                                Figure 5. Water Influence Test Results

                        Dry Sensors Finger Touch with no Water                                   Water Droplets with Shield Electrode Enabled
                2 400                                                                           1 800                                                          Sensor 1
                                                                    Sensor 1
                2 300                                                                                                                                          Sensor 2
                                                                    Sensor 2                    1 700
                2 200                                                                                                                                          Sensor 3
                                                                    Sensor 3
                                                                                                1 600
                2 100                                                                                                                                           Guard
                                                                     Guard
                2 000                                                                           1 500
                1 900
                                                                                                1 400
                1 800
                                                                                                1 300
                1 700
                1 600                                                                           1 200
   Raw Counts




                                                                                   Raw Counts
                1 500
                                                                                                1 100
                1 400
                1 300                                                                           1 000
                1 200                                                                             900
                1 100
                                                                                                 800
                1 000
                  900                                                                            700
                  800
                                                                                                 600
                  700
                                                                                                 500
                  600
                  500                                                                            400
                  400
                                                                                                 300
                  300
                                                                                                 200
                  200
                  100                                                                            100
                         350 400 450 500 550 600 650 700 750 800 850 900                                0   20   40   60   80 100 120 140 160 180 200 220 240 260
                                                                     Sample #                                                                                Sample #
                                               a)                                                                                       d)

                        Wet Sensors Finger Touch Response after
                                                                                                Water Stream Applying to Sensors Panel, sample #1
                                Applying Water Stream
                                                                                                2 400
                2 400                                              Sensor 1                                                                                    Sensor 1
                                                                                                2 300
                2 300                                              Sensor 2                                                                                    Sensor 2
                                                                                                2 200
                2 200                                              Sensor 3                                                                                    Sensor 3
                                                                                                2 100
                2 100                                               Guard                                                                                       Guard
                                                                                                2 000
                2 000
                                                                                                1 900
                1 900
                1 800                                                                           1 800
                1 700                                                                           1 700
                1 600                                                                           1 600
                1 500                                                                           1 500
   Raw Counts




                                                                                   Raw Counts




                1 400                                                                           1 400
                1 300                                                                           1 300
                1 200                                                                           1 200
                1 100                                                                           1 100
                1 000                                                                           1 000
                  900                                                                             900
                  800                                                                             800
                  700                                                                             700
                  600                                                                             600
                  500                                                                             500
                  400                                                                             400
                  300                                                                             300
                  200                                                                             200
                  100                                                                             100
                         200 250 300 350 400 450 500 550 600 650 700 750                                    1 000     1 100     1 200        1 300   1 400       1 500
                                                                    Sample #
                                                                                                                                                              Sample #
                                               b)                                                                                       e)


                                                                                                Water Stream Applying to Sensors Panel, sample #2
                   Water Droplets with Shield Electrode Disabled
                                                                                                2 400
                3 100                                                Sensor 1                   2 300                                                             Sensor 1
                3 050                                                Sensor 2                   2 200                                                             Sensor 2
                                                                     Sensor 3                                                                                     Sensor 3
                                                                                                2 100
                3 000
                                                                                                                                                                   Guard
                                                                                                2 000
                2 950
                                                                                                1 900
                2 900                                                                           1 800
                2 850                                                                           1 700
   Raw Counts




                                                                                   Raw Counts




                                                                                                1 600
                2 800
                                                                                                1 500
                2 750
                                                                                                1 400
                2 700                                                                           1 300
                2 650                                                                           1 200
                                                                                                1 100
                2 600
                                                                                                1 000
                2 550
                                                                                                  900
                2 500                                                                             800
                                                                                                  700
                2 450
                                                                                                  600
                2 400
                                                                                                  500
                2 350                                                                             400
                2 300                                                                             300
                                                                                                  200
                2 250
                                                                                                  100
                                                                                                        400 450 500 550 600 650 700 750 800 850 900 950
                         500     600     700        800   900       1 000
                                                                    Sample #
                                                                                                                                                              Sample #
                                               c)                                                                                       f)




December 8, 2006                                                    Document No. 001-14501 Rev. *A                                                                               4



                                                                                                                                                                                      [+] Feedback
AN2398



The third test checks the sensor functions when water is            When a finger touches the dry surface, the finger adds
sprayed on the board and the shield electrode is disabled           capacitance Cx to the sensing electrode (Figure 6a). When
(as shown in Figure 5c). As you can see in the figure, the          an isolated water drop is located between the sensing and
water spray can produce signal spikes close to the signal           shield electrodes (Figure 6b), the capacitive coupling
from the finger; the finger touch signal is 400 counts above        between the shield and sensing electrodes is increased
baseline, while the water drop signal is 200 counts, about          (via Cwd and Cws capacitances).
half. It may cause false touch detection under some
                                                                    When a continuous water stream is applied to the sensing
conditions.
                                                                    surface (Figure 6c), the large capacitance of the stream
The fourth test checks the sensor functions when water is           Cst is added. This capacitance may be several times larger
sprayed on the board and the shield electrode is enabled            than the shield electrode-to-water capacitance, Cwd.
(Figure 5d). As can be seen from this figure, the spike             Because of this, the effect of the shield electrode is
levels are more than six times less than the finger signal          completely masked and the sensor raw counts are the
and can be easily distinguished. Therefore, the shield              same as or even higher than a finger touch. In this
electrode effectively protects the keyboard controller from         situation the guard sensor can help. When it detects the
false touch detection.                                              stream it can block the other sensors from triggering.
The next test checks the sensor functions when a water              Several additional tests were done using different sigma
stream is applied to the board and the shield electrode is          delta reference voltages to determine what effect they had
enabled (Figure 5e, and Figure 5f). As you can see from             on the tests. Two of these results are shown in Figure 7.
the figures, the water stream produces signal spikes on all         The area where there is little change in the raw counts is
sensors with the same magnitude as a finger touch. These            when the sensor is dry. Then water is sprayed on the
will produce false touch detection. The guard sensor,               insulator.
however, produces signals with even higher levels than
                                                                     Figure 7. Raw Counts Change when Water Droplets were
the touch sensors, because the guard sensor has a larger
                                                                               Applied at Different Reference Settings
sense area. So the guard sensor can be used to detect
the presence of a water stream on the board and                           140           Ref=0.25Vdd
implement blocking decision logic when a water stream is                                Ref=0.4Vdd
                                                                          120
detected.                                                                 100

There are some illustrations to show CapSense                             80

configurations during water tests. See Figure 6.                          60

                                                                          40
Figure 6. Sensing On Dry Surface (a), with Water Droplets
                                                                          20
   on Surface (b) and when Water Stream is Applied to
                                                                           0
                       Surface (c)
                                                                          -20

                                                                          -40

                                                                          -60

                                                                          -80

                                                                                  0        200        400       600       800

                                                                                                                       Sample #




                                                                    As you can see in Figure 7, at a low reference voltage the
                                                                    spikes are mostly positive, the same direction as finger
                                                                    touches. When the reference voltage is increased, peaks
                                                                    are mostly lower than the quot;no waterquot; level because when
                                                                    the water droplet is located between the shield and
                                                                    sensing electrodes, the modulator current is reduced more
                                                                    than with a higher reference. The spike direction is the
                                                                    opposite of a finger touch signal change. The high-level
                                                                    API routines can utilize this characteristic and yield
                                                                    benefits from this by not resetting baseline levels when
                                                                    there are short durations of negative spikes. This
                                                                    functionality is not supported in the current version of the
                                                                    CSD User Module v. 1.0 but may be added in future
                                                                    versions.




December 8, 2006                                 Document No. 001-14501 Rev. *A                                                 5



                                                                                                                                    [+] Feedback
AN2398



When water droplets are applied to the insulator, the water                        Demonstration Firmware
can create thin films over the insulation surface, increasing
                                                                                   The firmware uses the CSD User Module. Some post
sensing electrode capacitance. This is why at low
                                                                                   processing has been added to handle the guard sensor
modulator reference voltages the raw count changes are
                                                                                   signal. The updated baseline algorithm has been left
more positive, while at higher voltages they are more
                                                                                   without changes. The selected CSD User Module
negative. This is due to the increased effect of the shield
                                                                                   parameters are shown in Figure 9. Note that the Sensors
electrode.
                                                                                   Autoreset parameter has been enabled to allow baseline
The objective is to get the maximum difference between                             updates regardless of sensor state.
the finger touch signal and water droplet spike signals by
                                                                                                 Figure 9. CSD UM Parameters
selecting the optimum reference voltage. This is especially
true if the water droplets cause negative peaks because at
this time, the CSD API resets the baseline to the minimum
value. The Figure 8 shows water droplets quot;signal-to-noise
ratioquot; for various reference voltages.
 Figure 8. Relation between Finger Touch Response and
  Water Droplets Noise for Different Reference Settings
          Water Droplet
    6
             “SNR”

    5


    4


    3


    2


    1
                                                                                   The firmware scans the touch sensors and the guard
                                                                                   sensor      with     different   scanning      parameters,
                                                                                   FingerThreshold and Reference values, because touch
    0
        0,10   0,15       0,20   0,25   0,30   0,35      0,40     0,45
                                                                                   sensors and guard sensors have different areas used for
                                                      Reference, x Vdd             different purposes. The guard sensor is located around the
                                                                                   touch sensors and the guard sensor area is distributed
                                                                                   over a larger board area. The guard sensor should have
As you can see from this figure, the maximum relation was                          better sensitivity and a lower FingerThreshold value than
received at reference voltage 0.30 Vdd. That corresponds                           the touch sensor.
to the Ref Value = 1 in the CSD UM parameters. This
                                                                                   A special algorithm is used to provide reliable finger touch
value will be different for different electrodes and overlay
                                                                                   detection and eliminate false touch detection. This
configurations, so your configurations may use different
                                                                                   algorithm uses special resettable counters for each touch
values. In another version of the sensor panel, the best
                                                                                   sensor and the guard sensor, implemented in firmware.
results were obtained at Ref Value = 2.
                                                                                   These counters provide a debounce function. The touch
The experimental results and simple model we used                                  sensor counter sets the minimum time interval during
clearly show that for reliable touch detection and                                 which the sensor must be touched in order to be detected
elimination of false detection caused by the water droplets                        by the decision logic. The touch counters allow you to
and streams, a combination of shield electrodes and a                              eliminate short signal spikes caused by water leaks and
guard sensor should be used. The shield electrode                                  remove false touch detection.
reduces the influence of water droplets at the physical
                                                                                   The guard sensor counter allows you to eliminate false
level and the guard sensor resets the decision logic
                                                                                   touch detection due to the remains of the water on the
operation at the logic level. The next section discusses the
                                                                                   board after a stream of water is applied. When a water
proposed high-level data processing scheme.
                                                                                   stream is applied to the board, the guard sensor detects
                                                                                   this event and disables the touch sensor processing logic.
                                                                                   Additional guard sensor quot;deadquot; time prevents unlocking
                                                                                   the sensor counters prematurely. When the water stream
                                                                                   is gone, the guard counter suppresses touch processing
                                                                                   for a short time. This eliminates false touch detection due
                                                                                   to water remaining on the board.




December 8, 2006                                                Document No. 001-14501 Rev. *A                                              6



                                                                                                                                                  [+] Feedback
AN2398



The algorithm is shown in Figure 10 as a simplified
equivalent electrical schematic so that its operation is
easier to understand.


                         Figure 10. Equivalent Simplified Schematic of the Post Processing Logic

                                          Counters Update Upon
                                            Scan Completion



                                                                         Guard Counter
    Sensors Array
                                                                               -1
                           Sg in     Sg out                                    Load
                                                                               En            0
                                                                                      Gcnt out
           S1              S1 in


                                                                                      Multiple Touch
                                                                                        Detection
           S2              S2 in                             S1
                                                             … Adder
                                                             Sn      >1




                                                                       Sensor 1 Counter
          SN-1             SN-1 in
                                                                               +1
                                                                      R1                         S1 cnt out
                                     S1 out                                    R         =Thl
                                                                               En        <Thl
          SN               SN in

                                                                                                              Sensors
                                                                                                               Status

                                                                       Sensor N Counter
                                                                                                 SN cnt out
                                     SN out

                             CSD API                                Post Processing Logic


Counters are updated after the completion of each                Reaching the counter maximum value signals sensor
scanning cycle. The guard counter is loaded with its             activation. Figure 11 shows the counter’s timing diagram.
threshold value when the guard sensor is triggered. The
counter is decremented until it reaches zero. The sensor
counters are enabled when the guard counter reaches
zero. When the sensor counter reaches the threshold
value it stops incrementing the count and holds the
maximum count value.



December 8, 2006                              Document No. 001-14501 Rev. *A                                            7



                                                                                                                             [+] Feedback
AN2398



Figure 11. Timing Diagram of Guard and Sensor Counters                    Design Recommendations
              Guard Сounter Operational Diagram                           This Application Note can be used as a design foundation
                                                                          for other waterproof CapSense projects. From our
 SG out                                                                   experimentation we developed several recommendations
                                                                          that you may find useful:
                                                                          •   Place the sensors vertically or at an angle to the
 SGcnt out                                                                    horizontal so that water drops naturally move off of
                                                                              the sensor plate and large water drops do not
                                                                              accumulate.
                                  tg del
                                                                          •   Use a water-repellent, non-absorbent material as the
                                                                              front panel insulator. This minimizes water streaks
                                                                              and films on the device panel. This is especially
              Sensor Counter Operational Diagram
                                                                              important if the water is highly conductive. Seawater,
                                                                              for example.
 S1 out
                                                                          •   The guard sensor is required in situations where the
                                                                              application may be subjected to continuous water
                                           ts del                             streams. It is not required if the device is subjected to
 S1 cnt out                                                                   rain only.
                                                                          •   The shield electrode between buttons should be at
 R                                                                            least 10 mm wide. This allows you to effectively
                                                                              suppress the influence of water drops.

                                                                          Summary
Sg out – The guard sensor detection signal.                               This Application Note demonstrates a waterproof
                                                                          capacitance sensing technique that can be used
SGcntout – The guard counter output signal: ‘1’ when water
                                                                          successfully when the target detection area operates with
is present, ‘0’ when water is not present.
                                                                          moisture, water films, drops, or even a continuous water
tg_del – The minimum time interval after the last water                   stream. The device continues to function in the presence
detection event before touch detection decision logic is                  of water drops and eliminates false triggering when a
enabled.                                                                  water stream is applied to the sensing zone.
S1out – The first sensor touch detection signal.                          The post-processing algorithm can be used in other
                                                                          applications where reliable touch detection is required, for
S1 cnt out – The first sensor counter output signal.
                                                                          example, in white goods where the system should not
ts del – The minimum time interval during which sensor                    generate false triggers during cleaning. The software
must be touched continuously in order to be detected as                   counter mechanism is effective for preventing
touched by the decision logic.                                            simultaneous touches of multiple sensors in conventional
                                                                          CapSense applications, for example, placing an arm or
There is an additional mechanism in the API that tracks
                                                                          palm on the sensing zone.
multiple sensor touches and resets all sensor counters
when more than one sensor is touched at one time. It
allows you to suppress false touch detection when a water
stream is applied or the customer places their palm on the
sensor zone. This mechanism is also useful when you
have several sensors located horizontally and it is possible
for a large water drop to cover several sensors at the
same time. In this case, touching one sensor may trigger
touch detection on all of the other sensors at the same
time. The multiple touch detection mechanism prevents
false detection in this situation.
A full listing of the post processing logic is available in
Appendix B.




December 8, 2006                                       Document No. 001-14501 Rev. *A                                                8



                                                                                                                                          [+] Feedback
AN2398




Appendix A. Photos of Tests
In Figure 12, photos of the different keyboard water tests
are shown.
Figure 12a) shows the dry keyboard test. A finger touch on
the middle sensor turns on the middle LED.
Figure 12b) shows water sprayed on the keyboard. As can
be seen in the photo, no LEDs turn on.
Figure 12c) shows a finger touching the middle sensor
when water droplets are present on the board. The middle
LED turns on. No false detection takes place.
Figure 12d) shows a water stream applied to the keyboard
and the guard sensor LED turns on. No other sensors can
turn on while the guard sensor is active.

   Figure 12. Test Photos a) Dry Board Test b) Spraying Water on Board; c) Touching Sensor when Water Droplets are on
                                      Board; d) Applying a Stream of Water to Board




                               a)                                                      b)




                               c)                                                      d)




December 8, 2006                               Document No. 001-14501 Rev. *A                                           9



                                                                                                                            [+] Feedback
AN2398




Appendix B. Post Processing Code
//----------------------------------------------------------------------------
// C main line
//----------------------------------------------------------------------------

#include <m8c.h>         // part-specific constants and macros
#include quot;PSoCAPI.hquot;     // PSoC API definitions for all User Modules

#define SENSOR_TOUCH_COUNT_TH 15
#define GUARD_TOUCH_COUNT_TH 10
#define GUARD_SENS_NUM 3

WORD   iI2CBuf[CSD_TotalSensorCount];
BYTE   touch_cnt_array[CSD_TotalSensorCount];
BYTE   touch_cnt = 0;
BYTE   guard_state = 0;
BYTE   i;

extern BYTE EzI2C_bRAM_RWcntr;

void main()
{


    M8C_EnableGInt;

    CSD_Start();
    CSD_SetDefaultFingerThresholds();
    CSD_baBtnFThreshold[GUARD_SENS_NUM] = 100;

   CSD_SetRefValue(0);
   CSD_InitializeBaselines();

    for (i = 0; i < CSD_TotalSensorCount; i++)
      touch_cnt_array[i] = 0;

    EzI2C_SetRamBuffer(2*CSD_TotalSensorCount, 0, (BYTE *)iI2CBuf );
    EzI2C_Start();

    while (1) {

       CSD_SetRefValue(1);
       CSD_ScanSensor(GUARD_SENS_NUM);

       CSD_SetRefValue(1);
       CSD_ScanSensor(0);
       CSD_ScanSensor(1);
       CSD_ScanSensor(2);

       CSD_UpdateAllBaselines();

       M8C_DisableGInt;
       if ((0 == EzI2C_bRAM_RWcntr) || (EzI2C_bRAM_RWcntr > (2*CSD_TotalSensorCount-1)))
         for (i = 0; i < CSD_TotalSensorCount; i++) iI2CBuf[i] = CSD_waSnsResult[i];
       M8C_EnableGInt;


       touch_cnt = 0;
       for (i = 0; i < CSD_TotalSensorCount; i++)
          if (GUARD_SENS_NUM != i)
          {
             if (0 != CSD_bIsSensorActive(i))
             {

December 8, 2006                     Document No. 001-14501 Rev. *A                           10



                                                                                                    [+] Feedback
AN2398



                       touch_cnt++;
                       if (touch_cnt_array[i] < SENSOR_TOUCH_COUNT_TH) touch_cnt_array[i]++;
                  }
                  else
                    touch_cnt_array[i] = 0;
             }

        if(0 != CSD_bIsSensorActive(GUARD_SENS_NUM))
           touch_cnt_array[GUARD_SENS_NUM] = GUARD_TOUCH_COUNT_TH;
        else
        {
          if (0 != touch_cnt_array[GUARD_SENS_NUM])
           touch_cnt_array[GUARD_SENS_NUM]--;
        }

        guard_state = (touch_cnt_array[GUARD_SENS_NUM] > 0);

        if ((0 != guard_state) || (touch_cnt > 1))
          for (i = 0; i < CSD_TotalSensorCount; i++)
            if (GUARD_SENS_NUM != i) touch_cnt_array[i] = 0;

         (0 != guard_state)?(PRT2DR |= 0x80):(PRT2DR &= ~0x80);
        (SENSOR_TOUCH_COUNT_TH == touch_cnt_array[0])?(PRT0DR |= 0x01):(PRT0DR &= ~0x01);
         (SENSOR_TOUCH_COUNT_TH == touch_cnt_array[1])?(PRT0DR |= 0x02):(PRT0DR &= ~0x02);
         (SENSOR_TOUCH_COUNT_TH == touch_cnt_array[2])?(PRT0DR |= 0x04):(PRT0DR &= ~0x04);

    }
}



In March of 2007, Cypress recataloged all of its Application Notes using a new documentation number and revision code. This new documentation
number and revision code (001-xxxxx, beginning with rev. **), located in the footer of the document, will be used in all subsequent revisions.
PSoC is a registered trademark of Cypress Semiconductor Corp. quot;Programmable System-on-Chip,quot; 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, 2006-2007. 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.


December 8, 2006                                           Document No. 001-14501 Rev. *A                                                              11



                                                                                                                                                               [+] Feedback

Weitere ähnliche Inhalte

Was ist angesagt?

dWatch: a Personal Wrist Watch for Smart Environments
dWatch: a Personal Wrist Watch for Smart EnvironmentsdWatch: a Personal Wrist Watch for Smart Environments
dWatch: a Personal Wrist Watch for Smart EnvironmentsLuigi De Russis
 
Design, simulation and implementation of an Arduino microcontroller based aut...
Design, simulation and implementation of an Arduino microcontroller based aut...Design, simulation and implementation of an Arduino microcontroller based aut...
Design, simulation and implementation of an Arduino microcontroller based aut...IJAAS Team
 
Touch screen-technology-1
Touch screen-technology-1Touch screen-technology-1
Touch screen-technology-1Azhar Ansari
 
Tg samsung 32_p2
Tg samsung 32_p2Tg samsung 32_p2
Tg samsung 32_p2Jerry Byrd
 
Javaringppt 130921072916-phpapp02
Javaringppt 130921072916-phpapp02Javaringppt 130921072916-phpapp02
Javaringppt 130921072916-phpapp02Yogesh Bhalla
 

Was ist angesagt? (6)

dWatch: a Personal Wrist Watch for Smart Environments
dWatch: a Personal Wrist Watch for Smart EnvironmentsdWatch: a Personal Wrist Watch for Smart Environments
dWatch: a Personal Wrist Watch for Smart Environments
 
LO(D)D ant2012
LO(D)D ant2012LO(D)D ant2012
LO(D)D ant2012
 
Design, simulation and implementation of an Arduino microcontroller based aut...
Design, simulation and implementation of an Arduino microcontroller based aut...Design, simulation and implementation of an Arduino microcontroller based aut...
Design, simulation and implementation of an Arduino microcontroller based aut...
 
Touch screen-technology-1
Touch screen-technology-1Touch screen-technology-1
Touch screen-technology-1
 
Tg samsung 32_p2
Tg samsung 32_p2Tg samsung 32_p2
Tg samsung 32_p2
 
Javaringppt 130921072916-phpapp02
Javaringppt 130921072916-phpapp02Javaringppt 130921072916-phpapp02
Javaringppt 130921072916-phpapp02
 

Ähnlich wie Capacitance Sensing - Waterproof Capacitance Sensing

3D Sensor Box Using Capacitive Sensing
3D Sensor Box Using Capacitive Sensing3D Sensor Box Using Capacitive Sensing
3D Sensor Box Using Capacitive SensingWilly Okpobua
 
Advanced Water Quality Monitoring Using Microcontroller
Advanced Water Quality Monitoring Using MicrocontrollerAdvanced Water Quality Monitoring Using Microcontroller
Advanced Water Quality Monitoring Using MicrocontrollerIRJET Journal
 
IRJET- Multi-Sensor based Water Quality Monitoring in IoT Environment
IRJET-  	  Multi-Sensor based Water Quality Monitoring in IoT EnvironmentIRJET-  	  Multi-Sensor based Water Quality Monitoring in IoT Environment
IRJET- Multi-Sensor based Water Quality Monitoring in IoT EnvironmentIRJET Journal
 
Design Development of Water Monitoring Systems by Using Arduino and Sensors
Design Development of Water Monitoring Systems by Using Arduino and SensorsDesign Development of Water Monitoring Systems by Using Arduino and Sensors
Design Development of Water Monitoring Systems by Using Arduino and SensorsSai Bhaskar Reddy Nakka
 
Smart Container
Smart ContainerSmart Container
Smart ContainerSupritha k
 
Intelligent Farmer Friendly System
Intelligent Farmer Friendly SystemIntelligent Farmer Friendly System
Intelligent Farmer Friendly SystemIJMTST Journal
 
capacitivetouchscreen-140326070939-phpapp02 (1).pptx
capacitivetouchscreen-140326070939-phpapp02 (1).pptxcapacitivetouchscreen-140326070939-phpapp02 (1).pptx
capacitivetouchscreen-140326070939-phpapp02 (1).pptxHarshitKoshta2
 
A Smart Handheld Measuring and Testing Electronic Device with Touch Screen
A Smart Handheld Measuring and Testing Electronic Device with Touch ScreenA Smart Handheld Measuring and Testing Electronic Device with Touch Screen
A Smart Handheld Measuring and Testing Electronic Device with Touch ScreenIJTET Journal
 
18UE1A0401 technical seminar.pptx
18UE1A0401 technical seminar.pptx18UE1A0401 technical seminar.pptx
18UE1A0401 technical seminar.pptxmalleshwariponnam
 
A review on Implementation Of Integrated System to Avoid Flood Like Situation
A review on  Implementation Of Integrated System to Avoid Flood Like SituationA review on  Implementation Of Integrated System to Avoid Flood Like Situation
A review on Implementation Of Integrated System to Avoid Flood Like SituationIRJET Journal
 
Wireless sensor network platform for monitoring the industrial apparatus
Wireless sensor network platform for monitoring the industrial apparatusWireless sensor network platform for monitoring the industrial apparatus
Wireless sensor network platform for monitoring the industrial apparatusijiert bestjournal
 
IRJET- Digital Dynamometer for Stationary Waves
IRJET-  	  Digital Dynamometer for Stationary WavesIRJET-  	  Digital Dynamometer for Stationary Waves
IRJET- Digital Dynamometer for Stationary WavesIRJET Journal
 
THE SMART BRIDGE ECE.pptx
THE SMART BRIDGE ECE.pptxTHE SMART BRIDGE ECE.pptx
THE SMART BRIDGE ECE.pptxAryanPandita10
 
Environmental Sensor Network Paper
Environmental Sensor Network PaperEnvironmental Sensor Network Paper
Environmental Sensor Network PaperZoey Y. Kang
 
IoT Based Water Level Meter for Alerting Population about Floods
IoT Based Water Level Meter for Alerting Population about FloodsIoT Based Water Level Meter for Alerting Population about Floods
IoT Based Water Level Meter for Alerting Population about Floodsijtsrd
 
Introduction to smart sensors & its’ application
Introduction to smart sensors & its’ applicationIntroduction to smart sensors & its’ application
Introduction to smart sensors & its’ applicationPranay Mondal
 
IRJET- Smart Real Time Manhole Monitoring System
IRJET- Smart Real Time Manhole Monitoring SystemIRJET- Smart Real Time Manhole Monitoring System
IRJET- Smart Real Time Manhole Monitoring SystemIRJET Journal
 

Ähnlich wie Capacitance Sensing - Waterproof Capacitance Sensing (20)

3D Sensor Box Using Capacitive Sensing
3D Sensor Box Using Capacitive Sensing3D Sensor Box Using Capacitive Sensing
3D Sensor Box Using Capacitive Sensing
 
Advanced Water Quality Monitoring Using Microcontroller
Advanced Water Quality Monitoring Using MicrocontrollerAdvanced Water Quality Monitoring Using Microcontroller
Advanced Water Quality Monitoring Using Microcontroller
 
IRJET- Multi-Sensor based Water Quality Monitoring in IoT Environment
IRJET-  	  Multi-Sensor based Water Quality Monitoring in IoT EnvironmentIRJET-  	  Multi-Sensor based Water Quality Monitoring in IoT Environment
IRJET- Multi-Sensor based Water Quality Monitoring in IoT Environment
 
Design Development of Water Monitoring Systems by Using Arduino and Sensors
Design Development of Water Monitoring Systems by Using Arduino and SensorsDesign Development of Water Monitoring Systems by Using Arduino and Sensors
Design Development of Water Monitoring Systems by Using Arduino and Sensors
 
Smart Container
Smart ContainerSmart Container
Smart Container
 
Intelligent Farmer Friendly System
Intelligent Farmer Friendly SystemIntelligent Farmer Friendly System
Intelligent Farmer Friendly System
 
International Journal of Engineering Inventions (IJEI)
International Journal of Engineering Inventions (IJEI)International Journal of Engineering Inventions (IJEI)
International Journal of Engineering Inventions (IJEI)
 
capacitivetouchscreen-140326070939-phpapp02 (1).pptx
capacitivetouchscreen-140326070939-phpapp02 (1).pptxcapacitivetouchscreen-140326070939-phpapp02 (1).pptx
capacitivetouchscreen-140326070939-phpapp02 (1).pptx
 
A Smart Handheld Measuring and Testing Electronic Device with Touch Screen
A Smart Handheld Measuring and Testing Electronic Device with Touch ScreenA Smart Handheld Measuring and Testing Electronic Device with Touch Screen
A Smart Handheld Measuring and Testing Electronic Device with Touch Screen
 
18UE1A0401 technical seminar.pptx
18UE1A0401 technical seminar.pptx18UE1A0401 technical seminar.pptx
18UE1A0401 technical seminar.pptx
 
A review on Implementation Of Integrated System to Avoid Flood Like Situation
A review on  Implementation Of Integrated System to Avoid Flood Like SituationA review on  Implementation Of Integrated System to Avoid Flood Like Situation
A review on Implementation Of Integrated System to Avoid Flood Like Situation
 
Wireless sensor network platform for monitoring the industrial apparatus
Wireless sensor network platform for monitoring the industrial apparatusWireless sensor network platform for monitoring the industrial apparatus
Wireless sensor network platform for monitoring the industrial apparatus
 
IRJET- Digital Dynamometer for Stationary Waves
IRJET-  	  Digital Dynamometer for Stationary WavesIRJET-  	  Digital Dynamometer for Stationary Waves
IRJET- Digital Dynamometer for Stationary Waves
 
THE SMART BRIDGE ECE.pptx
THE SMART BRIDGE ECE.pptxTHE SMART BRIDGE ECE.pptx
THE SMART BRIDGE ECE.pptx
 
DAM SHUTTER 2.pptx
DAM SHUTTER 2.pptxDAM SHUTTER 2.pptx
DAM SHUTTER 2.pptx
 
Environmental Sensor Network Paper
Environmental Sensor Network PaperEnvironmental Sensor Network Paper
Environmental Sensor Network Paper
 
IoT Based Water Level Meter for Alerting Population about Floods
IoT Based Water Level Meter for Alerting Population about FloodsIoT Based Water Level Meter for Alerting Population about Floods
IoT Based Water Level Meter for Alerting Population about Floods
 
Introduction to smart sensors & its’ application
Introduction to smart sensors & its’ applicationIntroduction to smart sensors & its’ application
Introduction to smart sensors & its’ application
 
Touch screen
Touch screen  Touch screen
Touch screen
 
IRJET- Smart Real Time Manhole Monitoring System
IRJET- Smart Real Time Manhole Monitoring SystemIRJET- Smart Real Time Manhole Monitoring System
IRJET- Smart Real Time Manhole Monitoring System
 

Kürzlich hochgeladen

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Kürzlich hochgeladen (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Capacitance Sensing - Waterproof Capacitance Sensing

  • 1. Capacitance Sensing - Waterproof Capacitance Sensing AN2398 Author: Victor Kremin and Ruslan Bachunskiy Associated Project: Yes Associated Part Family: CY8C21x34, CY8C24x94 GET FREE SAMPLES HERE Software Version: PSoC Designer™ v. 4.3 Associated Application Notes: AN2352 PSoC Application Notes Index Application Note Abstract Capacitance sensing systems can be used in applications that are exposed to rain or water. Such applications include automotive applications, outdoor equipment, ATMs, public access systems, portable devices such as cell phones, PDAs, and kitchen and bathroom applications. This Application Note discusses using capacitance sensing on systems that must continue operating under moisture, rain or water drops. The proposed technique prevents false touch detection even when the sense area is covered completely with water. Introduction Table 1. Keyboard Characteristics The capacitance sensing technique can be effectively used in applications where the touch sensing zone is exposed to Characteristic Value moisture, rain, or water drops. PSoC® CapSense allows Number of Keys 3 you to replace expensive mechanical switches, improve device reliability, and reduce total system cost. Size of Sensors 15 × 15 mm 2 There are numerous areas where waterproof capacitance Host Communications Interface I C (for debug purposes) sensing can be used. In vehicle applications, examples Insulation Overlay Thickness 1-5 mm (glass or plastic) include door opening devices, code entry systems, alarm Power Supply Voltage 5 ± 0.25V sensors, and capacitive parking proximity sensors. Waterproof capacitive sensors can be used in a wide variety of home applications including kitchen equipment, bathroom Experimental Arrangement light switches, automatic faucets, and dish and clothes A simple test setup was created to test water’s influence on washing machines. Water resistant capacitive touch screens capacitive sensing. The CYC821x34 PSoC family device can be used on ATMs, PDAs, cell phones, portable GPS was used for testing with the CSD (CapSense Sigma Delta) navigation systems, and other devices that are used User Module sensing method. The PSoC device was placed outdoors. on the sensing board. To display sensor status, several The project created to test the water resistant capacitive additional LEDs were located on a small supplemental sensing technique under simulated application uses three board and connected to the PSoC board. This board can be simple buttons on a keyboard. You can expand the project placed at different locations during tests to aid sensors’ to fit your specific application requirements. For example, status observations. you can increase the number of buttons, use different button To monitor the sensor, raw counts, and other data during dimensions and shape, and so on. The technical realtime tests, an I2C-USB bridge was used. The bridge GUI characteristics of the associated project are shown in PC tool monitors multiple traces at the same time, logs them Table 1. to a file, and calculates scale and offset factors on the collected data. For more details about using the I2C-USB bridge to debug CapSense applications, see AN2352, quot;I2C- USB Bridge Usage.quot; Figure 1 shows the experimental environment. December 8, 2006 Document No. 001-14501 Rev. *A 1 [+] Feedback
  • 2. AN2398 Figure 1. Experimental Environment The sensor board contains three touch sensors, a guard sensor located around the perimeter and two shield Sensor Board electrodes connected in parallel. The three touch sensors are surrounded by the internal ring of the shield electrode. The internal shield electrode protects the button sensors from detecting false touches caused by water drops. The guard sensor is located between the internal and external rings of the shield electrode and is LED Display Board used to detect the presence of a water stream. The external shield electrode ring protects the guard sensor from PSoC Board detecting false touches caused by water drops. The shielding electrode also reduces the influence of parasitic capacitance by lowering the sigma delta modulator input current. See the CSD User Module Data Sheet in PSoC I2C-USB Designer for more details about shield electrode operation. Bridge Water is applied to the sensor board from the insulation layer side. To prevent the sensing electrodes from coming PC into direct contact with water, they are coated with an insulating varnish. The connection wires have waterproof insulation as well. The metal zone of the sensor board is The sensors are located on a separate plate and are 95*45 mm. Each sensor is a 15 mm square. The guard connected to the PSoC CapSense board using thin pliable sensor is 2.5 mm wide. wires. The sensors are located separately from the CapSense PCB so that the sensor board can be easily Test Setup Schematic subjected to different conditions, for example, applying a stream of water to the sensor board. Figure 3 shows the test setup schematic. The LEDs with current limiting resistors are installed on a separate display The sensor board was created using a 2-mm thick single board. The standard CY3212 or CY3213 board can be used side foil FR4 material. An illustration of the sensor board is for experiments. The CY3213 board supports the CSD shown in Figure 2. method. The CY3212 can be modified to support the CSD Figure 2. Sensors Board Drawing method by installing a modulator feedback resistor. 2,52 December 8, 2006 Document No. 001-14501 Rev. *A 2 [+] Feedback
  • 3. AN2398 Figure 3. Test Setup Schematic R4 240 CMOD 5V C4 10nF R6 2.2k 32 31 30 29 28 27 26 25 Vdd Vss P0[3] P0[5] P0[7] P0[6] P0[4] P0[2] R1 240 R3 240 1 24 P0[1] P0[0] 2 23 P2[7] P2[6] 3 22 P2[5] P2[4] R2 240 4 U1 21 P2[3] P2[2] 5 CY 8C21434 20 P2[1] P2[0] D1 D2 6 19 D3 D4 P3[3] P3[2] 7 18 Sens2 Guard Sens1 Sens3 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 FB J1 5V 5V 1 2 3 I2CSDA 4 I2CSCL 5 + C3 C2 100nF 10uF IS S P /I2 C SENS3 SENS1 SENS2 SHIELD GUARD Sens1 Sens2 Sens3 Figure 4. I2C-USB GUI Variables Setting Example Water Influence Tests The following was used for all testing of the influence of water on the raw sensor counts. The sensor board was set vertically during all experiments. Photos of the tests are shown in Appendix A. Tap water was used to test the board. To simulate worst-case conditions, some kitchen salt was dissolved in the water, resulting in increased water conductivity. Additionally, the effect of setting different modulator The following tests were completed: reference values during the water droplets test was examined. These results are discussed ahead. Touching the dry sensor with a finger. The first test checks the keyboard operation when no Applying water droplets from a sprayer when the water is present on the board and a finger touches all of shield electrode was connected to ground. the sensors sequentially (as shown in Figure 5a). As you can see in the figure, the finger touches are easily Touching the sensor with a finger after a water stream detectable. was applied and water droplets were left on the The second test checks the sensor functions when water insulator. drops are present on the sensor, the shield electrode is enabled, and a finger touches all of the sensors Applying water droplets from a sprayer when the sequentially (as shown in Figure 5b). As can be seen from shield electrode was active. the figure, small signal spikes take place because the finger first touches the water droplet, then the board. Applying a continuous water stream to the board from These spikes are negligible in comparison to the signal a large cup. from the finger and do not create any problems with touch The results of these tests are shown in Figure 5. To make detection. The finger touch signals are easily detectable. the collected data easy to visually analyze, the raw count data from different sensors were biased using the Offset feature in the I2C-USB bridge GUI PC tool. The settings from the example are shown in Figure 4. December 8, 2006 Document No. 001-14501 Rev. *A 3 [+] Feedback
  • 4. AN2398 Figure 5. Water Influence Test Results Dry Sensors Finger Touch with no Water Water Droplets with Shield Electrode Enabled 2 400 1 800 Sensor 1 Sensor 1 2 300 Sensor 2 Sensor 2 1 700 2 200 Sensor 3 Sensor 3 1 600 2 100 Guard Guard 2 000 1 500 1 900 1 400 1 800 1 300 1 700 1 600 1 200 Raw Counts Raw Counts 1 500 1 100 1 400 1 300 1 000 1 200 900 1 100 800 1 000 900 700 800 600 700 500 600 500 400 400 300 300 200 200 100 100 350 400 450 500 550 600 650 700 750 800 850 900 0 20 40 60 80 100 120 140 160 180 200 220 240 260 Sample # Sample # a) d) Wet Sensors Finger Touch Response after Water Stream Applying to Sensors Panel, sample #1 Applying Water Stream 2 400 2 400 Sensor 1 Sensor 1 2 300 2 300 Sensor 2 Sensor 2 2 200 2 200 Sensor 3 Sensor 3 2 100 2 100 Guard Guard 2 000 2 000 1 900 1 900 1 800 1 800 1 700 1 700 1 600 1 600 1 500 1 500 Raw Counts Raw Counts 1 400 1 400 1 300 1 300 1 200 1 200 1 100 1 100 1 000 1 000 900 900 800 800 700 700 600 600 500 500 400 400 300 300 200 200 100 100 200 250 300 350 400 450 500 550 600 650 700 750 1 000 1 100 1 200 1 300 1 400 1 500 Sample # Sample # b) e) Water Stream Applying to Sensors Panel, sample #2 Water Droplets with Shield Electrode Disabled 2 400 3 100 Sensor 1 2 300 Sensor 1 3 050 Sensor 2 2 200 Sensor 2 Sensor 3 Sensor 3 2 100 3 000 Guard 2 000 2 950 1 900 2 900 1 800 2 850 1 700 Raw Counts Raw Counts 1 600 2 800 1 500 2 750 1 400 2 700 1 300 2 650 1 200 1 100 2 600 1 000 2 550 900 2 500 800 700 2 450 600 2 400 500 2 350 400 2 300 300 200 2 250 100 400 450 500 550 600 650 700 750 800 850 900 950 500 600 700 800 900 1 000 Sample # Sample # c) f) December 8, 2006 Document No. 001-14501 Rev. *A 4 [+] Feedback
  • 5. AN2398 The third test checks the sensor functions when water is When a finger touches the dry surface, the finger adds sprayed on the board and the shield electrode is disabled capacitance Cx to the sensing electrode (Figure 6a). When (as shown in Figure 5c). As you can see in the figure, the an isolated water drop is located between the sensing and water spray can produce signal spikes close to the signal shield electrodes (Figure 6b), the capacitive coupling from the finger; the finger touch signal is 400 counts above between the shield and sensing electrodes is increased baseline, while the water drop signal is 200 counts, about (via Cwd and Cws capacitances). half. It may cause false touch detection under some When a continuous water stream is applied to the sensing conditions. surface (Figure 6c), the large capacitance of the stream The fourth test checks the sensor functions when water is Cst is added. This capacitance may be several times larger sprayed on the board and the shield electrode is enabled than the shield electrode-to-water capacitance, Cwd. (Figure 5d). As can be seen from this figure, the spike Because of this, the effect of the shield electrode is levels are more than six times less than the finger signal completely masked and the sensor raw counts are the and can be easily distinguished. Therefore, the shield same as or even higher than a finger touch. In this electrode effectively protects the keyboard controller from situation the guard sensor can help. When it detects the false touch detection. stream it can block the other sensors from triggering. The next test checks the sensor functions when a water Several additional tests were done using different sigma stream is applied to the board and the shield electrode is delta reference voltages to determine what effect they had enabled (Figure 5e, and Figure 5f). As you can see from on the tests. Two of these results are shown in Figure 7. the figures, the water stream produces signal spikes on all The area where there is little change in the raw counts is sensors with the same magnitude as a finger touch. These when the sensor is dry. Then water is sprayed on the will produce false touch detection. The guard sensor, insulator. however, produces signals with even higher levels than Figure 7. Raw Counts Change when Water Droplets were the touch sensors, because the guard sensor has a larger Applied at Different Reference Settings sense area. So the guard sensor can be used to detect the presence of a water stream on the board and 140 Ref=0.25Vdd implement blocking decision logic when a water stream is Ref=0.4Vdd 120 detected. 100 There are some illustrations to show CapSense 80 configurations during water tests. See Figure 6. 60 40 Figure 6. Sensing On Dry Surface (a), with Water Droplets 20 on Surface (b) and when Water Stream is Applied to 0 Surface (c) -20 -40 -60 -80 0 200 400 600 800 Sample # As you can see in Figure 7, at a low reference voltage the spikes are mostly positive, the same direction as finger touches. When the reference voltage is increased, peaks are mostly lower than the quot;no waterquot; level because when the water droplet is located between the shield and sensing electrodes, the modulator current is reduced more than with a higher reference. The spike direction is the opposite of a finger touch signal change. The high-level API routines can utilize this characteristic and yield benefits from this by not resetting baseline levels when there are short durations of negative spikes. This functionality is not supported in the current version of the CSD User Module v. 1.0 but may be added in future versions. December 8, 2006 Document No. 001-14501 Rev. *A 5 [+] Feedback
  • 6. AN2398 When water droplets are applied to the insulator, the water Demonstration Firmware can create thin films over the insulation surface, increasing The firmware uses the CSD User Module. Some post sensing electrode capacitance. This is why at low processing has been added to handle the guard sensor modulator reference voltages the raw count changes are signal. The updated baseline algorithm has been left more positive, while at higher voltages they are more without changes. The selected CSD User Module negative. This is due to the increased effect of the shield parameters are shown in Figure 9. Note that the Sensors electrode. Autoreset parameter has been enabled to allow baseline The objective is to get the maximum difference between updates regardless of sensor state. the finger touch signal and water droplet spike signals by Figure 9. CSD UM Parameters selecting the optimum reference voltage. This is especially true if the water droplets cause negative peaks because at this time, the CSD API resets the baseline to the minimum value. The Figure 8 shows water droplets quot;signal-to-noise ratioquot; for various reference voltages. Figure 8. Relation between Finger Touch Response and Water Droplets Noise for Different Reference Settings Water Droplet 6 “SNR” 5 4 3 2 1 The firmware scans the touch sensors and the guard sensor with different scanning parameters, FingerThreshold and Reference values, because touch 0 0,10 0,15 0,20 0,25 0,30 0,35 0,40 0,45 sensors and guard sensors have different areas used for Reference, x Vdd different purposes. The guard sensor is located around the touch sensors and the guard sensor area is distributed over a larger board area. The guard sensor should have As you can see from this figure, the maximum relation was better sensitivity and a lower FingerThreshold value than received at reference voltage 0.30 Vdd. That corresponds the touch sensor. to the Ref Value = 1 in the CSD UM parameters. This A special algorithm is used to provide reliable finger touch value will be different for different electrodes and overlay detection and eliminate false touch detection. This configurations, so your configurations may use different algorithm uses special resettable counters for each touch values. In another version of the sensor panel, the best sensor and the guard sensor, implemented in firmware. results were obtained at Ref Value = 2. These counters provide a debounce function. The touch The experimental results and simple model we used sensor counter sets the minimum time interval during clearly show that for reliable touch detection and which the sensor must be touched in order to be detected elimination of false detection caused by the water droplets by the decision logic. The touch counters allow you to and streams, a combination of shield electrodes and a eliminate short signal spikes caused by water leaks and guard sensor should be used. The shield electrode remove false touch detection. reduces the influence of water droplets at the physical The guard sensor counter allows you to eliminate false level and the guard sensor resets the decision logic touch detection due to the remains of the water on the operation at the logic level. The next section discusses the board after a stream of water is applied. When a water proposed high-level data processing scheme. stream is applied to the board, the guard sensor detects this event and disables the touch sensor processing logic. Additional guard sensor quot;deadquot; time prevents unlocking the sensor counters prematurely. When the water stream is gone, the guard counter suppresses touch processing for a short time. This eliminates false touch detection due to water remaining on the board. December 8, 2006 Document No. 001-14501 Rev. *A 6 [+] Feedback
  • 7. AN2398 The algorithm is shown in Figure 10 as a simplified equivalent electrical schematic so that its operation is easier to understand. Figure 10. Equivalent Simplified Schematic of the Post Processing Logic Counters Update Upon Scan Completion Guard Counter Sensors Array -1 Sg in Sg out Load En 0 Gcnt out S1 S1 in Multiple Touch Detection S2 S2 in S1 … Adder Sn >1 Sensor 1 Counter SN-1 SN-1 in +1 R1 S1 cnt out S1 out R =Thl En <Thl SN SN in Sensors Status Sensor N Counter SN cnt out SN out CSD API Post Processing Logic Counters are updated after the completion of each Reaching the counter maximum value signals sensor scanning cycle. The guard counter is loaded with its activation. Figure 11 shows the counter’s timing diagram. threshold value when the guard sensor is triggered. The counter is decremented until it reaches zero. The sensor counters are enabled when the guard counter reaches zero. When the sensor counter reaches the threshold value it stops incrementing the count and holds the maximum count value. December 8, 2006 Document No. 001-14501 Rev. *A 7 [+] Feedback
  • 8. AN2398 Figure 11. Timing Diagram of Guard and Sensor Counters Design Recommendations Guard Сounter Operational Diagram This Application Note can be used as a design foundation for other waterproof CapSense projects. From our SG out experimentation we developed several recommendations that you may find useful: • Place the sensors vertically or at an angle to the SGcnt out horizontal so that water drops naturally move off of the sensor plate and large water drops do not accumulate. tg del • Use a water-repellent, non-absorbent material as the front panel insulator. This minimizes water streaks and films on the device panel. This is especially Sensor Counter Operational Diagram important if the water is highly conductive. Seawater, for example. S1 out • The guard sensor is required in situations where the application may be subjected to continuous water ts del streams. It is not required if the device is subjected to S1 cnt out rain only. • The shield electrode between buttons should be at R least 10 mm wide. This allows you to effectively suppress the influence of water drops. Summary Sg out – The guard sensor detection signal. This Application Note demonstrates a waterproof capacitance sensing technique that can be used SGcntout – The guard counter output signal: ‘1’ when water successfully when the target detection area operates with is present, ‘0’ when water is not present. moisture, water films, drops, or even a continuous water tg_del – The minimum time interval after the last water stream. The device continues to function in the presence detection event before touch detection decision logic is of water drops and eliminates false triggering when a enabled. water stream is applied to the sensing zone. S1out – The first sensor touch detection signal. The post-processing algorithm can be used in other applications where reliable touch detection is required, for S1 cnt out – The first sensor counter output signal. example, in white goods where the system should not ts del – The minimum time interval during which sensor generate false triggers during cleaning. The software must be touched continuously in order to be detected as counter mechanism is effective for preventing touched by the decision logic. simultaneous touches of multiple sensors in conventional CapSense applications, for example, placing an arm or There is an additional mechanism in the API that tracks palm on the sensing zone. multiple sensor touches and resets all sensor counters when more than one sensor is touched at one time. It allows you to suppress false touch detection when a water stream is applied or the customer places their palm on the sensor zone. This mechanism is also useful when you have several sensors located horizontally and it is possible for a large water drop to cover several sensors at the same time. In this case, touching one sensor may trigger touch detection on all of the other sensors at the same time. The multiple touch detection mechanism prevents false detection in this situation. A full listing of the post processing logic is available in Appendix B. December 8, 2006 Document No. 001-14501 Rev. *A 8 [+] Feedback
  • 9. AN2398 Appendix A. Photos of Tests In Figure 12, photos of the different keyboard water tests are shown. Figure 12a) shows the dry keyboard test. A finger touch on the middle sensor turns on the middle LED. Figure 12b) shows water sprayed on the keyboard. As can be seen in the photo, no LEDs turn on. Figure 12c) shows a finger touching the middle sensor when water droplets are present on the board. The middle LED turns on. No false detection takes place. Figure 12d) shows a water stream applied to the keyboard and the guard sensor LED turns on. No other sensors can turn on while the guard sensor is active. Figure 12. Test Photos a) Dry Board Test b) Spraying Water on Board; c) Touching Sensor when Water Droplets are on Board; d) Applying a Stream of Water to Board a) b) c) d) December 8, 2006 Document No. 001-14501 Rev. *A 9 [+] Feedback
  • 10. AN2398 Appendix B. Post Processing Code //---------------------------------------------------------------------------- // C main line //---------------------------------------------------------------------------- #include <m8c.h> // part-specific constants and macros #include quot;PSoCAPI.hquot; // PSoC API definitions for all User Modules #define SENSOR_TOUCH_COUNT_TH 15 #define GUARD_TOUCH_COUNT_TH 10 #define GUARD_SENS_NUM 3 WORD iI2CBuf[CSD_TotalSensorCount]; BYTE touch_cnt_array[CSD_TotalSensorCount]; BYTE touch_cnt = 0; BYTE guard_state = 0; BYTE i; extern BYTE EzI2C_bRAM_RWcntr; void main() { M8C_EnableGInt; CSD_Start(); CSD_SetDefaultFingerThresholds(); CSD_baBtnFThreshold[GUARD_SENS_NUM] = 100; CSD_SetRefValue(0); CSD_InitializeBaselines(); for (i = 0; i < CSD_TotalSensorCount; i++) touch_cnt_array[i] = 0; EzI2C_SetRamBuffer(2*CSD_TotalSensorCount, 0, (BYTE *)iI2CBuf ); EzI2C_Start(); while (1) { CSD_SetRefValue(1); CSD_ScanSensor(GUARD_SENS_NUM); CSD_SetRefValue(1); CSD_ScanSensor(0); CSD_ScanSensor(1); CSD_ScanSensor(2); CSD_UpdateAllBaselines(); M8C_DisableGInt; if ((0 == EzI2C_bRAM_RWcntr) || (EzI2C_bRAM_RWcntr > (2*CSD_TotalSensorCount-1))) for (i = 0; i < CSD_TotalSensorCount; i++) iI2CBuf[i] = CSD_waSnsResult[i]; M8C_EnableGInt; touch_cnt = 0; for (i = 0; i < CSD_TotalSensorCount; i++) if (GUARD_SENS_NUM != i) { if (0 != CSD_bIsSensorActive(i)) { December 8, 2006 Document No. 001-14501 Rev. *A 10 [+] Feedback
  • 11. AN2398 touch_cnt++; if (touch_cnt_array[i] < SENSOR_TOUCH_COUNT_TH) touch_cnt_array[i]++; } else touch_cnt_array[i] = 0; } if(0 != CSD_bIsSensorActive(GUARD_SENS_NUM)) touch_cnt_array[GUARD_SENS_NUM] = GUARD_TOUCH_COUNT_TH; else { if (0 != touch_cnt_array[GUARD_SENS_NUM]) touch_cnt_array[GUARD_SENS_NUM]--; } guard_state = (touch_cnt_array[GUARD_SENS_NUM] > 0); if ((0 != guard_state) || (touch_cnt > 1)) for (i = 0; i < CSD_TotalSensorCount; i++) if (GUARD_SENS_NUM != i) touch_cnt_array[i] = 0; (0 != guard_state)?(PRT2DR |= 0x80):(PRT2DR &= ~0x80); (SENSOR_TOUCH_COUNT_TH == touch_cnt_array[0])?(PRT0DR |= 0x01):(PRT0DR &= ~0x01); (SENSOR_TOUCH_COUNT_TH == touch_cnt_array[1])?(PRT0DR |= 0x02):(PRT0DR &= ~0x02); (SENSOR_TOUCH_COUNT_TH == touch_cnt_array[2])?(PRT0DR |= 0x04):(PRT0DR &= ~0x04); } } In March of 2007, Cypress recataloged all of its Application Notes using a new documentation number and revision code. This new documentation number and revision code (001-xxxxx, beginning with rev. **), located in the footer of the document, will be used in all subsequent revisions. PSoC is a registered trademark of Cypress Semiconductor Corp. quot;Programmable System-on-Chip,quot; 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, 2006-2007. 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. December 8, 2006 Document No. 001-14501 Rev. *A 11 [+] Feedback