0% found this document useful (0 votes)
133 views44 pages

Smart Meter

This document presents the design of a senior project to create a wireless power consumption data collection system. The proposed system uses an ADE7757 energy metering integrated circuit to measure power, an LPC2148 microcontroller to process the data, and XBee-PRO Digi-Mesh 2.4 modules for wireless data transmission. The document outlines the components, methodology, and future plans for implementing the system in the senior project. It aims to provide an accurate, inexpensive, and efficient solution for wireless power consumption data collection.

Uploaded by

kawthar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views44 pages

Smart Meter

This document presents the design of a senior project to create a wireless power consumption data collection system. The proposed system uses an ADE7757 energy metering integrated circuit to measure power, an LPC2148 microcontroller to process the data, and XBee-PRO Digi-Mesh 2.4 modules for wireless data transmission. The document outlines the components, methodology, and future plans for implementing the system in the senior project. It aims to provide an accurate, inexpensive, and efficient solution for wireless power consumption data collection.

Uploaded by

kawthar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Senior II Project Design 2012

Wireless Power Consumption Data


Collection

University Of Sharjah
Department of Electrical and Computer Engineering
Senior Design Project (I)
Fall 2011/2012

Done By

Asma Alzaabi Kawther aljasmi Marwah Abdulla


20721529 20721556 20721526

Supervisor: Dr. Mohamed Saad


Examiner: Dr. Amr Mohamed El Nady
Chair: Dr .Bassel Soudan
Date : 18/12/2011

|Page1
Senior II Project Design 2012

Acknowledgement

This project is a result of many individual cooperation , So we would like to

extend our sincere thanks and appreciation to Dr. Mohamed Saad for his

encouragement and support to us to do the best always. Our appreciation for Dr

.Bassel Soudan , Dr.Amr Mohamed El Nady and Dr.Ahmed Alwakil for their

assistance in answering all our Inquiries, and providing us by the useful

information.

Last but not least we would like thank our parents in helping us, guiding us and

supporting us.

|Page2
Senior II Project Design 2012

Table of Contents

Chapter 1 Introduction....1

1.1 Scope.....1

1.2 Motivation of this Senior Project......1

1.3 Project Objectives.....2

1.4 Project Description...3

Chapter 2 Power Measurements.... 5

2.1 Overview about ADE7757 Energy Metering IC with Integrated

Oscillator....5

2.2 Power Measurement Inputs of ADE7757.....6

2.3 Real Power Calculation..7

2.4 Power Factor Considerations.9

2.5 Power Measurement Outputs of ADE7757..10

2.5.1 Frequency Selection of ADE7757..........10

2.5.2 Frequency of ADE7757 Outputs............10

2.6 ADE7757 Interface with the Microcontroller ............12

Chapter 3 Power Information Processing ....13

3.1 Overview about LPC2148 Specifications...13

3.1.1 Block Diagram14

3.1.2 Pining Information..15

3.1.3 LPC2148 Features and Advantages....16

|Page3
Senior II Project Design 2012
3.2 LPC2148 Development Board and interference with external

devices....18

3.2.1 LPC214x Evaluation Board.....18

3.2.2 LPC2148 Programming ....19

3.2.3 Software development environment..20

3.3 Real Power Calculation Using LPC2148 ..21

3.3.1 Description and Functions of LPC2148 used Pins...21

3.3.1.1 General Purpose Timers / External Event Counters..21

3.3.1.2 Capture Input.....21

3.3.1.3 Interrupt.......22

3.3.1.4 Real Time Clock.......24

Chapter 4 Transferring Power Consumption Data Using ZigBee

Communication....25

4.1 Introduction25

4.2 Overview about ZigBee Communication25

4.2.1 Technical Overview...26

4.2.2 ZigBee Nodes Types.........27

4.3 ZigBee Network Topology...28

4.4 Overview about Xbee-PRO digi-mesh 2.4..31

4.5 Xbee-PRO Digi-Mesh 2.4 Configuration....32

4.5.1 Xbee-PRO Digi-Mesh 2.4 Configuration requirements....32

|Page4
Senior II Project Design 2012
4.5.2 Xbee-PRO Digi-Mesh 2.4 Configuration Using X-CTU

Software.....32

4.5.3 Xbee-PRO Digi-Mesh 2.4 Interface with the Microcontroller, other

