Appendix
CY8CKIT-044 PSoC® 4 M-Series Pioneer Kit Guide, Doc. No. 001-96598 Rev. *C
27
Figure 4-6. Bring Hand Close to the Proximity Sensor
4. Bring the hand closer to the proximity sensor, as shown in
Figure 4-6.
You will see the green LED turn ON.
5. As you move your hand closer to the proximity sensor, the brightness of the LED increases. As you move your hand
away from the proximity sensor, the brightness of the LED decreases.
You will get a proximity range of approximately 6cm with the wire supplied with this kit. You can achieve higher
proximity range by using a larger wire loop.
Power consumed by PSoC 4200M for this project can be measured using an ammeter as described in the
Deep-Sleep
Blinky
project.
4.5 Proximity Gestures
4.5.1 Project Description
This project demonstrates the proximity gesture detection capability of the PSoC 4200M device using CapSense. The
PSoC 4 M-Series Pioneer Kit has two headers which are used to connect proximity wires. These wires are used as
proximity sensors to detect an approaching hand.
The firmware gangs both proximity sensors and scans them as a single proximity sensor every 200ms by default. If the
ganged proximity sensor detects the presence of an approaching hand then PSoC 4200M checks the magnitude of the
signal produced by the proximity sensor. If the proximity signal is less than the threshold value, the RGB LED on the kit is
maintained at a minimum brightness. If the proximity signal is greater than the threshold value, the brightness of the RGB
LED on the kit is varied according to the magnitude of the proximity signal. CapSense scanning interval is changed to to
20ms when the proximity is detected. The project has a proximity range of approximately 5cm.
If proximity is detected, the firmware checks for hand gestures. Two types of gestures are recognized by the firmware
– UP
gesture and DOWN gesture.
Figure 4-7
shows the UP and DOWN gestures. The color of the RGB LED is changed based
on the recognized gesture. The RGB LED turns off if proximity is not detected for more than 3 seconds. CapSense
scanning interval is changed to 200ms when the proximity is not detected.
Note:
The gesture is registered only when the hand moves completely from one end to the other over the proximity
sensors.
Note:
The time periods of 20ms and 200ms are dependent on the LFCLK accuracy. These time periods can be inaccurate
up to 60% when ILO is used as the clock source for LFCLK. Use the ILO Trim Component as demonstrated in the
Deep-
Sleep Blinky
project to achieve higher accuracy with ILO.
Green LED
fades
Green LED
brightens
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from