Electric Outlet using Relay Timer R2x and ZigBee

 

 

 Zigbee is a very cool technical. It makes point to point and point to multi point wireless communicate very easy.  National Control Devices released ZR1x/ZR2x with Zigbee module. We will install Zigbee module in an electric outlet. It will be controlled by our timer software, Relay Timer R2x. The outlet can be Turn On/Off according the timers remotely. 

ZigBee Outlet
ZigBee Outlet

 Here are things we will use.

 

Materials
Materials

Car Power Adapter Outlet

Car Power Adapter Outlet
Car Power Adapter Outlet

ZigBee One Relay Controller

ZigBee One Relay Controller
ZigBee One Relay Controller

ZigBee Modem

ZigBee Modem
ZigBee Modem

The voltage for ZR1x is 12v. We use two 5V mobile phone power adapter and connect them together to get 10v for ZR1x.

Two 5v mobile phone power adapter
Two 5v mobile phone power adapter

 

Before we assemble the ZR1x with the outlet, we need configure and test the connection between ZigBee modem and ZR1x.

To make the two ZigBee modules talks to each other, they have to be in same protocol and using the same PAN ID.  We will check Firmware version and destination of Zigbee module on ZR1x and Zigbee modem.

Let’s assume the Zigbee module on ZR1x named Z1 and Zigbee moduel on modem named Z2.

The default baudrate for setting of Z1 is 115200. The setting of Z2 is 9600.  It is not necessary to set the same baudrate to Z1 and Z2.  ZigBee module can talk in different baudrate. I’d like to change Z1 to 9600 so same configuration can work for both Z1 and Z2.

 We will use Comm Operator for this.

Comm Operator v4.1 has plug-in for ZigBee. It is easy to test ZigBee application with it.

Put Z1 in modem board and connect it with computer.

Start Comm Operator, select the port that ZigBee modem used. The default setting for ZigBee modem is 115200, N, 8, 1

Open ZigBee Modem
Open ZigBee Modem

Goto [Tool]->[XBee Device Properties] to confirm the setting of Zigbee modem.

Zigbee Modem Properties
Zigbee Modem Properties

 

Set the destination to Z2’s address.  You can find the 64bits address from Zigbee module. It can also be get from properties window. Set the baudrate to 9600.

Click the “Write to Memory” to update.  Exit the property window and change the setting to 9600, N, 8,1.

Enter property window again.

Click “Read” to verify.

Exit Comm Operator.

Unplug the ZigBee Modem and unmount the Z1 module. mount Z2 to Zigbee Modem board and run Comm Operator again. This time, set Z2’s destination to Z1’s address and write to memory of Z2. Exit Comm Operate after this.

Mount Z2 to ZR1x and Z1 to Zigbee modem.

Power ZR1x.

Start Comm Operator and switch to NCD panel by [View]->[NCD].

Send 254, 0 to turn off and 254 ,1 to turn on.  The ZR1x should turn on/off. So far, we have make this two Zigbee module talk to each other.

The next step is test ZR1x from RelayTimer R2x. It can be download from here.

Install it and Run configuration, set com port and baudrate with same port and baudrate we used in Comm Operator.

Switch to  manual mode and  turn it On/Off manually.

So far we have made everything work together. The next steps is connect the power to ZR1x and put ZR1x and power circuit boards in to car power adapter’s enclosure.

Here is the car power outlet adapater we use.

Inside of APC power adapter
Inside of APC power adapter

Let’s take everything out from it.

Take Everything Out
Take Everything Out

Connec the input 110 v power cable with ZR1x board. Then connect 12 v DC circuit board with 110 v power and Zigbee board.

Connect Parts Together
Connect Parts Together

Drill a hold on side of car power adapter to fix the antenna.

 

Hole on side
Hole on side

We need to finish the bottom of circuit boards with insulation material to prevent them touch each other.

insulant material on bottom
insulant material on bottom

Put three circuit boards into the outlet adapter.

Put Parts Together
Put Parts Together

 Control it with Relay Timer R2x.

 

So far, we have a smart outlet that can be turned on/off automatically!

 

ZigBee Outlet
ZigBee Outlet