Upload
tuandt21415
View
216
Download
0
Embed Size (px)
Citation preview
8/14/2019 An 2362
1/7
Application Note AN2362
Wireless Remote Control with Capacitive Sensing
Author: Oleksandr KarpinAssociated Project: Yes
Associated Part Family: CY8C21x34, PRoC
CYWUSB6953Software Version: PSoC Designer4.2 SP3
Associated Application Notes: None
AbstractThis Application Note describes the integration of the Cypress WirelessUSB and PSoC CapSenseinterface technologies into a wireless remote control with capacitive sensors. This implementationdemonstrates a WirelessUSB two-way simple protocol, a mixed-signal PSoC device, and implementation ofthe capacitive switch design using the CSR user module in PSoC Designer. The proposed device can beused as a design starting point for the many popular wireless devices that markets demand today.
IntroductionA wireless remote control has the followingadvantages over traditional infrared signal (IR)-based remote controls:
o It does not require face-to-face devicedirectivity.
o It allows for control through a wall.o It can operate with many devices
simultaneously.o It allows for the use of several wireless
devices in a shared room space.
Capacitive sensors have advantages overtraditional mechanical switches, including greaterreliability and lower cost. Integration of theCypress WirelessUSB and PSoC CapSensetechnologies into a wireless remote control withcapacitive sensors combines all theseadvantages in a single device. The unique
architecture of the PSoC allows this device to bebuilt at a very affordable price with externalcomponents kept to a minimum. The wirelessremote control with capacitive sensors can beused as a remote control for various devices (TVsets, air-conditioners and similar homeappliances), in distance-measuring equipment,medical systems and related devices.
Figure 1. Block Diagram of Wireless RemoteControl with Capacitive Sensors
Keypad
Capacitive
Control
WirelessUSB
TX devicePSoC
WirelessUSB
RX devicePSoCAction
A block diagram for this wireless remote control isshown in Figure 1. Technical specifications arelisted in Table 1.
7/21/2006 Revision A - 1 -
8/14/2019 An 2362
2/7
AN2362
Table 1. Specifications for Wireless Remote Controlwith Capacitive Sensing
Item Specification
Power Supply Voltage
(2 AA, AAA Batteries)
0.93.2V
Remote Device Power
Consumption (Average Values)
-Reconnect Mode
-Data Transfer (Connected) Mode1
3 mA
150-200 A
Receiver Device Power
Consumption (Continuous
operation)
60 mA
Wireless Protocol Two-Way
WirelessUSB
Data Rate 64 kbps
Operation Range 10 meters or
more
The proposed wireless remote control device withcapacitive sensors is described in the followingsections:
DeviceSchematicWirelessUSB Two-Way ProtocolAppendix
Device SchematicA complete schematic of the remote controldevice is shown in Figure 4 (Appendix).
Using PSoC Designers CSR User Module, thePSoC device U1 detects the presence of a fingerthrough glass, plastic, acrylic or many other non-metallic materials on a simple PCB trace througha CapSense button. The PSoC SPIM UserModule permits communication by means of theWirelessUSB radio transceiver, CYWUSB6934.The firmware modules for working with this radiotransceiver were taken from the WirelessUSB LSdevelopment kit, CY4632 WirelessUSB LS
Keyboard-Mouse Reference Design Kit withKISSBind
. The PSoC device also implements a
two-way communication protocol and other task-oriented control functions. For more informationabout the PSoC application, see the associatedproject files.
The WirelessUSB radio transceiver,CYWUSB6934, must be connected to theconnector J1. The connector J2 provides the in-circuit PSoC programming firmware.
1The proposed implementation in this Application Note is not
optimized for minimal power consumption. It is possible tosignificantly decrease current consumption by increasing thetime interval between transferred packets.
The remote device user interface (panel) isaccessed through an array of CapSense buttons(BRight, BDown, BOK, BUp, BLeft), LEDs (D1-D5) and buzzer (Y1). When the user touches thebuttons on the remote device, the correspondingLEDs light up on both the remote and receiver
devices (if the devices are connected). Thisprovides for remote control of wireless LEDs bycapacitive sensors. The buzzer Y1 allows one tosearch the remote device by toggling the BFindswitch on the receiver. In this mode, the buzzeron the remote device beeps and all the LEDslight up. The proposed implementation is aprototype, but can be used as a design startingpoint for wireless devices required by todaysmarket. It is also possible to add capacitivesliders, rotating wheels, and other options for amore feature-rich user interface.
To provide a processor power supply from a lowvoltage level, the boost converter U2 is used. Forexample, the low-cost XCY672S Torex series ofDC/DC converters with output voltage equal to3.06V can be used. The Torex DC/DC convertersare optimized to extend the battery life forwireless peripherals that are designed with theCypress WirelessUSB radio SoC andmicrocontrollers (seehttp://www.torex.co.jp/english/).
This implementation can easily be adapted forthe CYWUSB6953 WirelessUSB PRoC(Programmable Radio System-on-Chip). Formore information about the WirelessUSB FlashProgrammable MCU + Radio see Wireless
Products on the Cypress web site.
The schematic of the receiver is shown in Figure5 (Appendix). The schematic is similar to theschematic for the remote control device inFigure 4, described earlier in this ApplicationNote.
7/21/2006 Revision A - 2 -
http://www.torex.co.jp/english/http://www.torex.co.jp/english/8/14/2019 An 2362
3/7
AN2362
WirelessUSB Two-Way ProtocolA WirelessUSB two-way communication protocolis shown in Figure 2. For more information aboutWirelessUSB communication protocols, seeCY4632 WirelessUSB LS Keyboard-MouseReference Design Kit with KISSBind on theCypress web site. Note that existing two-wayWirelessUSB communication protocols aredesigned only for stationary receivers. Thereceiver in this application is stationary and itspower consumption is not minimized. Only theremote control is designed to be a portabledevice with low power consumption.
By adding time synchronization between theremote control and the receiverwhich allowsthem to remain in sleep mode most of the timeboth devices are portable. A user can easily addthis time-synchronization feature.
Wireless communication between devicesrequires the use of the same frequency,PN code, and code seed. Therefore, at the startof communication, an automatic channel-selection procedure is performed. The remotedevice selects the first available channel, sets the
default code seed and PN code, repeatstransmission of the connect-request datapackets, and listens for the connect-responsepackets. If the response time-out has expired anda response is not received, then the remotedevice goes to the Start state, selects the nextavailable channel, and again attempts aconnection. The remote device also sets thedefault code seed and PN code. With thesevalues, the remote control successively listens toall channels for the connect-request packet.When the remote device receives the connect-request packet, it immediately sends a response.
Figure 2. WirelessUSB 2-Way Communication Protocol
ChannelAvailable?
Go To NextChannel
Set TX_SEEDRandom
no
Connect Request
Remote Device Receiver Device
Listen Time-out
Set TX_SEED
Connect Response
Set TX_SEED
Connect Response Time-out
Ping Request
Connect Request
Ping Response
Ping Response Time-out
Data
Data Response
Data Response Time-out
Listen Time-out
Ping Request Time-out
Data Receive Time-out
Listen for Connect
Request
Go To Next
Channel
yes
Start Start
Set Default Channel
PN Code, SEED
Set Default
PN Code, SEED
After the remote device sends the connect-response packet and the receiving devicereceives this packet, the two devices set the newselected code seed value TX_SEED and try toping the channel for verification. This randomunique code seed value protects the data frombeing interpreted by similar devices as their own.
After a correct pinging response, the devices gointo the Data Transmissionstate. In every state,both devices control the operation of the Time-out Expired event. When the Time-out Expiredevent appears, the devices go to the Startstateand begin all over again. This is the main rule ofthe communication protocols.
7/21/2006 Revision A - 3 -
8/14/2019 An 2362
4/7
AN2362
To simplify the protocol, the PN code in thisapplication is constant.
Remote device power consumption is minimizedby using sleep mode between data transfers.Increasing sleep time (or time between packet
transfers) decreases power consumption.However, in sleep mode the capacitive sensorinterface is not active. This decreases theresponsiveness of the device. An adaptive sleepmode addresses this problem. Every 125 milli-seconds (ms) the microcontroller wakes up andchecks the button state. The device only wakesthe radio module and sends a data packet if thebutton state has changed. Otherwise, the high-power-consuming radio module stays in sleepmode and the PSoC also returns to sleep mode.
To verify connection between devices andprovide for data transfer from the receiver to theremote device, a data packet is sent at leastevery second. This is how the Find RemoteDevicesignal is sent from the receiver.
ConclusionThis Application Note describes the CypressWirelessUSB and PSoC CapSense interfacetechnologies. A wireless remote control withcapacitive sensors is proposed. A PSoC projectand implementation of the capacitive switchdesign using the CSR User Module in PSoCDesigner have been developed. A simple two-way WirelessUSB protocol has been designed.The proposed implementation can be used as adesign starting point for a wide variety of popularwireless applications.
Figure 3. Wireless Remote Control Device with Capacitive Sensors (Actual Size)
7/21/2006 Revision A - 4 -
8/14/2019 An 2362
5/7
AN2362
Appendix: SchematicsFigure 4. Schematic of the Remote Device
P0[7]1
P0[5]2
P0[3]3
P0[1]4
P2[7]5
P2[5]6
P2[3]7
P2[1]8
Vss9
P1[7]10
P1[5]11
P1[3]12
P1[1]13
Vss14
P1[0]15P1[2]16P1[4]17P1[6]18
Xres19
P2[0]20P2[2]21P2[4]22P2[6]23
P0[0]24P0[2]25P0[4]26P0[6]27
Vdd28
U1
CY8C21534
VDD
123456789
1011121314
J1
WirelessUSB Module
12345
J2
ISR
nPD_WIRQ_W
nRESET_W
nSS_WMOSI_W
XRES
SCK_W
MISO_WSDA
Y1
LX3
VSS
1
VOUT 4
U3
XCY672S011PR
Buzzer
D6 MA2Q735L1 100uH
VDD
IRQ_W
nPD_W
MOSI_WnSS_W
nRESET_W
SCK_WMISO_W
CYWUSB6934
VDD
VDD
XRES
SDASCL
D1R1
820
nL_R
+
C3
47u
D2R2
820nL_D
R3
820
D3
D4R4
820nL_U
D5R5
820
SCL
nL_OK
nL_L
BAT+
BAT-
+
C1
220u
BRight
BDown
BOK
BUp
BLeft
VDD
C2 0.1u
7/21/2006 Revision A - 5 -
8/14/2019 An 2362
6/7
AN2362
Figure 5. Schematic of the Receiver Device (Powered from Battery)
P0[7]1
P0[5]2
P0[3]3
P0[1]4
P2[7]5
P2[5]6
P2[3]7
P2[1]8
Vss9
P1[7]10
P1[5]11
P1[3]12
P1[1]13
Vss14
P1[0]15P1[2]16P1[4]17P1[6]18
Xres19
P2[0]20P2[2]21P2[4]22P2[6]23
P0[0]24P0[2]25P0[4]26P0[6]27
Vdd
28
U1
CY8C21534
VDD
123456789
1011121314
J1
WirelessUSB Module
12345
J2
ISR
IRQ_WnPD_W
nSS_W
nRESET_W
MOSI_W
XRES
MISO_W
SCK_W
SDA
LX3
VSS
1
VOUT4
U3
XCY672S011PR
D6 MA2Q735L1 100uH
VDD
nPD_W
nSS_WnRESET_W
IRQ_W
SCK_W
MOSI_W
VDD
MISO_W
VDD
SCLSDA
XRES
R1
820
D1nL_R
+ C3
47u
D2nL_D
R2
820R3
820
D3
D4nL_U
R4
820D5R5
820
SCL
nL_OK
nL_L
BAT+
BAT-
+C1
220u
BFind
VDD
C2 0.1u
CYWUSB6934
7/21/2006 Revision A - 6 -
8/14/2019 An 2362
7/7
AN2362
About the Author
Name: Oleksandr KarpinTitle: Post-Graduate Student
Background: Oleksandr received a computer-
engineering degree in 2001from National University"Lvivska Polytechnika"(Ukraine), and continues hisstudy there as a post-graduatestudent. His interests includeembedded systems design andnew technologies.
Contact: [email protected]
Cypress Semiconductor2700 162nd Street SW, Building D
Lynnwood, WA 98087Phone: 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 -
mailto:[email protected]://www.cypress.com/http://www.cypress.com/mailto:[email protected]