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!
The above is the accessories of Arduino OSHW Gateway
- SMARTRF04EB(Zigbee downloader)RMB 35
- CP2102(Arduino downloader) RMB 15
- Power supply RMB 10
- Arduino board(including W5100, zigbee slot, SD slot) RMB 100
- Zigbee Development Board RMB30(if you just learn Zigbee, only need two development boards and Zigbee module for ad-hoc learning.)
- Zigbee module RMB45
Total: RMB235 for implementing your own Arduino OSWH Gateway
Part 1: Upload code to Arduino
Install CP2102 driver(USB driver)
http://pan.baidu.com/s/1o6iDLcm (Install directly after download or updating driver when new hardware is available)
Connect CP2102 with the slot of Arduino bottom one to one corresponding.
DTR->DTR
GND->GND
TX->RXI
RX->TXO
VDD3.3->VCC
3. Upload Arduino Sketch
You can download source code here:
http://pan.baidu.com/s/1i386zPV (including software and all the libraries)
(modify as the instruction in notes)
Plug in network cable, and check Internet connection by serial port tool.
Part 2: Upload code to Zigbee module
1. Plug Zigbee module into Zigbee development board.
2. Connect SMARTRF04EB downloader
Right way : the sticked out end corresponds with NC
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).
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.
Part 3: Test with smart phone
Open m.znck007.com app
2. Create a switch
3. Click switch, if LED is lighting, the gateway is working well.
Ok, gateway part finished!
COMMENTS