• Sonuç bulunamadı

CHAPTER I OVERVIEW OF ZIGBEE

N/A
N/A
Protected

Academic year: 2021

Share "CHAPTER I OVERVIEW OF ZIGBEE"

Copied!
99
0
0

Yükleniyor.... (view fulltext now)

Tam metin

(1)

CHAPTER I

OVERVIEW OF ZIGBEE

1.1 Background

ZigBee is a specification for wireless personal area networks (WPANs) operating at 868 MHz, 915 MHz and 2.4 GHz. A WPAN is a personal area network (a network for interconnecting an individual's devices) in which the device connections are wireless. Using ZigBee, devices in a WPAN can communicate at speeds of up to 250 Kbps while physically separated by distances of up to 100 meters in typical circumstances and greater distances in an ideal environment. ZigBee is based on the 802.15.4 specification approved by the Institute of Electrical and Electronics Engineers Standards Association (IEEE-SA) [11].

ZigBee provides for high data throughput in applications where the duty cycle is low. This makes ZigBee ideal for home, business and industrial automation where control devices and sensors are commonly used. Such devices operate at low power levels, and this, in conjunction with their low duty cycle (typically 0.1% or less), translates into long battery life. Applications well suited to ZigBee include heating, ventilation and air conditioning (HVAC), lighting systems, fire sensing and the detection, intrusion detection and notification of unusual occurrences. ZigBee is compatible with most topologies including peer-to-peer, star network and mesh networks [41].

1.2 The Name ZigBee

The name „ZigBee‟ is derived from the erratic zigging patterns many bees make between flowers when collecting pollen. This is evocative of the invisible webs of connections existing in a fully wireless environment. The standard itself is regulated by a group known as the ZigBee Alliance with over 200 members worldwide [27].

(2)

2 1.3 ZigBee Alliance

The ZigBee Alliance is an association of companies working together to define an open global standard for making low-power wireless networks. The intended outcome of ZigBee Alliance is to create a specification defining how to build different network topologies with data security features and interoperable application profiles. The association includes companies from a wide spectrum of categories, from chip manufactures to system integration companies. The number of members in the association is rapidly growing and is currently over 200. Among the members one can find Philips, Samsung, Motorola and LG.

The first specification was ratified in 2004 and the first generation of ZigBee products had reached the market in 2005. A big challenge for the alliance is to make the interoperability to work among different products. To solve this problem, the ZigBee Alliance has defined different profiles, depending on what type of category the product belongs to. For example there is a profile called Home Lightning that exactly defines how different brands of home lightning-products should communicate with each other [28].

1.4 History of ZigBee

 ZigBee-style networks began to be conceived about 1998, when many installers realized that both WiFi and Bluetooth were going to be unsuitable for many applications. In particular, many engineers saw a need for self-organizing ad-hoc digital radio networks.

 The IEEE 802.15.4 standard was completed in May 2003.

 In the summer of 2003, Philips Semiconductors, a major mesh network supporter, ceased the investment. Philips Lighting has, however, continued Philips' participation and Philips remains a promoter member on the ZigBee Alliance Board of Directors.

 The ZigBee Alliance announced in October 2004 that the membership had more than doubled in the preceding year and had grown to more than 100 member companies, in 22 countries. By April 2005 membership had grown to more than 150 companies and by December 2005 membership had passed 200 companies.

(3)

3

 The ZigBee specifications were ratified on 14 December 2004.

 The ZigBee Alliance announces public availability of Specification 1.0 on 13 June 2005, known as ZigBee 2004 Specification.

 The ZigBee Alliance announces the completion and immediate member availability of the enhanced version of the ZigBee Standard in September 2006, known as ZigBee 2006 Specification.

 During the last quarter of 2007, ZigBee PRO, the enhanced ZigBee specification was finalized [34].

1.5 Evolution of Low-Rate Wireless Personal Area Networks (LR-WPAN) Standardization

The cellular network was a natural extension of the wired telephony network that became pervasive during the mid-20th century. As the need for mobility and the cost of laying new wires increased, the motivation for a personal connection independent of location to that network also increased. Coverage of large area is provided through (1-2 km) cells that cooperate with their neighbors to create a seemingly seamless network. Examples of standards are GSM, IS-136, IS-95. Cellular standards basically aimed at facilitating voice communications throughout a metropolitan area.

Table 1.1: Review of 802.15 alphabet soup 802.15 Wireless Personal Area Networks (WPAN) 802.15.1 WPANs based on Bluetooth

802.15.2 Coexistence of WPAN‟s and WLAN‟s 802.15.3 High data rates 20Mbps+ on WPAN 802.15.3a High speed PHY enhancements 802.15.3b High speed MAC enhancements

802.15.4 Low data rate, simple multi year battery life 802.15.5 Mesh Networking

(4)

4 During the mid-1980s, it turned out that an even smaller coverage area was needed for higher user densities and the emergent data traffic. The IEEE 802.11 working group for WLANs is formed to create a wireless local area network standard.

Whereas IEEE 802.11 was concerned with features such as Ethernet matching speed, long range (100m), complexity to handle seamless roaming, message forwarding and data throughput of 2-11 Mbps, WPANs are focused on a space around a person or object that typically extends up to 10m in all directions. The focus of WPANs is low-cost, low power, short range and very small size. The IEEE 802.15 working group is formed to create WPAN standard (see Table 1.1). This group has currently defined three classes of WPANs that are differentiated by data rate, battery drain and quality of service (QoS). The high data rate WPAN (IEEE 802.15.3) is suitable for multi-media applications that require very high QoS. Medium rate WPANs (IEEE 802.15.1/Bluetooth) will handle a variety of tasks ranging from cell phones to PDA communications and have QoS suitable for voice communications. The low rate WPANs (IEEE 802.15.4/LR-WPAN) is intended to serve a set of industrial, residential and medical applications with very low power consumption and cost requirement not considered by the above WPANs and with relaxed needs for data rate and QoS. The low data rate enables the LR-WPAN to consume very little power [11].

1.6 ZigBee and IEEE 802.15.4

ZigBee technology is a low data rate, low power consumption, low cost, wireless networking protocol targeted towards automation and remote control applications. IEEE 802.15.4 committee started working on a low data rate standard a short while later. Then the ZigBee Alliance and the IEEE decided to join forces and ZigBee is the commercial name for this technology.

ZigBee is expected to provide low cost and low power connectivity for equipment that needs battery life as long as several months to several years but does not require data transfer rates as high as those enabled by Bluetooth. In addition, ZigBee can be implemented in mesh networks larger than is possible with Bluetooth. ZigBee compliant wireless devices are expected to transmit in the range of 1-100 meters, depending on the RF

(5)

5 environment and the power output consumption required for a given application and will operate in the unlicensed RF worldwide (2.4 GHz global, 915 MHz Americas or 868 MHz Europe). The data rate is 250 kbps at 2.4 GHz, 40 kbps at 915 MHz and 20 kbps at 868 MHz.

IEEE and ZigBee Alliance have been working closely to specify the entire protocol stack (see Figure 1.1). IEEE 802.15.4 focuses on the specification of the lower two layers of the protocol (physical and data link layer). On the other hand, ZigBee Alliance aims to provide the upper layers of the protocol stack (from network to the application layer) for interoperable data networking, security services and a range of wireless home and building control solutions, provide interoperability compliance testing, marketing of the standard, advanced engineering for the evolution of the standard. This will assure consumers to buy products from different manufacturers with confidence that the products will work together.

Figure 1.1: Protocol stack structure

IEEE 802.15.4 is now detailing the specification of physical layer (PHY) and medium access layer (MAC) by offering building blocks for different types of networking known as ”star, mesh and cluster tree”. Network routing schemes are designed to ensure power

PHY LAYER MAC LAYER NETWORK/SECURITY LAYERS APPLICATION FRAMEWORK APPLICATION/ PROFILES IEEE 802.15.4 ZigBee Alliance Platform Application

ZigBee PlatformStack Silicon

(6)

6 conservation and low latency through guaranteed time slots. A unique feature of ZigBee network layer is communication redundancy eliminating ”single point of failure” in mesh networks. Key features of PHY include energy and link quality detection, clear channel assessment for improved coexistence with other wireless networks [5].

1.7 ZigBee vs. Other Wireless Standards

Table 1.2 outlines some of the key characteristics of ZigBee and how it stacks up against other common wireless standards [42].

Table 1.2: ZigBee vs. Other wireless standards

ZigBee 802.11 (Wi-fi) Bluetooth UWB (Ultra Wide Band) IR Wireless

Data Rate 20, 40 and 250 Kbits/s 11 & 54

Mbits/s 1 Mbits/s 100 – 500 Mbits/s 20 – 40 Kbits/s 115 Kbits/s 4 & 6 Mbits/s Range (meters) 10 – 100 50 – 100 10 < 10 < 10 Networking Topology Ad-hoc, peer to peer, star, mesh Point to Hub Ad-hoc, very small Networks Point to point Point to point Operating Frequency 868 MHz (Europe) 900-928 MHz (NA), 2.4 GHz (Global) 2.4 and 5 GHz 2.4 GHz 3.1 – 10.6 GHz 800 – 900 nm Complexity (Device and Application impact)

Low High High Medium Low

Power Consumption (Battery option and life) Very low (low power is a design

goal)

High Medium Low Low

Security 128 AES plus application layer secutiry 64 and 128 bit encyption

(7)

7 Other

Information

Devices can join an existing network in under 30ms Device connection requires 3 – 5 sec. Device connection requires up to 10 seconds Typical Applications

Industrial control and monitoring, sensor networks, building automation, home control and automation

toys, games Wireless LAN connectivity, broadband Internet access Wireless connectivity between such as phones, PDA, laptops, headsets Streaming video, home entertainment applications Remote controls, PC, PDA, phone, laptop links

ZigBee looks rather like Bluetooth but is simpler, has a lower data rate and spends most of its time snoozing. This characteristic means that a node on a ZigBee network should be able to run for six months to three years on just two AA batteries (see Table 1.3).

The operational range of ZigBee is 1-100m compared to 10m for Bluetooth (without a power amplifier).

ZigBee sits below Bluetooth in terms of data rate. The data rate of ZigBee is 250 kbps at 2.4 GHz, 40 kbps at 915 MHz and 20 kbps at 868 MHz whereas that of Bluetooth is 1 Mbps.

Table 1.3: Comparison between ZigBee and Bluetooth

Market Name (Standard) ZigBee® (802.15.4) Bluetooth™ (802.15.1) Application Focus Monitoring & Control Cable Replacement

Bandwidth (Hz) 20 – 250 1000

Battery Life (days) 100 - 1000+ 1 - 7

Network Join Time 0.3 - 18 msec 3 sec

Network Size (# of nodes) 65535 7

System Resources 4 kb - 32 kb 250 kb+

Transmission Range

(meters) 1 - 100+ 1 - 10+

(8)

8 ZigBee uses a basic master-slave configuration suited to static star networks of many infrequently used devices that talk via small data packets. It allows up to 65535 nodes. Bluetooth‟s protocol is more complex since it is geared towards handling voice, images and file transfers in ad-hoc networks. Bluetooth devices can support scatternets of multiple smaller non-synchronized networks (piconets) and it only allows up to 7 slave nodes in a basic master-slave piconet set-up.

When ZigBee node is powered down, it can wake up and get a packet in around 15 msec. whereas a Bluetooth device would take around 3 sec. to wake up and respond.

1.8 ZigBee Wireless Markets and Applications

Table 1.4 [36] shows that ZigBee‟s markets and its applications. As seen below ZigBee has a big marketing at many sectors in world wide.

Table 1.4: ZigBee wireless markets and applications

Markets Applications

building automation security, HVAC, AMR, lighting and access conrtol consumer electronics remote control

industrial control asset management, process control, energy management PC & peripherals mouse, keyboard, Joystick

personal health care patent monitoring residental / light

commercial control security, HVAC, lighting and access conrtol

The biggest marketing partition is the building automation in ZigBee applications.

Figure 1.2 shows a typical smart home solutions application using ZigBee [9]. As seen that figure many applications can be performed.

(9)

9 Figure 1.2: Smart home using ZigBee

Zigbee‟s marketing is growing up speedily and its compound annual growth rate is 63% (see Figure 1.3) [10].

Figure 1.3: Worldwide IEEE 802.15.4 and ZigBee Chipset Revenue 0 50 100 150 200 250 300 350 400 2005 2006 2007 2008 2009 2010 2011 2012 $M

(10)

10 There has been many researchers and analysts who studied and developed ZigBee based products. Some of the important studies in this field are given below:

• Remote-controlled home robot server with ZigBee sensor network [13]

Recently, interest of general public towards ubiquitous home networking has increased immensely and wireless PAN (personal area network) has attracted strong attentions as short-distance networking solution. Convenience of wireless PAN technology has attracted more attentions over traditional wired home network devices such as Ethernet, PLC and HomePNA since it requires no cabling work. In the future, home servers will be combined with robots to provide functionalities identical to current home service robots as well as to implement more effective and spontaneous servers. In this paper, Choi et al. described a remotely controlled robot for home automation applications, using ZigBee protocol devices.

A Wireless solution for greenhouse monitoring and control system based on ZigBee [20]

With the rapid development of wireless technologies, it is possible for greenhouses to be equipped with wireless sensor networks due to their low-cost, simplicity and mobility. In this study, the advantages of ZigBee with other two similar wireless networking protocols are compared, e.g. Wi-Fi, Bluetooth and the ZigBee protocol is recommended for greenhouse monitoring and control because of its low-power requirements and the network capacity.

• ZigBee-based demand-response systems reduce home energy usage [8]

Home automation originally evolved to bring whole-house entertainment and comfort control into affluent homes. But the advent of wireless technologies combined with low-power, low-cost hardware has made home automation networks affordable and easy to install for the average homeowner. Beyond the lifestyle benefits, affordable wireless

(11)

11 technology has also enabled manufacturers to embed wireless intelligence into a variety of energy conservation and management technologies that will have a huge impact on reducing our energy woes and greenhouse emissions in the near term. Demand response systems for managing energy usage in homes are among the most promising of these new technologies. Households consume one-fifth of the nation's energy each year with 60% of that consumption in the form of electricity. At the same time, utilities are struggling to manage the peak energy demand dilemma, where about 10% of electric generating capacity exists only to be used less than one percent of the time. If energy demand can respond dynamically to the available energy supply, huge cost, reliability and energy efficiency gains can be achieved within homes and the energy grid without having to build additional power plants. Homeowners are beginning to adopt wireless home area networks (HANs) to gain not just whole-house entertainment control but also the ability to better manage their energy consumption and this without the expense of traditional wired home automation systems. ZigBee is an ideal candidate in such home energy saving applications.

• Development of ZigBee based street light control system [16]

Industry of street lighting systems are growing rapidly and becoming complex with rapid growth of industry and cities. To control and maintain complex street lighting system more economically, various street light control systems are developed. Nevertheless most of the developed systems have some drawbacks. Therefore new light control systems are going to be developed which can overcome old systems drawbacks. Various street light control systems were surveyed and their characteristics analyzed by Lee. Through these efforts, it was found that common drawbacks of most light control systems are their uneasiness of handling and difficulty of maintenance. To reduce these drawbacks, new street light control system has been designed by using Zigbee communication techniques.

• ZigBee-based home security system [2]

AlertMe offering is a subscription-based security system designed to detect events such as an intruder or a fire and alert users via SMS text messaging or email. The Linux-based Hub

(12)

12 at the core of the system stays in constant touch with sensors and other devices scattered around the home via ZigBee. The Hub in turn communicates via a secure broadband connection to alertme.com 's servers, which then send out alerts to the customer and authorized friends and family members.

• ZigBee based wireless sensor network fed with sun batteries [15]

The goal of this project was the producting of supply voltage required for the PicdemZ card and connected sensors that used the Zigbee based security project in the Department of Electrical & Electronics Engineering of Ege University by Kok. Low-power was a requirement here and thus ZigBee was a suitable protocol.

• A home security ZigBee network for remote monitoring application [1]

Securitymonitoring systems are popular in home automation and Zigbee isa new industrial standard wireless sensor network. This paper introduces an experimental home security monitoring and alarming system based on the Zigbee technology. It is capable of monitoring door & window magnetic contacts, smoke, gas leak, water flooding and providing simple controls such as turning off the valves and sending alarms to the residential area security network etc. The security alarmingsystem is based on a Zigbee chip and a low powerconsumption micro-controller. The system usesa control key fob for activating and de-activating the alarmeasily, supports web interface so that users can access thesystem remotely to control, search or review the history recordand also offers a LCD panel for simple configuration. The experimentalsystem has been designed and its wireless communication test resultshows that the Zigbee wireless network can improve the home security with low power and easy to implement solution.

• ZigBee-ready modules for sensor networking [6,17]

Fully functional ZigBee-ready modules have been designed, implemented and tested by many manufacturers. It is shown that ZigBee is suitable for sensor networking where long battery life, large networks and fast network establishment are the main requirements.

(13)

13 • Multi-stage real time health monitoring via ZigBee in smart homes [3]

Dagtas et. al. describe a ZigBee based real-time health monitoring system for use in smart homes. The main advantage of the proposed system was the ability to detect signals wirelessly within a Body Area Network (BAN), low-power and reliable operation.

• Implementing a ZigBee Protocol Stack and Light Sensor in TinyOS [19]

Munk-Stander et. al. describe a ZigBee based protocol stack used in light sensing applications. It is reported that the system had the advantages of low data rate, low power consumption, security and reliability. Even though the implementation is specialized to the light sensor application, the protocol stack in itself can be used to implement many other applications having similar requirements as the ones presented by the authors.

• ZigBee-based IR remote control repeater and its control message frame format [12] A ZigBee based Infrared (IR) remote control repeater has been designed for consumer applications. Many legacy consumer devices are controlled via IR remote controls. A user needs one IR remote control per one legacy consumer device and has to guarantee the line of sight towards legacy consumer devices. As the ubiquitous home era emerges, all home devices are required to be controllable at anytime and anywhere. To control IR-based legacy consumer devices regardless of the line of sight, a small ZigBee-based IR remote control repeater is attached near the IR receiving part of a legacy consumer device. It receives the control message via ZigBee protocol and converts the received message into IR signal which is transmitted to the legacy consumer device. The designed device has the advantage that a large number of nodes can be connected to the device.

• Remote monitoring of motor operational data using ZigBee wireless protocol [4] In today‟s market there is only a slight selection of products in the Heating and AC business that offer wireless technology. The demand for wireless technology that can display a motors status in an HVAC system is essential, especially for motor developers and installers. In this document, the criteria necessary for developing such technology and

(14)

14 the benefits of developing wireless technology to display and manage a high efficient motor within a furnace, subjects are described. Existing HVAC systems only provide temperature information of the thermostat, which is located in the living room. This requires that technicians search for the furnace, disable the furnace box and diagnose the speed and power of the electrically commutated motor (ECM). It will be a big help for the technicians and homeowners if motor information can be provided at the living room.

• ZigBee based dynamic control scheme for multiple legacy IR controllable digital consumer devices [21]

A universal remote control (URC) unit is an integrated device for controlling many different consumer electronics (CE) home appliances. To control these various CE devices based on infrared (IR) control signal, the URC unit has to have many preprogrammed control codes for controlling them because they are controlled with many different types of IR profile stated with lead code, control code, carrier frequency, duty cycle, duration and so forth. In this paper, a dynamic control scheme for multiple legacy IR controllable digital CE appliances are proposed, which is based on IEEE 802.15.4, especially ZigBee protocol. The proposed scheme uses two main components. One is a URC unit using ZigBee based wireless network technology, WPAN. Another is a Z2IR (ZigBee to IR) conversion module which converts a control message transferred through the ZigBee network into an IR typed control signal. In this scheme, the list of CE devices to be controlled by the proposed URC, called as Z-URC (ZigBee based user remote control) is dynamically reconfigured.

• The Impact of ZigBee in a biomedical environment [24]

Thraning described the impact of the ZigBee technology in a biomedical environment in his thesis. The thesis‟s focus is the evaluation of possible technologies and solutions for communication between several wireless sensors and a CIP-node with respect to battery capacity, scalability, fail-safety, security and cost in the design of new applications and communication principles.

(15)

15 • ZigBee suitability for wireless sensor networks in logistic telemetry applications [14] There has been a quick development in the wireless network area during the last decade. Mostly these days the focus in the wireless area is on very high speed and long range applications. This application describes how ZigBee is suitable for wireless sensor networks in logistic telemetry applications for global managing and monitoring of goods. The other aim of this thesis was to examine different issues related to ZigBee to see its fitness for logistic telemetry applications like multi-hop routing issues, routing strategies and design requirements. ZigBee is relatively new wireless technology, so there are great deals of promises associated with it.

• ZigBee for building control wireless sensor Networks [25]

Zucatto et. al. describe a method where the stack profile is selected by the ZigBee coordinator and is chosen on the basis of application areas, such as home control, building automation or plant control. Aiming the development of a commercial ZigBee product for home control. In this paper some important aspects of those standards and the main directives of the stack profile and network topology are described.

• ZigBee-based meter aids energy efficiency [37]

An energy saving ZigBee based plug-in electricity meter is described. The device, called the plogg, allows home and building owners to monitor how much electricity is being used by individual appliances and electronic devices so that energy efficiency can be improved. Recent studies by the British government and the Carbon Trust show that people can save 5-15% of the electricity they use by using smart meters to manage energy demands.

• Remote copy-paste based ZigBee [5]

In today‟s world, the methods for copying data from one computer to another one is not secure. This paper describes how the data can be copied securely between two computers using ZigBee devices.

(16)

16

CHAPTER 2

IEEE 802.15.4 WIRELESS PERSONAL AREA NETWORK, ZIGBEE

LAYERS AND SECURITY

ZigBee is an IEEE 802.15.4 wireless personal area network technology. In this chapter, components of IEEE 802.15.4 wireless personal area network, ZigBee‟s physical, medium access control and routing layers are mentioned. Also given information about ZigBee‟s security.

2.1 IEEE 802.15.4 Wireless Personal Area Network

The main features of this standard are network flexibility, low cost, very low power consumption and low data rate. It is developed for applications with relaxed throughput requirements which cannot handle the power consumption of heavy protocol stacks.

2.1.1 Components of WPAN

A ZigBee system consists of several components. The most basic is the device. A device can be a full-function device (FFD) or reduced-function device (RFD). A network shall include at least one FFD, operating as the PAN coordinator.

The FFD can operate in three modes: a personal area network (PAN) coordinator, a coordinator or a device.

An RFD is intended for applications that are extremely simple and do not need to send large amounts of data. An FFD can communicate with RFDs or FFDs while an RFD can only communicate with an FFD [5].

2.1.2 Network Topologies

Figure 2.1 shows three types of topologies that ZigBee supports; star topology, peer to peer topology and cluster tree [5].

(17)

17 2.1.2.1 Star Topology

In the star topology, the communication is established between devices and a single central controller, called the PAN coordinator. The PAN coordinator may be mains powered while the devices will most likely be battery powered. Applications that benefit from this topology include home automation, personal computer (PC) peripherals, toys and games.

Figure 2.1:Topology models

After an FFD is activated for the first time, it may establish its own network and become the PAN coordinator. Each start network chooses a PAN identifier, which is not currently used by any other network within the radio sphere of influence. This allows each star network to operate independently.

2.1.2.2 Peer to Peer Topology

In peer-to-peer topology, there is also one PAN coordinator. In contrast to star topology, any device can communicate with any other device as long as they are in range of one another. A peer-to-peer network can be ad-hoc, self-organizing and self-healing.

PAN coordinator Full Function Device

Star

Mesh

Cluster Tree

(18)

18 Applications such as industrial control and monitoring, wireless sensor networks, asset and inventory tracking would benefit from such a topology. It also allows multiple hops to route messages from any device to any other device in the network. It can provide reliability by multipath routing.

2.1.2.3 Cluster Tree Topology

Cluster-tree network is a special case of a peer-to-peer network in which most devices are FFDs and an RFD may connect to a cluster-tree network as a leave node at the end of a branch. Any of the FFD can act as a coordinator and provide synchronization services to other devices and coordinators. Only one of these coordinators however is the PAN coordinator.

The PAN coordinator forms the first cluster by establishing itself as the cluster head (CLH) with a cluster identifier (CID) of zero, choosing an unused PAN identifier and broadcasting beacon frames to neighboring devices. A candidate device receiving a beacon frame may request to join the network at the CLH. If the PAN coordinator permits the device to join, it will add this new device as a child device in its neighbor list. The newly joined device will add the CLH as its parent in its neighbor list and begin transmitting periodic beacons such that other candidate devices may then join the network at that device. Once application or network requirements are met, the PAN coordinator may instruct a device to become the CLH of a new cluster adjacent to the first one. The advantage of this clustered structure is the increased coverage area at the cost of increased message latency.

2.1.3 LR-WPAN Device Architecture

Figure 2.2 shows an LR-WPAN device [11]. The device comprises a PHY, which contains the radio frequency (RF) transceiver along with its low-level control mechanism and a MAC sublayer that provides access to the physical channel for all types of transfer. The upper layers consists of a network layer, which provides network configuration, manipulation, message routing and application layer, which provides the intended function

(19)

19 of a device. An IEEE 802.2 logical link control (LLC) can access the MAC sublayer through the service specific convergence sublayer (SSCS).

Figure 2.2: LR-WPAN device architecture

2.2 Physical Layer

The physical layer (PHY) [5] provides two services: the PHY data service and PHY management service interfacing to the physical layer management entity (PLME). The PHY data service enables the transmission and reception of PHY protocol data units (PPDU) across the physical radio channel.

The features of the PHY are activation and deactivation of the radio transceiver, energy detection (ED), link quality indication (LQI), channel selection, clear channel assessment (CCA) and transmitting as well as receiving packets across the physical medium.

The standard offers two PHY options based on the frequency band. Both are based on direct sequence spread spectrum (DSSS). The data rate is 250 kbps at 2.4 GHz, 40 kbps at

Upper Layers 802.2.LLC SSCS MAC PHY Physical Medium

(20)

20 915 MHz and 20 kbps at 868 MHz. The higher data rate at 2.4 GHz is attributed to a higher-order modulation scheme. Lower frequency provide longer range due to lower propagation losses. Low rate can be translated into better sensitivity and larger coverage area. Higher rate means higher throughput, lower latency or lower duty cycle. This information is summarized in Table 2.1.

Table 2.1:Frequency bands and data rates PHY (MHz) Frequency band (MHz) Channel numbering Chip rate (kchips/s) Modulation Bit rate (kb/s) Symbol rate (ksymbol/s) Symbols 868 868-868.6 0 300 BPSK 20 20 Binary 915 902-928 1-10 600 BPSK 40 40 Binary 2450 2400-2483.5 11-26 2000 O-QPSK 250 62.5 16-ary Orthogonal

There is a single channel between 868 and 868.6 MHz, 10 channels between 902.0 and 928.0 MHz, 16 channels between 2.4 and 2.4835 GHz. Several channels in different frequency bands enables the ability to relocate within spectrum. The standard also allows dynamic channel selection, a scan function that steps through a list of supported channels in search of beacon, receiver energy detection, link quality indication and channel switching.

Receiver sensitivities are -85 dBm for 2.4 GHz and -92 dBm for 868/915 MHz. The advantage of 6-8 dBm comes from the advantage of lower rate. The achievable range is a function of receiver sensitivity and transmit power. The maximum transmit power shall conform with local regulations. A compliant device shall have its nominal transmit power level indicated by the PHY parameter.

2.2.1 Transmit Power

The transmitter should be capable of transmitting at least -3 dBm. The device should transmit as low power as possible to reduce interference to other devices and systems. The definition of dBm is shown in Equation 2.1 [18]:

(21)

21 𝑃𝑜𝑤𝑒𝑟𝑑𝐵𝑚 = 10𝑙𝑜𝑔𝑃𝑜𝑤𝑒𝑟𝑚𝑊

1𝑚𝑊 (2.1)

Table 2.2 [38] shows that some dBm – power equations.

Table 2.2: dBm – power equations [30]

dBm Level Power dBm Level Power dBm Level Power

80 dBm 100 kW 20 dBm 100 mW -20 dBm 10 µW 60 dBm 1 kW 15 dBm 32 mW -30 dBm 1.0 µW 50 dBm 100 W 10 dBm 10 mW -40 dBm 100 nW 40 dBm 10 W 6 dBm 4.0 mW -50 dBm 10 nW 36 dBm 4 W 5 dBm 3.2 mW -60 dBm 1.0 nW 33 dBm 2 W 4 dBm 2.5 mW -70 dBm 100 pW 30 dBm 1 W 3 dBm 2.0 mW -80 dBm 10 pW 27 dBm 500 mW 2 dBm 1.6 mW -100 dBm 0.1 pW 26 dBm 400 mW 1 dBm 1.3 mW -111 dBm 0.008 pW 25 dBm 316 mW 0 dBm 1.0 mW -127.5 dBm 0.178 fW 24 dBm 250 mW -1 dBm 794 µW -174 dBm 0.004 aW 23 dBm 200 mW -3 dBm 501 µW -192.5 dBm 0.056 zW 22 dBm 160 mW -5 dBm 316 µW -∞ dBm 0 W 21 dBm 125 mW -10 dBm 100 µW

2.2.2 Receiver Energy Detection (ED)

The receiver energy detection (ED) [5] measurement is intended for use by a network layer as part of channel selection algorithm. It is an estimate of the received signal power within the bandwidth of an IEEE 802.15.4 channel. No attempt is made to identify or decode signals on the channel. The ED time should be equal to 8 symbol periods.

The ED result shall be reported as an 8-bit integer ranging from 0x00 to 0xFF. The minimum ED value (0) shall indicate received power less than 10 dB above the specified receiver sensitivity. The range of received power spanned by the ED values shall be at least 40dB. Within this range, the mapping from the received power in decibels to ED values shall be linear with an accuracy of ±6 dB.

(22)

22 2.2.3 Link Quality Indication (LQI)

Upon reception of a packet, the PHY sends the PSDU length, PSDU itself and link quality (LQ) in the PD-DATA indication primitive. The LQI [5] measurement is a characterization of the strength and/or quality of a received packet. The measurement may be implemented using receiver ED, a signal-to-noise estimation or a combination of these methods. The use of LQI result is up to the network or application layers. The LQI result should be reported as an integer ranging from 0x00 to 0xff. The minimum and maximum LQI values should be associated with the lowest and highest quality IEEE 802.15.4 signals detectable by the receiver and LQ values should be uniformly distributed between these two limits.

2.2.4 Clear Channel Assessment (CCA)

The clear channel assessment (CCA) [5] is performed according to at least one of the following three methods:

• Energy above threshold. CCA shall report a busy medium upon detecting any energy above the ED threshold.

• Carrier sense only. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4. This signal may be above or below the ED threshold.

• Carrier sense with energy above threshold. CCA shall report a busy medium only upon the detection of a signal with the modulation and spreading characteristics of IEEE 802.15.4 with energy above the ED threshold.

2.2.5 PHY Protocol Data Unit (PPDU) Format

The PPDU [5] packet structure is illustrated in Table 2.3. Each PPDU packet consists of the following basic components:

(23)

23 • Synchronization Header (SHR), which allows a receiving device to synchronize and lock into the bit stream

• A variable length payload, which carries the MAC sublayer frame.

Table 2.3: Format of the PPDU

Octets:4 1 1 Variable

Preamble SFD Frame length (7 bits) Reserved (1 bit) PSDU

SHR PHR PHY payload

2.3 Medium Access Control Layer

The Medium Access Control (MAC) layer [6] provides the interface between the PHY layer and the NWK layer. The MAC is responsible for generating beacons and synchronizing the device to the beacons (in a beacon-enabled network). The MAC layer also provides association and disassociation services.

2.3.1 MAC Frame Structures

The IEEE 802.15.4 defines 4 MAC frame structures [6]: • Beacon frame

• Data frame

• Acknowledge frame • MAC command frame

The beacon frame is used by a coordinator to transmit beacons. The beacons are used to synchronize the clock of all the devices within the same network. The data and acknowledgment frames are used to transmit data and accordingly acknowledge the successful reception of a frame. The MAC commands are transmitted using a MAC command frame.

(24)

24 2.3.1.1 The Beacon Frame

The structure of a beacon frame [6] is shown in Figure 2.3. The entire MAC frame is used as a payload in a PHY packet. The content of the PHY payload is referred to as the PHY Service Data Unit (PSDU).

In the PHY packet, the preamble field is used by the receiver for synchronization. The start-of-frame delimiter (SFD) indicates the end of SHR and start of PHR. The frame length specifies the total number of octets in the PHY payload (PSDU).

The MAC frame consists of three sections: the MAC header (MHR), the MAC payload and the MAC footer (MFR). The frame control field in the MHR contains information defining the frame type, addressing fields and other control flags. The sequence number specifies the beacon sequence number (BSN). The addressing field provides the source and destination addresses. The auxiliary security header is optional and contains information required for security processing.

The MAC payload is provided by the NWK layer. The superframe is a frame bounded by two beacon frames. The superframe is optionally used in a beacon-enabled network and helps define GTSs. The GTS field in the MAC payload determines whether a GTS is used to receive or transmit. Mac Layer MHR MAC Payload MFR PHY Layer SHR PHR PHY Payload

Figure 2.3: The MAC Beacon Frame Structure Frame Control Sequence Number Adressing Fields Auxiliary Security HDR Superframe Specification GTS Fields Pending Address Fields Beacon Payload FCS Preamble Sequence SFD Frame Length Reserved PSDU

(25)

25 The beacon frame is not only used to synchronize the devices in a network but is also used by the coordinator to let a specific device in a network know there is data pending for that device in the coordinator. The device, at its discretion, will contact the coordinator and request that it transmit the data to the device. This is called indirect transmission. The pending address field in the MAC payload contains the address of the devices that have data pending in the coordinator. Every time a device receives a beacon, it will check the pending address field to see if there is data pending for it.

The beacon payload field is an optional field that can be used by the NWK layer and is transmitted along with the beacon frame. The receiver uses the Frame Check Sequence (FCS) field to check for any possible error in the received frame.

2.3.1.2 The Data Frame

The MAC data frame [6] is shown in Figure 2.4. The data payload is provided by the NWK layer. The data in the MAC payload is referred to as the MAC Service Data Unit (MSDU). The fields in this frame are similar to the beacon frame except the superframe, GTS and pending address fields are not present in the MAC data frame. The MAC data frame is referred to as the MAC Protocol Data Unit (MPDU) and becomes the PHY payload.

MAC Layer MHR MAC Payload MFR PHY Layer SHR PHR PHY Payload

Figure 2.4: The MAC Data Frame Structure Frame Control Sequence Number Adressing Fields Auxiliary

Security HDR Data Payload FCS

Preamble

Sequence SFD

Frame Length

(26)

26 2.3.1.3 The Acknowledgment Frame

The MAC acknowledgment frame [6], shown in Figure 2.5, is the simplest MAC frame format and does not carry any MAC payload. The acknowledgment frame is sent by one device to another to confirm successful reception of a packet.

MAC Layer MHR MFR PHY Layer SHR PHR PHY Payload

Figure 2.5: The MAC Acknowledgment Frame Structure

2.3.1.4 The Command Frame

The MAC commands such as requesting association or disassociation with a network are transmitted using the MAC command frame [6]. The command type field determines the type of the command (e.g. association request or data request). The command payload contains the command itself. The entire MAC command frame is placed in the PHY payload as a PSDU.

2.3.2 Channel Access and Addressing

Two channel-access mechanisms are implemented in 802.15.4. For a non-beacon network, a standard CSMA-CA (carrier sense medium access with collision avoidance) communicates with positive acknowledgement for successfully received packets. In a beacon-enabled network, a superframe structure is used to control channel access. The superframe is set up by the network coordinator to transmit beacons at predetermined intervals (multiples of 15.38ms, up to 252s) and provides 16 equal-width time slots

Frame Control Sequence

Number FCS

Preamble

Sequence SFD

Frame Length

(27)

27 between beacons for contention-free channel access in each time slot. The structure guarantees dedicated bandwidth and low latency. Channel access in each time slot is contention-based. However, the network coordinator can dedicate up to seven guaranteed time slots per beacon interval for quality of service.

Device addresses employ 64-bit IEEE and optional 16-bit short addressing. The address field within the MAC can contain both source and destination address information (needed for peer-to-peer operation). This dual address information is used in mesh networks to prevent a single point of failure within the network [7].

The channel Access mechanism used is Carrier Sense Multiple Access with Collision Avoidance (CSMA-CA). In CSMA-CA, anytime a device wants to transmit, it first performs a clear channel assessment (CCA) to ensure that the channel is not in use by any other device. Then the device starts transmitting its own signal. The decision to declare a channel clear or not can be based on measuring the spectral energy in the frequency channel of interest or detecting the type of the occupying signal.

When a device plans to transmit a signal, it first goes into receive mode to detect and estimate the signal energy level in the desired channel. This task is known an energy detection (ED). In ED, the receiver does not try to decode the signal and only the signal energy level is estimated. If there is a signal already in the band of interest, ED does not determine whether or not this is an IEEE 802.15.4 signal [6].

2.3.3 Device Types

ZigBee networks use three device types [7]:

 The network coordinator maintains overall network knowledge. It's the most sophisticated of the three types and requires the most memory and computing power.

 The full function device (FFD) supports all 802.15.4 functions and features specified by the standard. It can function as a network coordinator. Additional memory and computing power make it ideal for network router functions or it could be used in network-edge devices (where the network touches the real world).

(28)

28

 The reduced function device (RFD) carries limited (as specified by the standard) functionality to lower cost and complexity. It's generally found in network-edge devices.

2.3.4 Power and Beacons

Ultra-low power consumption is how ZigBee technology promotes a long lifetime for devices with nonrechargeable batteries. ZigBee networks are designed to conserve the power of the slave nodes. For most of the time, a slave device is in deep-sleep mode and wakes up only for a fraction of a second to confirm its presence in the network. For example, the transition from sleep mode to data transition is around 15ms and new slave enumeration typically takes just 30ms.

ZigBee networks can use beacon or non-beacon environments. Beacons are used to synchronize the network devices, identify the HAN and describe the structure of the superframe. The beacon intervals are set by the network coordinator and vary from 15ms to over 4 minutes. Sixteen equal time slots are allocated between beacons for message delivery. The channel access in each time slot is contention-based. However, the network coordinator can dedicate up to seven guaranteed time slots for noncontention based or low-latency delivery.

The non-beacon mode is a simple, traditional multiple-access system used in simple peer and near-peer networks. It operates like a two-way radio network, where each client is autonomous and can initiate a conversation at will, but could interfere with others unintentionally. The recipient may not hear the call or the channel might already be in use. Beacon mode is a mechanism for controlling power consumption in extended networks such as cluster tree or mesh. It enables all the clients to know when to communicate with each other. Here, the two-way radio network has a central dispatcher that manages the channel and arranges the calls. The primary value of beacon mode is that it reduces the system's power consumption.

Non-beacon mode is typically used for security systems where client units, such as intrusion sensors, motion detectors and glass-break detectors, sleep 99.999% of the time.

(29)

29 Remote units wake up on a regular, yet random, basis to announce their continued presence in the network. When an event occurs, the sensor wakes up instantly and transmits the alert (Somebody's on the front porch). The network coordinator, powered from the main source, has its receiver on all the time and can therefore wait to hear from each of these stations. Since the network coordinator has an infinite source of power it can allow clients to sleep for unlimited periods of time, enabling them to save power.

Beacon mode is more suitable when the network coordinator is battery-operated. Client units listen for the network coordinator's beacon (broadcast at intervals between 0.015 and 252s). A client registers with the coordinator and looks for any messages directed to it. If no messages are pending, the client returns to sleep, awaking on a schedule specified by the coordinator. Once the client communications are completed, the coordinator itself returns to sleep.

This timing requirement may have an impact on the cost of the timing circuit in each end device. Longer intervals of sleep mean that the timer must be more accurate or turn on earlier to make sure that the beacon is heard, both of which will increase receiver power consumption. Longer sleep intervals also mean the timer must improve the quality of the timing oscillator circuit (which increases cost) or control the maximum period of time between beacons to not exceed 252s, keeping oscillator circuit costs low [7].

2.4 ZigBee Routing Layer

ZigBee routing algorithm can be thought of an hierarchical routing strategy with table driven optimizations applied where possible. The routing layer is said to start with the well-studied public domain algorithm, Ad-hoc On Demand Distance Vector (AODV) and Motorola‟s Cluster-Tree algorithm. In this section; AODV is summarized.

2.4.1 Ad-hoc On Demand Distance Vector (AODV)

The Ad-hoc On Demand Distance Vector (AODV) [22] routing algorithm is a routing protocol designed for ad-hoc mobile networks (see Figure 2.6). AODV is capable of both

(30)

30 unicast and multicast routing. It is an on demand algorithm, meaning that it builds routes between nodes only as desired by source nodes. It maintains these routes as long as they are needed by the sources. Additionally, AODV forms trees which connect multicast group members. The trees are composed of the group members and the nodes needed to connect the members. AODV uses sequence numbers to ensure the freshness of routes. It is loop-free, self-starting and scales to large numbers of mobile nodes.

Figure 2.6: Reverse and forward path formation in AODV protocol

AODV builds routes using a route request / route reply query cycle. When a source node desires a route to a destination for which it does not already have a route, it broadcasts a route request (RREQ) packet across the network. Nodes receiving this packet update their information for the source node and set up backwards pointers to the source node in the route tables. In addition to the source node's IP address, current sequence number and broadcast ID, the RREQ also contains the most recent sequence number for the destination of which the source node is aware. A node receiving the RREQ may send a route reply (RREP) if it is either the destination or if it has a route to the destination with corresponding sequence number greater than or equal to that contained in the RREQ. If this is the case, it unicasts a RREP back to the source. Otherwise, it rebroadcasts the RREQ.

timeout

D D

S

(31)

31 Nodes keep track of the RREQ's source IP address and broadcast ID. If they receive a RREQ which they have already processed, they discard the RREQ and do not forward it.

As the RREP propagates back to the source, nodes set up forward pointers to the destination. Once the source node receives the RREP, it may begin to forward data packets to the destination. If the source later receives a RREP containing a greater sequence number or contains the same sequence number with a smaller hopcount, it may update its routing information for that destination and begin using the better route. As long as the route remains active, it will continue to be maintained. A route is considered active as long as there are data packets periodically travelling from the source to the destination along that path. Once the source stops sending data packets, the links will time out and eventually be deleted from the intermediate node routing tables. If a link break occurs while the route is active, the node upstream of the break propagates a route error (RERR) message to the source node to inform it of the now unreachable destination(s). After receiving the RERR, if the source node still desires the route, it can reinitiate route discovery.

Multicast routes are set up in a similar manner. A node wishing to join a multicast group broadcasts a RREQ with the destination IP address set to that of the multicast group and with the 'J' (join) flag set to indicate that it would like to join the group. Any node receiving this RREQ that is a member of the multicast tree that has a fresh enough sequence number for the multicast group may send a RREP. As the RREPs propagate back to the source, the nodes forwarding the message set up pointers in their multicast route tables. As the source node receives the RREPs, it keeps track of the route with the freshest sequence number and beyond that the smallest hop count to the next multicast group member. After the specified discovery period, the source node will unicast a Multicast Activation (MACT) message to its selected next hop. This message serves the purpose of activating the route. A node that does not receive this message that had set up a multicast route pointer will timeout and delete the pointer. If the node receiving the MACT was not already a part of the multicast tree, it will also have been keeping track of the best route from the RREPs it received. Hence it must also unicast a MACT to its next hop and so on until a node that was previously a member of the multicast tree is reached.

(32)

32 AODV maintains routes for as long as the route is active. This includes maintaining a multicast tree for the life of the multicast group. Because the network nodes are mobile, it is likely that many link breakages along a route will occur during the lifetime of that route. The papers listed below describe how link breakages are handled. The WMCSA paper describes AODV without multicast but includes detailed simulation results for networks up to 1000 nodes. The Mobicom paper describes AODV's multicast operation and details simulations which show its correct operation. The internet drafts include descriptions of both unicast and multicast route discovery, as well as mentioning how QoS and subnet aggregation can be used with AODV. Finally, the IEEE Personal Communications paper and the Infocom paper details an in-depth study of simulations comparing AODV with the Dynamic Source Routing (DSR) protocol and examines each protocol's respective strengths and weaknesses.

2.4.2 Cluster-Tree Algorithm

The cluster-tree protocol [5] is a protocol of the logical link and network layers that uses link-state packets to form either a single cluster network or a potentially larger cluster tree network. The network is basically self-organized and supports network redundancy to attain a degree of fault resistance and self-repair.

Nodes select a cluster head and form a cluster according to the self-organized manner. Then self-developed clusters connect to each other using the Designated Device (DD).

2.4.2.1 Single Cluster Network

The cluster formation process begins with cluster head selection. After a cluster head is selected, the cluster head expands links with other member nodes to form a cluster.

2.4.2.2 Multi Cluster Network

To form a network, a Designated Device (DD) is needed. The DD has responsibility to assign a unique cluster ID to each cluster head. This cluster ID combined with the node ID

(33)

33 that the CH assigns to each node within a cluster forms a logical address and is used to route packets. Another role of the DD is to calculate the shortest route from the cluster to the DD and inform it to all nodes within the network.

2.5 Zigbee Security

In a wireless network, the transmitted messages can be received by any nearby device, including an intruder. There are two main security concerns in a wireless network. The first one is data confidentiality. The intruder device can gain sensitive information by simply listening to the transmitted messages. Encrypting the messages before transmission will solve the confidentiality problem. An encryption algorithm modifies a message using a string of bits known as the security key and only the intended recipient will be able to recover the original message. The IEEE 802.15.4 standard supports the use of Advanced Encryption Standard (AES) [35] to encrypt their outgoing messages.

The second concern is that the intruder device may modify and resend one of the previous messages even if the messages are encrypted. Including a message integrity code (MIC) with each outgoing frame will allow the recipient to know whether the message has been changed in transit. This process is known as data authentication.

One of the main constraints in implementing security features in a ZigBee wireless network is limited resources. The nodes are mainly battery powered and have limited computational power and memory size. ZigBee is targeted for low-cost applications and the hardware in the nodes might not be tamper resistant. If an intruder acquires a node from an operating network that has no tamper resistance, the actual key could be obtained simply from the device memory. A tamper-resistant node can erase the sensitive information, including the security keys, if tampering is detected.

(34)

34

CHAPTER 3

USING ZIGBEE IN REMOTE MONITORING AND AUTOMATION

3.1 Overview of the Automation

This chapter describes the system that has been developed by the author to measure the light intensity dynamically in real-time and then to plot it.

The author has used the ZigBee development kit manufactured by Telegesis [29] as the hardware in the development. Further details about this kit are given in Appendix A.

For measuring the light intensity remotely, a computer (PC), a ZigBee development kit, an RS-232 [23] serial cable and a battery are used as shown in Figure 3.1.

Figure 3.1: Development kit connected to computer by USB-RS232 cable

(35)

35 Figure 3.2 Block diagram of the remote monitoring system

The ZigBee kit is normally connected to the PC using a standard RS232 type serial cable. But most computers nowadays do not have serial ports. Because of this, a USB to serial converter was used to make the connection.

The PC sends commands in ASCII format to the development board and then the development board communicates with the sensor board in order to receive the results of the measurement. These results are passed to the program running on the PC, stored in the database and also plotted in dynamically in real-time.

3.2 The Monitoring Program

In this thesis, Delphi5 and Oracle Database 10g were used as the control and monitoring programming. Delphi, produced by Borland International, is a powerful development environment used primarily to build client/server applications for Microsoft Windows with an emphasis on databases. Based on Object Pascal, it is object-oriented and was designed to give developers the ability to build applications easily with minimal coding required [26].

The Oracle Database (commonly referred to as Oracle RDBMS or simply Oracle) [29] consists of a relational database management system (RDBMS) produced and marketed by Oracle Corporation. ZigBee Board PC Light Sensor Sensor Board

(36)

36 In the project, Delphi has been connected to Oracle Database by Direct Oracle Access 5 (DOA5) component.

All of the program code is listed in Appendix B. The operation of the program is explained below.

As seen in Figure 3.3, the program consists of a MENU with six items.

Figure 3.3: The program MENU

ComPort is a general component which is used for connecting the computer to the development kit.

UComPortConnection has been used to communicate with ComPort component with the program.

UComPortSettingsFrm has been written for setting the com port connections.

UZigbeeChartFrm contains code for the database calling chart.

ZigbeeMainFrm has been used for the main form of the program. It contains code for the first open page.

(37)

37 When the system is switched on, six icons are displayed on the grid as shown in Figure 3.4.

Figure 3.4 Icons on the grid

“ “ shows that OracleSession. It is used for connection to database.

“ ” is the timer icon. When „Send Command Automatically‟ check box is clicked; timer is enabled. The time is measured in 1000 ms

“ ” icon shows OracleDataset. That is for running SQL. There are two OracleDataset icons as shown; one of them is used for grid and graphic on form1, the other one is used in UComportConnection form. It is to save the data comes from com port to database.

“ ” is the menu icon.

(38)

38 Dataset is connected to datasource, datasource is connected to grid.

The following commands should be used for creating a table and for connecting to the database:

SQL> CREATE TABLE LIGHT(KEY NUMBER, TIME DATE, VALUE NUMBER, RESISTANCE NUMBER, LIGHT NUMBER, PRIMARY KEY (KEY));

SQL> commit;

SQL> CREATE SEQUENCE LIGHTSEQ; SQL> commit;

The program saves all data coming from the development kit in a log.txt file. The Oracle database saves the light intensity values that are sent by the development board.

3.3 Light Intensity Measurement

The sensor board sends the light measurement in units of “mV”. This should be converted to the units of light, which is Lux. The conversion process is described in this section.

Lux [39] is the SI unit of illuminance and luminous emittance. It is used in photometry as a measure of the apparent intensity of light hitting or passing through a surface. It is analogous to the radiometric unit watts per square metre, but with the power at each wavelength weighted according to the luminosity function, a standardized model of human brightness perception. It‟s symbol is lx.

1 lm/m2 (lumens per square meter) = 1 lux (lx)

= 10-4 lm/cm2 = 10-4 phot (ph) = 9.290 x 10-2 lm/ft2

(39)

39 The light intensity is sensed using a light dependent resistor with a voltage source. The light intensity is inversely proportional to the resistance of teh sensor. Thus, as the light intensity increases, the resistance of teh sensor is reduced. For measuring the light intensity (Lux), some calculations are needed as the development kit sends the measured light intensity as a hexadecimal value in “mV”.

The output of the light sensor is read by sending command string: ATSREM12:000D6F00000DC449?

The sensor board responds with a 4-digit hexadecimal value, such as:

S12:02C6 OK

First of all it is necessary to convert this hexadecimal value into decimal: Vo = 02C6 = (16³x0) + (16²x2) + (16¹x12) + (16⁰x6) = 710 mV

After that we must find R (resistance of the sensor) using the following formula:

R = (33000/Vo) – 10

The manufacturer specifies that [33], in this formula Vcc = 3.3 = 33000 mV.

Inserting the voltage in the formula which was sent by the sensor board;

R = (33000/710) – 10 = 36.48 Kohm

Figure 3.5 shows the resistance-light intensity graph [40] of the light sensor used in this study. The type used was the A905014 (indicated with number 14).

(40)

40 Figure 3.5 A9050-14 light sensor R-Lux graphic

It is now necessary to convert the measured resistance value into lux. Looking at Figure 3.5, it is not easy to derive a single equation to cover the entire range of the measurement. The graph was therefore divided into six sections and different straight line equations were used for to define the resistance-lux relationships in each section.

The ranges are for resistance (KΩ)

 1000000 – 10000  10000 – 1000  1000 – 100  100 – 10  10 – 5  5 – 0.01

Using A905014 graph, six linear equations are found as shown in Table 3.1 and Table 3.2. A9050… 10000 1000 10 1 0,1 1 10 1000 0,1 100 0,01 100 R/KΩ 14 13 12 Lux

(41)

41 Table 3.1: Linear equation calculations

R(y) Lux(x) m = (y2-y1) / (x2-x1) (y-y1) = m(x-x1) m = (1000000-10000) / (0,1-0,2) (y-10000) = -9900000(x-0.2) 1000000 0.1 m = (990000) / (-0,1) y-10000 = -9900000x + 1980000 10000 0.2 m = -9900000 y = -9900000x + 1970000 x = (1970000-y) / 9900000 m = (10000-1000) / (0.2-1) (y-1000) = -11250(x-1) 10000 0.2 m = (9000) / (-0.8) y - 1000 = -11250x + 11250 1000 1 m = -11250 y = -11250x + 12250 x = (12250-y) / 11250 m = (1000-100) / (1-20) (y-1000) = -47.36(x-1) 1000 1 m = (900) / (-19) y - 1000 = -47.36x + 47.36 100 20 m = -47.36 y = -47.36x + 1047.36 x = (1047.36-y) / 47.36 m = (100-10) / (20-300) (y-100) = -0.32(x-20) 100 20 m = (90) / (-280) y - 100 = -0.32x + 6.4 10 300 m = -0.32 y = -0.32x + 106.4 x = (106.4-y) / 0.32 m = (10-5) / (300-1000) (y-10) = -0.0071(x-300) 10 300 m = (5) / (-700) y - 10 = -0.0071x + 2.13 5 1000 m = -0.0071 y = -0.0071x + 12.13 x = (12.13-y) / 0.0071 m = (5-01) / (1000-100000) (y-5) = -0.00005(x-1000) 5 1000 m = (4.99) / (-99000) y - 5 = -0.00005x + 0.05 0.01 100000 m = -0.00005 y = -0.00005x + 5.05 x = (5.05-y) / 0.00005

Table 3.2: A905014 light sensor‟s equations

R/KΩ (y) Equations 1000000 > y > 10000 Lux(x) = (1970000-y) / 9900000 9999.99 > y > 1000 Lux(x) = (12250-y) / 11250 999.99 > y > 100 Lux(x) = (1047.36-y) / 47.36 99.99 > y > 10 Lux(x) = (106.4-y) / 0.32 9.99 > y > 5 Lux(x) = (12.13-y) / 0.0071 4.99 > y > 0.01 Lux(x) = (5.05-y) / 0.00005

(42)

42 If y = 36.48 Kohm → 99.99 > y > 10 → Lux = (1047.36-y) / 47.36 → Lux = (1047.36-36.48) / 47.36 → Lux = 21.34 lx

3.4 Graphical User Interface of the Automation Program

Figure 3.6 shows the main window of the program. There are three main menus: „Settings‟, „Graphics‟ and „Exit‟. Settings menu is used for configuring the serial port and database, graphics menu is used for calling values from the database and exit is for closing the program.

Figure 3.6 Main page of interface program

When the „Graphics‟ menu is clicked from the GUI main page, the window shown in Figure 3.7 opens to display the instantaneous light intensity values.

(43)

43 Figure 3.7 Instantaneous data values

The display period can be chosen from a ComboBox as minutes, tens of minutes, hours, or days. Measurement values can be collected automatically and then sent by ticking the CheckBox “Send Command Automatically”. Figure 3.8 shows an example of collecting data at hourly intervals.

Figure 3.8: An hour time period light graphic

The development kit communicates with the computer using standard AT commands [30]. AT commands are also known as Hayes AT commands. There are different views to understand the meanings of "AT". Some call it "Attention Telephone", whereas others

Referanslar

Benzer Belgeler

Kişilikleriyle, davranışları ve uğraşıları ile se­ vindirici olduğu kadar, şaşırtıcı ve birlikte olmanın bana sınırsız mutluluk verdiği bu insanlar

(1998) BCR-ABL antisense oligodeoxynucleotide in vitro purging and autologous bone marrow transplantation for patients with chronic myelogenous leukemia in advanced phase..

Prior to proposed lab kits, students performed Matlab/Simulink based simulation experiments for the identification and control of a DC motor model for several years using a sample

İstanbul Tasarım Bienali, sergilerin yanı sıra paneller, söyleşiler ve bir- çok farklı etkinlikle de bir ay boyunca tüm şehre yayılıyor.. Bienalin ilk yılın- da

This results in a reduced effective conduction band barrier height for the p-type AlGaN electron blocking layer (EBL) and makes the electron blocking effect relatively ineffective

Analysis of the per- formance sensitivity of the optimal power allocation strategy to the uncertainty in spectrum estimation is performed, and the performance of optimal power

Fotoğraf 3: Üç Ayak Gücü Düzeneği Fotoğraf 4: Demir Çubuk, Kolan Dokuma Tezgâhı Kaynak: (Fotoğraf 3) Yüceer Arslan, 2014:127, (Fotoğraf 4) Serpil Erdeliğ Demirbaş,

Dusunen Adam The Journal of Psychiatry and Neurological Sciences 2018;31:396-399 Olgu Sunumu / Case Report..