You are on page 1of 7

Application Note AN2362

Wireless Remote Control with Capacitive Sensing

Author: Oleksandr Karpin


Associated Project: Yes
Associated Part Family: CY8C21x34, PRoC® CYWUSB6953
Software Version: PSoC Designer 4.2 SP3
Associated Application Notes: None

Abstract
This Application Note describes the integration of the Cypress WirelessUSB™ and PSoC® CapSense
interface technologies into a wireless remote control with capacitive sensors. This implementation
demonstrates a WirelessUSB two-way simple protocol, a mixed-signal PSoC device, and implementation of
the capacitive switch design using the CSR user module in PSoC Designer™. The proposed device can be
used as a design starting point for the many popular wireless devices that markets demand today.

Introduction Figure 1. Block Diagram of Wireless Remote


A wireless remote control has the following Control with Capacitive Sensors
advantages over traditional infrared signal (IR)-
based remote controls:
WirelessUSB
o It does not require face-to-face device PSoC
TX device
directivity. Keypad
o It allows for control through a wall. Capacitive
o It can operate with many devices Control
simultaneously.
o It allows for the use of several wireless WirelessUSB
Action PSoC
devices in a shared room space. RX device

Capacitive sensors have advantages over A block diagram for this wireless remote control is
traditional mechanical switches, including greater shown in Figure 1. Technical specifications are
reliability and lower cost. Integration of the listed in Table 1.
Cypress WirelessUSB and PSoC CapSense
technologies into a wireless remote control with
capacitive sensors combines all these
advantages in a single device. The unique
architecture of the PSoC allows this device to be
built at a very affordable price with external
components kept to a minimum. The wireless
remote control with capacitive sensors can be
used as a remote control for various devices (TV
sets, air-conditioners and similar home
appliances), in distance-measuring equipment,
medical systems and related devices.

7/21/2006 Revision A -1-


AN2362

The remote device user interface (panel) is