Xbee module and PC..34

Chapter 5 Conclusion and Senior II Plan35

5.1 Conclusion..35

5.2 Senior II Plan.... 35

5.3 Purchases Plan for Project Implementation in Senior

II.....36

5.4 Future Plan and Time Line Schedule ... 37

References...38

Appendix.....41

|Page5
Senior II Project Design 2012

Abstract

Nowadays, power consumption data collection is subject to great consideration.

Utility companies which are working in power consumption data collection projects

are trying to avoid the idea of collecting power data manually from the electricity

meters of the buildings in the urban areas. This report presents the replace design of a

wireless power consumption collection system .Our proposed system was an energy

metering integrated circuit (ADE7757) , a microcontroller (LPC2148) and a Zigbee

Transceiver (XBee-PRO Digimesh 2.4 chip).

Our Propose system offers an accurate , inexpensive and efficient solution for wireless

power consumption collection.

|Page6
Senior II Project Design 2012

( )ADE7757 ( )LPC2148

ZigBee ) . ( XBee-PRO Digimesh 2.4

|Page7
Senior II Project Design 2012

List of Figures

Figure 1.1 General Description of the Project................................................3

Figure 2.1 Single-Phase Watt-Hour Meter Based on the ADE7757 ........6

Figure 2.2 Signal Processing Block Diagram .......7

Figure 2.3 Power Signals in Case of unity power factor condition ...8

Figure 2.4 Power Signals in case of having a displacement in power factor =

0.5...8

Figure 2.5 Attenuation Network .....10

Figure 3.1 Block diagram of LPC2148....13

Figure 3.2 Pining information..14

Figure 3.3 LPC214x Evaluation Board.......17

Figure 3.4 Olimex ARM-USB-OCD..........18

Figure 4.1 ZigBee protocol stack ....24

Figure 4.2 Point-to-Point wireless Communication topology.26

Figure 4.3 Multiple Access Problem..27

Figure 4.4 Xbee PRO DigiMesh 2.4 parameter setting .31

Figure 4.5 Xbee PRO DigiMesh 2.4 settings test ..32

|Page8
Senior II Project Design 2012

List of Tables

Table 2.1 F14 Frequency Selection.......9

Table 5.1 Project Component Prices34

Table 5.2 Time Line of Senior II plan.35

|Page9
Senior II Project Design 2012

List of Terms

ADC Analog to digital converter

ARM Advanced Risc Machine

ARM7TDMI ARM7+Thumb+Debug+Multiplier+ICE

CCR Capture Control Register

CF Calibration Frequency

FDMA Frequency Division Multiple Access

FDMA Frequency Division Multiple Access

FIFO First In First Out

FIQ Fast Interrupt reQuest

GPIO General Purpose Input/Output

I2C Inter-Integrated Circuit

IC Integrated Circuit

IDE Integrated Development Environment

IEEE Institute of Electrical and Electronics Engineers

IP Instruction Pointer

IRQ Vector Interrupt reQuest

ISR Interrupt Service Routine

IVT Interrupt Vector Table

LCD Liquid Crystal Display

LPF Low Pass Filter

MCU Microcontroller Unit

PCLK Peripheral Clock

RISC Reduced Instruction Set Computing

| P a g e 10
Senior II Project Design 2012
RTC Real Time Clock

SPI Serial Peripheral Interface

TDMA Time Division Multiple Access

UART Universal Asynchronies Reciver/Transmitter

USB Universal Serial Bus

VIC Vector Interrupt Controller

WiFi Wireless Fidelity

ZC ZigBee Coordinator

ZED ZigBee End Device

ZR ZigBee Router

| P a g e 11
Senior II Project Design 2012

List of Symbols

P Power

V Voltage

I Currant

Freq Frequency

T Time

| P a g e 12
Senior II Project Design 2012

Chapter 1
Introduction
1.1 Scope
There is a high demand for an accurate way to collect power consumption data

from meters. We select an inexpensive, fast and accurate wireless power consumption

data collection technique [1] that is based on using digital electricity meter and ZigBee

network to transfer data from the meter to the collector who passes through the building

by vehicle. The collector gets the meter's readings wirelessly from the buildings while

he is driving. Our system design based on using energy metering IC MCP3905,

PIC16F877A microcontroller and XBee-PRO DigiMesh 2.4 modules.

1.2 Motivation of this Senior Project


Manual power consumption data collection technique has many disadvantages

that may affect the resident's convenience and privacy because it depends on a person

that goes to each building and takes the reading. Most of the time, the collector needs

to go inside houses and buildings, that may causes an inconvenience and disturbance to

the people who live in the houses or the buildings. In addition, manual power

consumption data collection may cause a delay in billing and data collection. For

example, when there is no one in the house, the collector needs to come again to take

the reading. Moreover, human errors may arise when the collector takes the reading

from the meter. She/he may miss a reading or confusion between two meters' readings

may occur.

| P a g e 13
Senior II Project Design 2012
This project presents some solutions to the disadvantages of manual power

consumption data collection techniques mentioned above. In this project, digital power

meter is used to measure the power instead of electromechanical meter so that the

readings will be accurate. Moreover, the power consumption data will be sent

automatically through a ZigBee network to the collector while she/he is driving which

ensures the residents privacy and convenience. Getting the readings automatically from

the meter saves the time used in collecting data and improves the billing system.

1.3 Project Objectives


1. Design a smart power consumption data collection model that increases the time

efficiency, cost efficiency, accuracy and flexibility of power consumption data

collection system.

2. Understand the idea of measuring power using digital meter.

3. Use MCP3905 metering IC to calculate the power of a simple load (light bulb) to

represent measuring power process in the real life.

4. Understand the idea of processing data using PIC16F877A microcontroller.

5. Be aware of different kinds of serial interface such as USB, UART and SPI.

6. Understand ZigBee technology, its features, specifications and advantages.

7. Use XBee-PRO DigiMesh 2.4 chips to build a simple ZigBee network that

represents the network between a ZigBee transmitter attached to the digital meter

at home and the ZigBee receiver in the collector's car.

8. Study point-to-point topology to apply it in the ZigBee network between the ZigBee

transmitter and receiver.

9. Gain research skills like time management, working as a team, critical thinking and

documentation.

| P a g e 14
Senior II Project Design 2012

1.4 Project Description

Xbee Pro 2.4


DigiMesh
Database Computer ZigBee Rx

ZigBee
Network

Xbee Pro 2.4


PIC P-40 DigiMesh
Load MCP3905 Eval. Board ZigBee Tx

Fig 1.1 General description about the project

An AC light bulb is used as a load to measure its power (power consumption

environment model). The AC light bulb will be connected to MCP3905 Energy

Metering IC through the input pins (CH0+, CH0-, CH1+ and CH1-). MCP3905 chip

calculates that power that is consumed by the load. PIC16F877A microcontroller

manipulates the data to find the . Then the result is sent to a ZigBee transmitter module

(XBee-PRO DigiMesh 2.4) using UART cable which is RS-232(The same concept as

the transmitter ZigBee module that is attached to the meter at home) .The transmitter

| P a g e 15
Senior II Project Design 2012
ZigBee module sends the data wirelessly to the a ZigBee receiver module ( The same

concept as the receiver ZigBee module in the collector's car). The receiver Zigbee

module is connected through a USB cable to store power consumption data in a

database.

| P a g e 16
Senior II Project Design 2012

Power Measurements
This chapter focuses on the principle of obtaining the current and the voltage

values from the load to calculate the real power information. Also it discusses the use

of MCP3905 metering IC which is built-in an evaluation board in calculating the value

of average real power.

2.1 Overview about MCP3905 Energy Metering IC


MCP3905 is a chip that has inputs CH0 and CH1 for fully differential analog

voltages for current and voltage measurements, and produce square signal as an output

with frequency that is proportional to the average real power [1]. MCP3905 is

manufactured by Microchip Company, one of the well-known companies in producing

Microcontrollers and semiconductors [4] Moreover, MCP3905 features supports the

precision requirements given by IEC (International Electro technical Commission)

1036/61036/687 standards. Also 1036/61036/687 Specifications has easy and stable

calibration feature [1].

2.2 Power Measurement Inputs of MCP3905

MCP3905 chip provides two channels to calculate the average real power. The

two channels are channel0 and channel1; channel0 is for the current coming from the

load and channel1 is for the voltage of the load. For each channel there is two analog

fully differential input pair: CH0+ (positive input) and CH0- (negative input) are belong

to channel0, while CH1+ and CH1- are belong to channel 1.The voltage of the signal

at CH0+ and CH0- should not be greater than 470 mV with respect to AGND and the

voltage of the signal at CH1+ , CH1- should not be greater than 660 mV with respect

to AGND and as a fully differential input signal [1].


| P a g e 17
Senior II Project Design 2012
In order to obtain the current from the load, there should be a shunt resistor connected

in series with the load which provides the current-to-voltage-conversion needed by the

MCP3905 chip . The shunt resistor value should be chosen properly depending on some

factors such as power dissipation in the shunt, the thermal management consideration

and shunt quality and tampering consideration. The value of the shunt should be small

to minimize the power dissipation in order to control the thermal values . Also the

resistance of the shunt should be as close as possible to the used wire resistance to

minimize the effect of any attempt to divert the current using an external wire [2]. The

shunt resistance value should not be too small so that it meets the accuracy requirements

at light loads. The voltage will be derived by connecting the CH1 to a potentiometer

and then to the load. The potentiometer is responsible for calibrating the output by

changing the input signal amplitude [3]. The functional block diagram of the MCP3905

shown in figure 2.1.

Fig 2.1 Functional Block Diagram of MCP3905 [1]

| P a g e 18
Senior II Project Design 2012

2.3 Power Measurement Outputs of MCP3905


2.3.1 Frequency Selection of MCP3905

F0, F1 and F2 are three input pins in MCP3905 that are used to control

the output frequency FOUT1, FOUT and HFOUT.

2.3.2 Frequency of MCP3905 Outputs

There are two main outputs from the MCP3905

1- The low frequency logics output which are Fout1 and Fout2.

2- The calibration frequency output (HFOUT)

- Fout1 and Fout2 (low frequency):

The average real power information is obtained from the pulses that go out of

FOUT1 and FOUT2. Before signal goes to output pin, it goes through a digital-to -

frequency converter and then low frequency pulses go out of the chip through FOUT1

and FOUT2 [1]. The following equation relates the input voltages with the output

frequency:

(2.1)

Where:

V0 = the RMS differential voltage on Channel 0

V1 = the RMS differential voltage on Channel 1

G= the PGA gain on Channel 0 (current channel)

FC = the frequency constant selected

VREF= the voltage reference

| P a g e 19
Senior II Project Design 2012
The voltage of the line is obtained from equation (2.2),so that the meter is simply

calibrated by attenuating the line voltage to the Value that we will be obtained from

the equation. Figure (2.2) shows the attenuation network [2] .

Fig 2.2 Resistor Divider Calibration [2]

- HFOUT (calibration frequency):

HFOUT is used to speed up the calibration of meter. Also it has a high frequency

that is equal to the instantaneous real power, so that pulses accumulated over short

period of time [1] . The frequency of HFOUT is calculated as it's given in the following

equation:

(2.2)

Where:

V0 = the RMS differential voltage on Channel 0

V1 = the RMS differential voltage on Channel 1

G= the PGA gain on Channel 0 (current channel)

HFC = the frequency constant selected

VREF= the voltage reference

| P a g e 20
Senior II Project Design 2012

2.4 MCP3905 Interface with The Microcontroller


The digital output of MCP3905 through Fout1 and Fout2 are square signal with

a frequency proportional to the value of the average real power. These pulses go as an

input in Microcontroller Unit (MCU). The microcontroller calculates the average real

power depending on the frequency of the signal and the pulse width as discussed in

chapter 3.

2.5 Implementation and Connection of MCP3905

with the Microcontroller and the Load


As mentioned above the first part of this project is to calculate the average real

power from the load using MCP3905 and the Microcontroller as shown in figure 2.3.

In our project we use MCP30905 Evaluation Board for more information refer to

appendix 1[3]. This evaluation board has built-in MCP3905 chip.

Fig 2.3 the components that are needed to calculate the average real power

| P a g e 21
Senior II Project Design 2012

2.5.1 Overview about the MCP3905 Evaluation

Board
The MCP3905 evaluation board has an input prototype area and output

prototype area that provide easy connection with the load and with microcontroller .In

the input area there is high voltage AC input line and load connection .Also there is a

space for the shunt or current transformer for current to voltage conversion in channel

0 .In the middle of the bored there are a set of jumpers , LED and resisters connected

to the MCP3905 to provides different functions .At the output area there is the PIC tail

daughter board header to provides a connection with the microcontroller[3] .

Fig 2.4 MCP3905/6 Evaluation Board [3]

| P a g e 22
Senior II Project Design 2012

2.5.2 The Connection of The Load and The

Microcontroller with The MCP3905 Evaluation

Board in the Project


First we set the current sensor element ( shunt resistor ) that should be used by

two screws. The shunt resistor here is (250 ) .

The shunt
(250)

Fig2.5 The connection of the shunt with evaluation board

The desired input and output channels are set and chosen using the jumpers in

the board as shown in figure 2.6.

The output
jumpers

Channel0 and
Channel1
jumpers

Frequency
constant
jumpers

Fig 2.6 Jumpers selection

| P a g e 23
Senior II Project Design 2012
We connect the line (220 V) and some loads that have power between 15W and

100W to the input prototype.

Fig2.7 The input prototype Area connection with loads and power supply

We connect the evaluation board with the microcontroller from the pin RC0 in

the evaluation board to RB0 in the microcontroller [3].

Fig 2.8 RC0 pin in the output prototype Area

| P a g e 24
Senior II Project Design 2012

Chapter 3
Power Information Processing
3.1 Introduction

As mentioned earlier, the average real power is proportional the frequency of

the square signal that goes as an output from the MCP3905 Evaluation Board, so the

average real power will be inversely proportional to the pulse width [1]. In order to

obtain the value of the average real power consumed by the load, we use a

microcontroller to calculate the pulse width of the output square signal of MCP3905

Evaluation Board. Also we use the microcontroller to transmit the value of the

consumed power through the Zigbee network.

3.2 Components used in calculating the average real

power.

We use the microcontroller PIC16F877A (figure 3.1) to calculate the pulse

width of the square signal that comes as an output of MCP3905 evaluation board.

PIC16F877A chip is put in a PIC-P40 development board which supplies a lot of

functions that are need in our project such as serial communication port RS232, bin TX

to set the microcontroller as a transmitter and ICSP connector to connect the

microcontroller to the computer through a programmer to program the microcontroller

as shown in figure3.2 [5]. Figure3.3shows the parts of PIC-P40 development board that

are useful in this project.

| P a g e 25
Senior II Project Design 2012

Fig 3.1 PIC16F877A pin diagram [4] Fig 3.2 PICkit2 programmer [5]

ICSP
RS232

TX pin
PIC16F877A base

Fig 3.3 PIC-P40 development board and the used components in this project [6]

We also use LCD (fig 3.4) to show the value of the average real power that

the microcontroller computes.

Fig 3.4 LCD to show the results of microcontroller calculation

| P a g e 26
Senior II Project Design 2012
We program the microcontroller using C language by PIC C compiler. Its a smart

compiler that has huge libraries that are designed for PIC registers. [6]

3.3 The idea and the algorithm of calculating the

average real power.

MCP3905 produces a square signal with a frequency proportional to the value

of the average real power consumed by the load and inversely proportional to the pulse

width.[1] The task of the microcontroller PIC16F877A is to calculate the pulse width

of the square signal and calculate the average real power according to equation 3.1 and

send this value to the Zigbee network. We derive equation 3.3 experimentally (as will

be discussed in section 3.5) so that there is a possibility of small percentage of error.

The idea of finding the pulse width depends on capturing the falling edges of the signal.

= 15331( )0.846 watt (3.1)

So the task of PIC16F877A is to count the time between two falling edges. In

order to calculate the time between two falling edges; the interrupt function is used. In

our project we use internal and external interrupts. External interrupt is used to

capture each falling edge and internal interrupt is used as a clock to count the number

of seconds. The internal interrupt is generated by timer 0 in PIC16F877A. Figure 3.5

shows the operation of capturing the falling edges by external interrupt while the

internal interrupt is being generated continuously each 896 microseconds to measure

the actual time. We connect RC0 (the output pin) from MCP3905 Evaluation Board to

RB0 in PIC16F877A microcontroller because RB0 is one of the pins that are able to

generate external interrupt on the input signal [4].

| P a g e 27
Senior II Project Design 2012

896 s 1792 s2688 s3584 s


Seconds
counting
falling edges
by internal
captures
interrupt
( done by external
Timer0
interrupt )

Fig 3.5 capturing the rising or falling edges by external interrupt and counting the number of seconds by internal

interrupt

The idea of getting the value of the pulse width by PIC16F877A is briefly as

follows: when the square signal enters the microcontroller through RB0 pin; an

external interrupt is generated each time there is a falling edge.. In parallel with the

previous process, there is a variable that accumulate the number of milliseconds each

time there is an internal interrupt till the next falling edge ( one cycle is completed ).

The value of the time variable now contains the pulse width value. The

microcontroller calculate the power according to equation 3.1 and displays the power

on the LCD . The code of the algorithm is in the appendices

| P a g e 28
Senior II Project Design 2012

3.4 Pins Connections

From RB0 in the microcontroller to RC0 in the MCP3905


evaluation board

LCD connections +5V from the MCP3905 evaluation board


to VDD Pin in the microcontroller.
GND connected to the GND in the MCP3905 Evaluation
Board

(a)

(c)

Fig 3.6 Microcontroller's pins connections

| P a g e 29
Senior II Project Design 2012

3.5 Results
In order to extract the relationship between the average real power consumed by a

load to the pulse width of the square signal that goes as an output from MCP3905

evaluation board. We test the project with variety of loads with different power values

and we observe the change in pulse width. Fig 3.7 shows the relation between the

power and the pulse width. Table 3.1 shows the result of testing the code on different

bulbs.

250

200

Load's Power (Watt)


150
y = 15331x-0.846

100

50

0
800 700 600 500 400 300 200 100 0
Pulse Width (ms)

Fig 3.7 The relation between the power and the pulse width

Table 3.1 pulse width readings and power values

Pulse width
Actual power Experimental value of the power (y) (watt)
(x)(ms)
60 711 59.27735
75 558 72.7642
90 453 86.79833

| P a g e 30
Senior II Project Design 2012
115 301 122.66007
160 208 167.68294
175 200 173.34012

Chapter 4
Transferring Power Consumption
Data Using ZigBee Communication

4.1 Introduction
This Chapter discusses the topology of ZigBee network that power consumption

data are transferred through. ZigBee communication has many features that make

transferring data between the customer and the base station easy and flexible as it will

be discussed in section 4.2. In this chapter we explains the use of point- to -point

wireless communication topology in this project and the configuration steps of Xbee

PRO digi-mesh 2.4 modules.

4.2 Overview about ZigBee Communication


There are many reasons that encourage us to use Zigbee technique as a

medium of the communication environment. ZigBee technology is a wireless

communication protocol based on an IEEE 802 standard for personal area networks that

invented after WIFI and Bluetooth .It is widely used in applications that require low

data rate and short-range wireless. ZigBee networks require low power consummation

and have a rate of 250 kbps. ZigBee node can go to sleep for a very short time (30ms)

when it's not sending or receiving data which decreases the power consumption and

| P a g e 31
Senior II Project Design 2012
increases the battery life. Using ZigBee technology ensures secure data transmission

and receiving. Also ZigBee network can consist of more number of nodes comparing

to Bluetooth networks [7] .

4.2.1 Technical overview

ZigBee is a wireless network that supports both star and tree typical networks,

therefore, one of the node in the ZigBee may work as a coordinator to control the

network and the routing.

As any network, ZigBee network consists of couple of layers and each layer serves the

higher layer. ZigBee layers are divided to four layers according to ZigBee

specifications and IEEE standards 802.15.4 . The four layers are : application layer ,

network layer, physical layer and medium access control layer as shown in Fig 4.1 [7]

Fig4.1 The ZigBee protocol stack [7]

| P a g e 32
Senior II Project Design 2012

4.2.2 ZigBee Nodes Types

ZigBee receiver or transmitter can be programmed to perform different

tasks depending on its location in the network and its application [7] :

ZigBee coordinator (ZC): The brain of the network. It is responsible for

managing the routing ,ensuring network security and storing information

about the network .

ZigBee Router (ZR): It work as a midpoint between the node and it extends

the network range.

ZigBee End Device (ZED): The final destination of the network where the

data is collected and it is called (the receiver).

| P a g e 33
Senior II Project Design 2012

4.3 ZigBee Network Topology

Compu
ter +
ZigBee
Digital
Meter +
ZigBee Tx

Fig 4.2 Point-to-point wireless communication topology

After the microcontroller PIC16F877A obtains the power consumption

information from the power measuring chip MCP3905 and manipulating it sets the

UART port to transmit the data to the ZigBee transmitter module (Xbee PRO digi-

mesh 2.4) through Rs-232 cable.

A mobile data collector (a collector in a car) collects the data using ZigBee

receiver module (Xbee PRO digi-mesh 2.4) and stores them in a database in a PC

that is connected to Xbee PRO digi-mesh 2.4 through UART-USB cable .

As shown in Fig (4.2) we use a point-to-point topology to transmit data to

achieve reliable data transmission. Point-to-point topology is the simplest network

topology among all other topologies [8].

We use Point-to-Point network because it has some advantages such as: it has

the most inexpensive architecture since it needs only two nodes and it doesn't require

| P a g e 34
Senior II Project Design 2012
any external nodes to be added in between. The only disadvantage of this choice is the

limitation of the number of used nodes. [8]

4.4 Overview about Xbee-PRO digi-mesh 2.4

Xbee PRO digi-mesh 2.4 is a ZigBee module manufactured by Digi

International which established in 1985 [11] that produce a variety of products that

support many areas like embedded system products , wireless communications and

integrated circuits .

Xbee PRO digi-mesh 2.4 module meets the requirements of low cost and low power

consumption of ZigBee network design such as sleep mode and it's easy to be used

since it has no configuration to be done just few simple commands to start

implementation .

Also one of the main features in Xbee-PRO module that it provides a long data range

extension , which leads to obtain accurate data delivery about 250,000 bps thats work

within the range of 2.4 GHz frequency , and it has up to 90 m coverage of indoor

areas and about 1600 m coverage for outdoor areas [9] .

| P a g e 35
Senior II Project Design 2012

4.5 XBee-PRO DigiMesh 2.4 Configuration and

Implementations

There are some pre-setting that we follow to configure XBee-PRO

DigiMesh2.4 before configuring the two Xbee chips in the project communication part.

4.5.1 XBee-PRO DigiMesh 2.4 Configuration


Requirements
The configuration process requirements are:

XBee-PRO DigiMesh 2.4 modules.

Kit starter xbee pro xbp24 dks rf if and rfid contains XBee Boards, Modules,

Adapters, Battery Clip, Cables. ( available in www.digikey.com)

PC with windows as operating system.

X-CTU software.

4.5.2 XBee-PRO DigiMesh 2.4 Configuration Using


X-CTU Software
In order to set the parameters of XBee-PRO DigiMesh 2.4 chip such as

addressing values, accepted frequencies, timing etcwe connect the two modules to a PC

with windows operating system through a USB cable .The main target here is to set

the parameters of both Xbee modules in order to communicate with each other and

start sending and receiving data [12] .

To perform test process : we choose USB serial Port in X-CTU window. Then

choose Test/Query button. Its also preferable to check for any new updates of the

firmware by clicking on the Modem Configuration. Then click on the download new

| P a g e 36
Senior II Project Design 2012
versions. Secondly, we click on read button to see and configure XBee-PRO DigiMesh

2.4 parameters as shown in Figure 4.4.

Fig 4.3 XBee-PRO DigiMesh 2.4 parameters setting

To setup a point-to-pint network , three main parameters should be taken in

consideration which is the PAN ID , the value of the Baud Rate and the Addressing

between the two modules . [9]

First of all ,PAN ID consist of 4 hex digits which will be used by the

transmitter and the receiver to recognize which network they communicating through

, so they should be matched in both modules [10] . as shown in Figure 4.5

| P a g e 37
Senior II Project Design 2012

Fig 4.4 XBee PAN ID setting

The Baud Rate value will be chosen according to the application, so we scroll

down the list and choose the appropriate value as shown in Figure 4.6[10] .

Fig 4.5 XBee Baud Rate setting

Third , Setting the addresses between the Xbee modules should be compatible

, suppose Xbee modules are A transmitter and B receiver - , so the source

address of chip B should be the destination address of chip A and vice versa[10] .

| P a g e 38
Senior II Project Design 2012

4.5.3 XBee-PRO DigiMesh 2.4 Interface with the


Microcontroller, Other XBee modules and PC
and Testing [11]
XBee-PRO DigiMesh 2.4 can work as a transmitter for the data from PIC

microcontroller through UART cable in the programmed Xbee board .Using three main

pins 5V, Ground and RC7 RX_pin . By default, the received data will be sent to the

second XBee-PRO DigiMesh 2.4 chip through Xbee USB-board Figure 4.7, which will

sent the data to the PC .

Now , Both Xbees are ready to communicate with each other and to test this

point-to- point channel , we should open TERMINAL tab in X-CTU software then type

whatever you want to send for example : Hello World ! as shown in Figure 4.7 the

character are in blue followed by red character transmitted and received character

respectively -.

Fig 4.6 XBee USB board [14]

| P a g e 39
Senior II Project Design 2012

Fig 4.7 X-CTU Terminal test

By doing the previous steps. The microcontroller now is read to communicate with the
PC [13].

| P a g e 40
Senior II Project Design 2012

Chapter 5
Conclusion and Senior II Plan
5.1 Conclusion

In this project we have presented a convenient design to obtain power

consumption data from a meter without any human interference and with high accuracy

by avoiding billing errors. Also with Automatic Meter Reading this process is fast ,

efficient and inexpensive .The project can be modified in future so that a feedback from

the microcontroller at the collector side can do a certain action depending on the power

consumption reading state , for example if the consumer exceeds the limits a message

can be sent to be as warning .

| P a g e 41
Senior II Project Design 2012

5.2 Project Cost

While working on this project we were looking for compatible prices for all

components and devices. Therefore, we select the appropriate items after studying

prices in the market and compare them to each other, then we chose them according to

their quality and price. The following table shows a detailed information about the total

costs of this project .

Table 5.1 Detailed Description of the Project Budget

No. Quantity Item Description Price

1 1 MPC3905 Energy Meter Evaluation Board 496.84 Dhs


2 1 Olimex PIC-P40 Board 136.38 Dhs
3 1 PIC 16F877A MCU 40.82 Dhs
4 1 Power Tip Device PC1602 LCD 39.31Dhs.
5 1 PIC-KIT2 Programmer 227.60 Dhs
6 8 Loads with different power 30 Dhs
7 2 Xbee-PRO DigiMesh 2.4 GHz wire antenna 2x 117.76 Dhs = 235.52 Dhs
8 1 RS-232 Xbee-PRO interface board 257 Dhs
9 1 USB Xbee-PRO interface board 257 Dhs
10 2 Power Supply 2x 20 Dhs = 40 Dhs
11 - Loads and holders 40 Dhs
12 1 LCD 40
Total Price 1800.47 Dhs

| P a g e 42
Senior II Project Design 2012

5.3 Challenges and Suggestions

At the end of this project there were a lot of challenges that we faced during this

year. These challenges led to a delay in the design and implementation and sometimes

they led to the re-payment of some components. the list below discusses the main

difficulties that we faced and how we overcome it :

1- In seniorI, we decided to use LPC2148 Microcontroller but we faced a difficulty

in using this device, because it is very high-level product, the compilers of this

microcontroller are complicated. So we decided to use PIC 16F877A

microcontroller which was easier , more flexible and has a lot of online tutorials

that guide us in programming and implementing the MCU.

2- In seniorI we chose to use ADE7757but we found that the metering chip

ADE7757 was so tiny so that we cannot connect it to a circuit. As an alternative

solution, we purchased another metering chip which is MPC3905 chip. We

found this chip built-in an Evaluation Board so the implementation become

easy .

3- We faced a difficulty in setting the Xbee module, and we tried different types

of these modules. One of modules is not working and the distributer didn't give

us any supply.

| P a g e 43
Senior II Project Design 2012
Based on the difficulties and the challenges mentioned above, we would like to

propose some suggestions that might reduce these problems to our colleagues who are

going to work on their senior design projects and student who will work in this field.

1- The data sheets should be read carefully before deciding buying any device.

2- We recommend not depending on any supplier without making sure that the

supplier is dependable and authorized.

3- This project is a power project, so that the researcher should be careful while

working on implementation.

4- Researchers should ask for assistance from laboratory expert to ensure the

safety and quality.

| P a g e 44

You might also like