CY8CKIT-046 PSoC® 4 L-Series Pioneer Kit Guide, Doc. #: 002-03344 Rev. *D
33
Code Examples
4.3
CapSense Proximity
4.3.1
Project Description
This code example demonstrates the proximity sensing capability of the PSoC 4200L device. The
CapSense scans for an approaching hand every 100 ms and enters a low-power mode when prox-
imity is not detected. This allows the PSoC 4200L to operate at lower average power levels. The
scanning interval is decreased such that the CapSense scan is performed every 30 ms when prox-
imity is detected.
The PSoC 4200L gradually increases the brightness of the blue LED as a hand approaches the
proximity sensor. If proximity is not detected for a period more than 3s, the PSoC 4200L increases
the CapSense scanning interval back to 100 ms.
This example supports the CapSense tuner. For more details see
.
Note:
PSoC 4200L supports dual-channel CapSense and the proximity pins (P9[4] and P9[5]) are
present on the second CapSense channel (CSD1). CMOD and CTANK (if used) pins should be
selected appropriately. See
A.2.1.13 CapSense Circuit on page 65
CTANK pin connections for both the CapSense blocks.
Note:
The time of 30 ms and 100 ms are dependent on LFCLK accuracy. This example uses the
32.768-kHz WCO in the kit as the LFCLK source. This offers a 250 ppm accuracy on the time. If the
WCO is not used or available, the ILO can be used to source LFCLK. In the case of the ILO, the
accuracy of the time can vary as much as 60 percent. Use the ILO trim method described in the
example
to improve the ILO accuracy to 10 percent.
4.3.2
Hardware Connections
Connect a five-inch wire (the green wire provided with the kit) to proximity header J21 on the PSoC 4
L-Series Pioneer Kit, as shown in
Figure 4-11. Proximity Sensor Connection on PSoC 4 L-Series Pioneer Kit
4.3.3
Verify Output
To verify the CapSense Proximity code example, follow these steps:
1. Connect the PSoC 4 L-Series Pioneer Kit to the PC through USB connector J10.
2. Program the PSoC 4 L-Series Pioneer Kit with the
CY8CKIT_046_CapSense_Proximity
code
example.