Idea
The main idea is quite simple – each device should be controllable using PC/smartphone. So there comes requirements:
- Communication channel between devices – ZigBee features seemed as perfect fit.
- Some logic processing at the controlling device – microcontroller driven circuit controls, ability to add sensors/switches.
- Central software to manage all this stuff with/without human help.
At the moment I started to spend my free time on this idea, there was not many ZigBee options available in market, and after some days spent on investigation I decided to go with Digi XBEE modules. These modules takes care of communication, have built in I/O pins, as well as serial interface available. They were perfect to start playing with ZigBee and see how it works and do some prototyping. Still, as these modules don’t have options to easily update software on them, they can not be used as standalone controlling modules, as outputs state can be changed only by external command.
As I needed some microcontrollers involved, I decided to go with Microchip PIC :)… If there is question why PIC and why not something else, then I found Microchip made ZigBee chips, which was left as future option to be investigated later on, and for such case there are samples and some support for ZigBee stack available for PIC’s.
First prototype – temperature measurement nodes
First prototype was quite simple – central controller, two temperature measurement nodes.
Central node was created using PIC18F2550 – I decided to go with USB HID device instead of virtual COM port, and XBEE module added to this microcontroller.
No rocket science involved, standard circuits available from datasheets used to create this device. Device plugged into USB is recognised as HID device, firmware in PIC has been customised to support project needs and be able to act as proxy between XBEE and PC.
Also sensors were made simple – LM61 + XBEE powered by 2AA cells.
And of course, sofware also was needed to have temperature readings stored and presented.
At the end, I was quite satisfied with results – XBEE was working nice, played with different configs, two AA ~2000mAh cells sending readings every 30 seconds did it for ~32 days.
So I decided – this can be used also for more interesting stuff, like controlling devices I have in my home.
Where did you get the power supply for the XBee modules on the wall?
For first modules I built separate small transformer based power supplies in the same size, so they were put in the same box in the wall. But later I used small 5v USB chargers as power supplies. Disassembled and put them in the same box in the wall. They cost almost nothing on ebay and even worst of them were able to supply up to 200mA which is max needed for those modules.