Distributed System of Data Collection contains three modules which communicate with each other using wireless network. Wireless network of is fully compatible with IEEE 802.15.4 Standard and ZigBee Standard. Wireless network uses frequency band 2,4[GHz]. One of modules works as an PAN Coordinator. Two other modules work as an ZigBee Devices. PAN Coordinator is responsible for creating and diagnosing the wireless network. PAN Coordinator has also additional function which is to communicate with PC application via USB2.0 using HID class. ZigBee Devices are equipped with two analogue inputs, two digital inputs and four digital outputs. PC application is an interface for operator. PC application displays measurements from ZigBee devices. PC application is a control tool which displays state of the network. It also lets switching on and off digital outputs in both ZigBee devices. Whole PC application is written in C#. PC application has an additional function which lets to record online data from ZigBee devices in “.csv” file.
PAN Coordinator (PAN – Personal Area Network) is main device in distributed system of data collection. In system we use short name for PAN coordinator and we call it master. Master is responsible for various system functions. First of all master creates and controls wireless network. Wireless network has star topology. Second important master’s function is communication with control application via USB interface. Master uses HID class driver for communication with computer. HID class gives 64[kB/s] data flow rate. Master sends measurement data from ZigBee devices (slaves) to control application. Master has built in watchdog timer with period 2,048[s]. Watchdog timer provides reconnection of wireless network in case of lost communication. PAN coordinator has two chips in its construction. First chip is microcontroller. Second chip is wireless module. Microcontroller uses SPI interface to communicate with wireless module. Microcontroller is programmed in C language. Software for master is constructed in that way that it uses interrupt service routines for various events like wireless transmission, wireless reception and USB transactions. Master is powered from USB port.
ZigBee devices are called slaves in system. Every has two 10 bits analogue inputs which use weight compensation method for A/D conversion. Additionally every slave has two digital inputs and four digital outputs. Slaves sends information about its inputs states via wireless network. Slaves are queried by master in specified periods of time. Slaves digital outputs are controlled through control application on computer. Every device has watchdog timer with period 2,048[s]. If wireless communication is lost and watchdog timer will elapse then slave is restarted. After restart slaves starts connecting to network. Slaves modules have two chips in their construction. First chip is microcontroller. Second chip is wireless module. Microcontroller uses SPI interface for communication with wireless module. Both slaves have similar software which is written in C language. Main difference between slaves are their MAC addresses which have to be unique for every device like is defined in IEEE802.15.4 standard and ZigBee standard. ZigBee devices are powered from batteries.
Control application is user interface. Control application was written in C# and uses .NET framework 3.5. Measurements from wireless devices are displayed on screen. Application shows statuses of devices in network and quality of link in network. Through control application user is able to record online data from ZigBee devices. Recording data start when user will mark registering measurements option. File with extension “.csv” will be saved at specified path on hard disk. Files are uploaded with a latest measurement data until user will click STOP button. Period of data uploading to equal to main loop period of communication in system. Main loop takes time of one second T=1[s].
English version of control application. Control application is in offline mode, because there are no devices connected.
Printscreen which shows how looks start of file recording. As you can see application prompts a filename. Prompted filename contains ZigBee device name and date with accuracy to seconds when registration was being started.