ZigBee เบื้องต้น

Preview:

DESCRIPTION

เป็นเอกสารที่ผมเขียนประกอบบรรยาย + workshop เล็ก ๆ (ประมาณสองชั่วโมงครึ่ง, พ.ศ. 2551) เพื่อแนะนำ ZigBee ในส่วนของ workshop แบ่งเป็น 3 กิจกรรม 1. โค้ดสำหรับ coordinator เพื่อสร้าง network 2. โค้ดสำหรับ RFD เพื่อ join เข้า network ที่สร้างตามข้อ 1. และ 3. ดัดแปลงโค้ด (1-2 บรรทัด) เพื่อส่งข้อความระหว่าง coordinator กับ end device

Citation preview

EST LaboratoryEST Laboratory

CEDKCEDK--8, 8, --WPWPZigBeeZigBee Wireless Communication ProtocolWireless Communication Protocol

Essential Facts and Features

ZigBeeZigBee เปน protocol ในกลุม 802

ขอดีขอดี1. low cost2. ultra-low power consumption3. use of unlicensed radio bands4. cheap and easy installation5. flexible and extendable networks6. integrated intelligence for network set-up and message routing

Typical Application AreasTypical Application Areas1. low data rates (ไมเกิน 250 kbps)2. nodes which are idle (ไมมกีารรับ/ การสง) for long periods3. node locations where cables would be difficult or expensive to install4. a need to modify the network (add, remove or move nodes) while in service

เปรียบเทียบ ZigBeeZigBee กับ BluetoothBluetooth1. Power consumption

ZBZB 10 mA BTBT 100 mA2. Production costs (2005)

ZBZB 1.1 USD BTBT 3 USD3. Development costs

Codesize ZB/ Codesize BT = 1/24. Bit-error-rate (BER)

ตัวอยางสมาชิกพันธมิตร ZigBeeZigBee

ZigBeeZigBee BluetoothBluetoothSmaller packets over large network Larger packets over small networkData rate 250 kpbs @ 2.4 GHz Data rate is 1 Mbps @ 2.4 GHz65536 nodes (in a mesh) 7 nodes (in a star)Simplified protocol stack More complex protocol stack

Radio CommunicationRadio CommunicationZB ใชความถี่ยาน unlicensed มี 3 ยาน ซึ่งมี centered frequency ที่ 868, 915 และ 2400 MHz มีทัง้หมด 27 ชอง (หมายเลข 0 ถึง 26) ม ีdatarate 3 คาคือ 20, 40 และ 250kbps ตามลําดับ

Range of TransmissionRange of Transmissionในพื้นทีโ่ลงระยะสื่อสารประมาณ 200 เมตร สําหรับในอาคาร มีระยะสื่อสารประมาณ 30 เมตร สามารถเพิ่มระยะสื่อสารไดโดยการเพิ่ม intermediate node หรือ router

Low Power ConsumptionLow Power Consumptionตัว node ออกแบบมาสําหรับใหเปน autonomous, low-power device

Node TypesNode Types

Co-ordinatorใน 1 network มไีดเพียง 1 ตัว มีหนาที่1. เลือกชองความถี่ทีจ่ะสรางเน็ตเวิรก2. เริ่มเน็ตเวิรก3. อนุญาตให node อื่น ๆ เขารวมเน็ตเวิรก

End Device

Router1. สงขอความตอไปยัง node อื่น2. อนุญาตใหมี node ลูก

End device สามารถหลับได แต Co-ordinator กับ Router หลับไมได!

BindingBinding

ReliabilityReliability1. Listen before Send (CSMA-CA)

2. Acknowledgement3. Alternative Routes

SecuritySecurity1. AES (Advanced Encryption Standard) based Encryption2. Message Timeout3. Access Control lists

Basic Software ArchitectureBasic Software Architecture

ZigBeeZigBee Interoperability & CoexistenceInteroperability & Coexistence

ZigBeeZigBee Protocol Profile ArchitectureProtocol Profile Architecture

16

TELECOM SERVICES

m-commerceinfo servicesobject interaction (Internet of Things)

ZigBeeWireless Control that

Simply Works

HOME CONTROL

TVVCRDVD/CDremote

securityHVAClighting controlaccess controlirrigation

PC & PERIPHERALS

INDUSTRIALCONTROL

asset mgtprocess control

environmentalenergy mgt

PERSONAL HEALTH CARE

securityHVACAMR

lighting controlaccess control

mousekeyboardjoystick

patient monitoring

fitness monitoring

ZigBeeZigBee ApplicationsApplications

Home ControlHome Control

Wireless Sensor ApplicationsWireless Sensor Applications

Commercial Building AutomationCommercial Building Automation

Advanced Metering InfrastructureAdvanced Metering Infrastructure

Wireless Sensor ApplicationsWireless Sensor Applications

Wireless Sensor ApplicationsWireless Sensor Applications

LAB 1: LAB 1: Being a parent!Being a parent!

1. เปดโปรเจค “..\Consumer Electronics\Design Kit-8\Source\Apps\ZBLab1\Lab1Coordinaotr.mcp” คอมไพลแลวโปรแกรมลงบอรด CEDK-8 เพื่อใหทําหนาที่เปน Coordinator

LAB 1: LAB 1: Being a parent!Being a parent!

2. ตอบอรด CEDK-8 กับ PC ผานพอรตอนุกรม กําหนดให Baud rate 19,200 bps, Parity = None, Data Bits = 8, Stop Bits = 1รันโปรแกรม และดูผลการสรางเน็ตเวิรก

LAB 2: Looking for MomLAB 2: Looking for Mom!!

1. เปดโปรเจค “..\Consumer Electronics\Design Kit-WP\Source\Apps\ZBLab2\Lab2RFD.mcp” คอมไพลแลวโปรแกรมลงบอรด CEDK-WP เพื่อใหทําหนาที่เปน RFD

2. ตอบอรด CEDK-WP กับ PC ผานพอรตอนุกรม กําหนดให Baud rate 19,200 bps, Parity = None, Data Bits = 8, Stop Bits = 1 รันโปรแกรม และดูผลการขอเชือ่มตอเน็ตเวิรก

LAB 3: Beware of mLAB 3: Beware of my message!y message!

1. เปดโปรเจค “..\Consumer Electronics\Design Kit-WP\Source\Apps\ZBLab3\Lab3RFD.mcp”

2. แกไข Source Code

LAB 3: Beware of mLAB 3: Beware of my message!y message!

3. คอมไพลแลวโปรแกรมลงบอรด CEDK-WP เพื่อใหทําหนาที่เปน RFD 4. ตอบอรด CEDK-WP กับ PC ผานพอรตอนุกรม กําหนดให Baud rate 19,200 bps, Parity = None, Data

Bits = 8, Stop Bits = 1 รันโปรแกรม และดูผลการขอเชือ่มตอเน็ตเวิรก5. Bind ระหวาง Coordinator กับ RFD โดยการกด SW16. สง message โดยการกด SW2

Recommended