Table 1. Specifications for Wireless Remote Control
with Capacitive Sensing accessed through an array of CapSense buttons
(BRight, BDown, BOK, BUp, BLeft), LEDs (D1-
Item Specification D5) and buzzer (Y1). When the user touches the
Power Supply Voltage 0.9…3.2V buttons on the remote device, the corresponding
(2 AA, AAA Batteries) LEDs light up on both the remote and receiver
Remote Device Power
devices (if the devices are connected). This
Consumption (Average Values) provides for remote control of wireless LEDs by
-Reconnect Mode 3 mA capacitive sensors. The buzzer Y1 allows one to
-Data Transfer (Connected) Mode
1
150-200 µA search the remote device by toggling the BFind
switch on the receiver. In this mode, the buzzer
Receiver Device Power 60 mA
on the remote device beeps and all the LEDs
Consumption (Continuous
operation)
light up. The proposed implementation is a
prototype, but can be used as a design starting
Wireless Protocol Two-Way
point for wireless devices required by today’s
WirelessUSB
market. It is also possible to add capacitive
Data Rate 64 kbps sliders, rotating wheels, and other options for a
Operation Range 10 meters or more feature-rich user interface.
more
To provide a processor power supply from a low
The proposed wireless remote control device with voltage level, the boost converter U2 is used. For
capacitive sensors is described in the following example, the low-cost XCY672S Torex series of
sections: DC/DC converters with output voltage equal to
3.06V can be used. The Torex DC/DC converters
Device Schematic are optimized to extend the battery life for
WirelessUSB Two-Way Protocol wireless peripherals that are designed with the
Appendix Cypress WirelessUSB radio SoC and
microcontrollers (see
http://www.torex.co.jp/english/).
Device Schematic
A complete schematic of the remote control This implementation can easily be adapted for
device is shown in Figure 4 (Appendix). the CYWUSB6953 WirelessUSB PRoC
(Programmable Radio System-on-Chip). For
Using PSoC Designer’s CSR User Module, the more information about the WirelessUSB Flash
PSoC device U1 detects the presence of a finger Programmable MCU + Radio see “Wireless
through glass, plastic, acrylic or many other non- Products” on the Cypress web site.
metallic materials on a simple PCB trace through
a CapSense button. The PSoC SPIM User The schematic of the receiver is shown in Figure
Module permits communication by means of the 5 (Appendix). The schematic is similar to the
WirelessUSB radio transceiver, CYWUSB6934. schematic for the remote control device in
The firmware modules for working with this radio Figure 4, described earlier in this Application
transceiver were taken from the WirelessUSB LS Note.

development kit, CY4632 “WirelessUSB LS
Keyboard-Mouse Reference Design Kit with

KISSBind .” The PSoC device also implements a
two-way communication protocol and other task-
oriented control functions. For more information
about the PSoC application, see the associated
project files.

The WirelessUSB radio transceiver,


CYWUSB6934, must be connected to the
connector J1. The connector J2 provides the in-
circuit PSoC programming firmware.

1
The proposed implementation in this Application Note is not
optimized for minimal power consumption. It is possible to
significantly decrease current consumption by increasing the
time interval between transferred packets.

7/21/2006 Revision A -2-


AN2362

WirelessUSB Two-Way Protocol Wireless communication between devices


A WirelessUSB two-way communication protocol requires the use of the same frequency,
is shown in Figure 2. For more information about PN code, and code seed. Therefore, at the start
WirelessUSB communication protocols, see of communication, an automatic channel-
CY4632 “WirelessUSB LS™ Keyboard-Mouse selection procedure is performed. The remote
Reference Design Kit with KISSBind™” on the device selects the first available channel, sets the
Cypress web site. Note that existing two-way default code seed and PN code, repeats
WirelessUSB communication protocols are transmission of the connect-request data
designed only for stationary receivers. The packets, and listens for the connect-response
receiver in this application is stationary and its packets. If the response time-out has expired and
power consumption is not minimized. Only the a response is not received, then the remote
remote control is designed to be a portable device goes to the Start state, selects the next
device with low power consumption. available channel, and again attempts a
connection. The remote device also sets the
By adding time synchronization between the default code seed and PN code. With these
remote control and the receiver–which allows values, the remote control successively listens to
them to remain in sleep mode most of the time– all channels for the connect-request packet.
both devices are portable. A user can easily add When the remote device receives the connect-
this time-synchronization feature. request packet, it immediately sends a response.

Figure 2. WirelessUSB 2-Way Communication Protocol

Remote Device Receiver Device

Start Start

Set Default Channel


Go To Next
PN Code, SEED
Channel

no
Go To Next
Channel
Channel
Available?

yes
Listen for Connect
Set TX_SEED Request Listen Time-out
Random

Set Default
PN Code, SEED

Connect Request
Connect Request
Connect Response Listen Time-out
Connect Response Time-out

Set TX_SEED
Set TX_SEED
Ping Request
Ping Response
Ping Request Time-out
Ping Response Time-out

Data
Data Response
Data Response Time-out
Data Receive Time-out

After the remote device sends the connect- After a correct pinging response, the devices go
response packet and the receiving device into the Data Transmission state. In every state,
receives this packet, the two devices set the new both devices control the operation of the Time-
selected code seed value TX_SEED and try to out Expired event. When the Time-out Expired
ping the channel for verification. This random event appears, the devices go to the Start state
unique code seed value protects the data from and begin all over again. This is the main rule of
being interpreted by similar devices as their own. the communication protocols.

7/21/2006 Revision A -3-


AN2362

To simplify the protocol, the PN code in this To verify connection between devices and
application is constant. provide for data transfer from the receiver to the
remote device, a data packet is sent at least
Remote device power consumption is minimized every second. This is how the Find Remote
by using sleep mode between data transfers. Device signal is sent from the receiver.
Increasing sleep time (or time between packet
transfers) decreases power consumption.
However, in sleep mode the capacitive sensor Conclusion
interface is not active. This decreases the This Application Note describes the Cypress
responsiveness of the device. An adaptive sleep WirelessUSB and PSoC CapSense interface
mode addresses this problem. Every 125 milli- technologies. A wireless remote control with
seconds (ms) the microcontroller wakes up and capacitive sensors is proposed. A PSoC project
checks the button state. The device only wakes and implementation of the capacitive switch
the radio module and sends a data packet if the design using the CSR User Module in PSoC
button state has changed. Otherwise, the high- Designer have been developed. A simple two-
power-consuming radio module stays in sleep way WirelessUSB protocol has been designed.
mode and the PSoC also returns to sleep mode. The proposed implementation can be used as a
design starting point for a wide variety of popular
wireless applications.

Figure 3. Wireless Remote Control Device with Capacitive Sensors (Actual Size)

7/21/2006 Revision A -4-


AN2362

Appendix: Schematics
Figure 4. Schematic of the Remote Device

VDD
BRight
VDD C2 0.1u
U1
28 BDown
R1 D1 Vdd
nL_R 1 27
820 2 P0[7] P0[6] 26 BOK
nPD_W P0[5] P0[4]
IRQ_W 3 25
4 P0[3] P0[2] 24
nRESET_W P0[1] P0[0] BUp

nSS_W 5 23
R2 D2 6 P2[7] P2[6] 22
MOSI_W P2[5] P2[4] BLef t
nL_D 7 21
820 8 P2[3] P2[2] 20
R3 D3 P2[1] P2[0] Y1 Buzzer
9 19 XRES
820 Vss Xres
R4 D4 nL_OK 10 18
P1[7] P1[6] SCK_W
nL_U 11 17
820 nL_L 12 P1[5] P1[4] 16
P1[3] P1[2] MISO_W
R5 D5 SCL 13 15 SDA
P1[1] P1[0]
820 14 J1
Vss 1
CY 8C21534 SCK_W 2
VDD MISO_W 3
J2 MOSI_W 4
1 nSS_W 5
2 nRESET_W 6
XRES 3 7
SCL 4 IRQ_W 8
SDA 5 9
10
ISR VDD 11
nPD_W 12
13
14
VDD
L1 100uH WirelessUSB Module
D6 MA2Q735 CYWUSB6934
BAT+

U3
+ C1 3 4 + C3
LX VOUT
VSS

220u 47u

XCY672S011PR
1

BAT-

7/21/2006 Revision A -5-


AN2362

Figure 5. Schematic of the Receiver Device (Powered from Battery)

VDD

VDD C2 0.1u
U1
28
R1 D1 Vdd
nL_R 1 27
820 2 P0[7] P0[6] 26
nPD_W P0[5] P0[4]
IRQ_W 3 25 BFind
4 P0[3] P0[2] 24
nRESET_W P0[1] P0[0]

nSS_W 5 23
R2 D2 6 P2[7] P2[6] 22
MOSI_W P2[5] P2[4]
nL_D 7 21
820 8 P2[3] P2[2] 20
R3 D3 P2[1] P2[0]
9 19 XRES
820 Vss Xres
R4 D4 nL_OK 10 18
P1[7] P1[6] SCK_W
nL_U 11 17
820 nL_L 12 P1[5] P1[4] 16
P1[3] P1[2] MISO_W
R5 D5 SCL 13 15 SDA
P1[1] P1[0]
820 14
Vss
CY 8C21534
VDD J1
J2 1
1 SCK_W 2
2 MISO_W 3
XRES 3 MOSI_W 4
SCL 4 nSS_W 5
SDA 5 nRESET_W 6
7
ISR IRQ_W 8
9
10
VDD 11
nPD_W 12
13
14

WirelessUSB Module
CYWUSB6934

VDD
L1 100uH
D6 MA2Q735
BAT+

U3
+ C1 3 4 + C3
LX VOUT
VSS

220u 47u

XCY 672S011PR
1

BAT-

7/21/2006 Revision A -6-


AN2362

About the Author

Name: Oleksandr Karpin


Title: Post-Graduate Student
Background: Oleksandr received a computer-
engineering degree in 2001
from National University
"Lvivska Polytechnika"
(Ukraine), and continues his
study there as a post-graduate
student. His interests include
embedded systems design and
new technologies.
Contact: karpinoo@ukr.net

Cypress Semiconductor
2700 162nd Street SW, Building D
Lynnwood, WA 98087
Phone: 800.669.0557
Fax: 425.787.4641
http://www.cypress.com/
Copyright © 2006 Cypress Semiconductor Corporation. All rights reserved.
PSoC is a registered trademark of Cypress Semiconductor Corp.
"Programmable System-on-Chip," PSoC Designer and PSoC Express are trademarks of Cypress Semiconductor Corp.
All other trademarks or registered trademarks referenced herein are the property of their respective owners.
The information contained herein is subject to change without notice. Made in the U.S.A.

7/21/2006 Revision A -7-

You might also like