Project Description

From now on, we get down to make the Gateway Tutorial using Arduino + Zigbee.

Arduino is easy to learn, extra Zigbee and ad-hoc(if you didn’t learn C language, please use it directly. We have wrote the code of ad-hoc in).

In this tutorial, we implemented “Gateway” function through the below accessories, clicking the button with smart phone for glistening the light on Zigbee module(By sending the commands with {ckxxxxxxxxx} format!) By different format of commands, ON/OFF/Receive/Send data function can be operated! After this, Temperature humidity sensor and Zigbee socket ect. can be connected directly!

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

The above is the accessories of Arduino OSHW Gateway

  1. SMARTRF04EB(Zigbee downloader)RMB 35
  2. CP2102(Arduino downloader) RMB 15
  3. Power supply RMB 10
  4. Arduino board(including W5100, zigbee slot, SD slot) RMB 100
  5. Zigbee Development Board RMB30(if you just learn Zigbee, only need two development boards and Zigbee module for ad-hoc learning.)
  6. Zigbee module RMB45

 

Total: RMB235 for implementing your own Arduino OSWH Gateway

 

Part 1: Upload code to Arduino 

  1. Install CP2102 driver(USB driver)

http://pan.baidu.com/s/1o6iDLcm (Install directly after download or updating driver when new hardware is available)

  1. Connect CP2102 with the slot of Arduino bottom one to one corresponding.

DTR->DTR
GND->GND
TX->RXI
RX->TXO
VDD3.3->VCC

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

3. Upload Arduino Sketch 

You can download source code here:

http://pan.baidu.com/s/1i386zPV (including software and all the libraries)

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

(modify as the instruction in notes)

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)
Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

  1. Plug in network cable, and check Internet connection by serial port tool.

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

Part 2: Upload code to Zigbee module

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

1. Plug Zigbee module into Zigbee development board.

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

2. Connect SMARTRF04EB downloader

 Right way : the sticked out end corresponds with NC

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

3. Install SMARTRF04EB driver

http://pan.baidu.com/s/1dDH1ZX3 (Install SmartRFStudio which included driver)

Remind: If upload failed, press the reset button on SMARTRF04EB(you can use pen point to touch it).

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)4. Install IAR 8.1(software is large), for cracking ,please refer to the instruction after installation.

http://pan.baidu.com/s/1c0b69Ra (Download and unzip, you can get the installation instruction)

5. Download Zigbee Ad-hoc code.

http://pan.baidu.com/s/1COxT8(The latest ZStack-CC2530-2.5.1 Ad-hoc code including button and LED function.)

6. Click compile and download
7. Plug a LED into P1.0 and – of Zigbee development board.
8. Plug onto Arduino board.

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

Part 3: Test with smart phone

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

 

  1. Open m.znck007.com app

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

2. Create a switch

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

3. Click switch, if LED is lighting, the gateway is working well.

Arduino开源智能家居DIY《网关》升级版网关正式教程(zigbee)

Ok, gateway part finished!