Académique Documents
Professionnel Documents
Culture Documents
PROJECT REPORT ON
Wireless Energy Meter Reading using X-Bee.
Page 1
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Chapter 1
Introduction
Wireless communication is the transfer of information between two or more points that
are not connected by an electrical conductor.
The most common wireless technologies use radio. With radio waves distances can be
short, such as a few meters for television or as far as thousands or even millions of
kilometers for deep-space radio communications. It encompasses various types of fixed,
mobile, and portable applications, including two-way radios, cellular telephones,
personal digital assistants (PDAs), and wireless networking. Other examples of
applications of radio wireless technology include GPS units, garage door openers,
wireless computer mice, keyboards and headsets, headphones, radio receivers, satellite
television, broadcast television and cordless telephones.
Page 2
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Somewhat less common methods of achieving wireless communications include the use
of other electromagnetic wireless technologies, such as light, magnetic, or electric fields
or the use of sound.
Wireless operations permit services, such as long-range communications, that are
impossible or impractical to implement with the use of wires. The term is commonly
used in the telecommunications industry to refer to telecommunications systems (e.g.
radio transmitters and receivers, remote controls etc.) which use some form of energy
(e.g. radio waves, acoustic energy, etc.) to transfer information without the use of wires.
Information is transferred in this manner over both short and long distances.
The world's first wireless telephone conversation occurred in 1880, when Alexander
Graham Bell and Charles Sumner Tainter invented and patented the photophone, a
telephone that conducted audio conversations wirelessly over modulated light beams
(which are narrow projections of electromagnetic waves). In that distant era, when
utilities did not yet exist to provide electricity and lasers had not even been imagined in
science fiction, there were no practical applications for their invention, which was
highly limited by the availability of both sunlight and good weather. Similar to freespace optical communication, the photophone also required a clear line of sight
between its transmitter and its receiver. It would be several decades before the
photophone's principles
in
military
Page 3
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Fig | Xbee
Two models were initially introduceda lower cost 1 mW XBee and the higher power
100 mW XBee-PRO. Since the initial introduction, a number of new XBee radios have
been introduced and all XBees are now marketed and sold under the Digi brand.
Page 4
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
The XBee radios can all be used with the minimum four number of connections power
(3.3 V), ground, data in and data out (UART), with other recommended lines being Reset
and Sleep. Additionally, most XBee families have some other flow control, I/O, A/D and
indicator lines built in. A version of the XBees called the programmable XBee has an
additional onboard processor for users code. The programmable XBee and a new
surface mount (SMT) version of the XBee radios were both introduced in 2010.
XBee Modules are available in two form-factors; Through-Hole and Surface Mount. All
XBees (with the exception of the XBee 868LP) are available in the popular 20-pin
Through-Hole form-factor. Certain XBee modules are also available in a 37-pad Surface
Mount design, which is popular for higher volume applications due to the reduced
manufacturing costs of SMT technology.
XBee Modules typically come with several antenna options, including U.FL, PCB
Embedded, Wire, and RPSMA.
The XBees can operate either in a transparent data mode or in a packet-based
application programming interface (API) mode. In the transparent mode, data coming
into the Data IN (DIN) pin is directly transmitted over-the-air to the intended receiving
radios without any modification. Incoming packets can either be directly addressed to
one target (point-to-point) or broadcast to multiple targets (star). This mode is
primarily used in instances where an existing protocol cannot tolerate changes to the
data format. AT commands are used to control the radios settings. In API mode the data
is wrapped in a packet structure that allows for addressing, parameter setting and
packet delivery feedback, including remote sensing and control of digital I/O and analog
input pins.
Page 5
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Chapter 2
Objective
The objective of the project is to display the energy meter to display energy meter
reading on a remote control. The project has constructed in to two parts. One is
transmitter that will be connected to energy meter. The job of this transmitter to read
the reading, it reads reading shows on LCD panel and transmits these reading. The
communication medium for wireless communication is Xbee, that is elaborated in
introduction part.
On the receiver end the remote system receives signal from transmitter and shows
these on the LCD panel.
Page 6
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Chapter 3
Methodology
The following block diagram explains working of the system, later we shall discuss all of
the components of the diagram.
Page 7
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Chapter 4
Programming of hardware controller
This chapter elaborate the programming of hardware controller.
Page 8
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Modern embedded systems are often based on microcontrollers (i.e CPUs with
integrated memory and/or peripheral interfaces) but ordinary microprocessors (using
external chips for memory and peripheral interface circuits) are also still common,
especially in more complex systems. In either case, the processor(s) used may be types
ranging from rather general purpose to very specialised in certain class of
computations, or even custom designed for the application at hand. A common standard
class of dedicated processors is the digital signal processor (DSP).
The key characteristic, however, is being dedicated to handle a particular task. Since the
embedded system is dedicated to specific tasks, design engineers can optimize it to
reduce the size and cost of the product and increase the reliability and performance.
Some embedded systems are mass-produced, benefiting from economies of scale.
Physically, embedded systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, and
largely complex systems like hybrid vehicles, MRI, and avionics. Complexity varies from
low, with a single microcontroller chip, to very high with multiple units, peripherals and
networks mounted inside a large chassis or enclosure.
Embedded systems are commonly found in consumer, cooking, industrial, automotive,
medical, commercial and military applications.
Page 9
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
audio/visual, surveillance, etc., all of which use embedded devices for sensing and
controlling.
Page 10
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 11
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Chapter 5
The parts & Interfacing
Following are the parts of the project.
Page 12
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
periods and off-peak, lower-cost, periods. Also, in some areas meters have relays for
demand response load shedding during peak load periods.
As commercial use of electric energy spread in the 1880s, it became increasingly
important that an electric energy meter, similar to the then existing gas meters, was
required to properly bill customers for the cost of energy, instead of billing for a fixed
number of lamps per month. Many experimental types of meter were developed. Edison
at first worked on a DC electromechanical meter with a direct reading register, but
instead developed an electrochemical metering system, which used an electrolytic cell
to totalise current consumption. At periodic intervals the plates were removed,
weighed, and the customer billed. The electrochemical meter was labor-intensive to
read and not well received by customers.
An early type of electrochemical meter used in the United Kingdom was the 'Reason'
meter. This consisted of a vertically mounted glass structure with a mercury reservoir
at the top of the meter. As current was drawn from the supply, electrochemical action
transferred the mercury to the bottom of the column. Like all other DC meters, it
recorded ampere-hours. Once the mercury pool was exhausted, the meter became an
open circuit. It was therefore necessary for the consumer to pay for a further supply of
electricity, whereupon, the supplier's agent would unlock the meter from its mounting
and invert it restoring the mercury to the reservoir and the supply.
In 1885 Ferranti offered a mercury motor meter with a register similar to gas meters;
this had the advantage that the consumer could easily read the meter and verify
consumption. The first accurate, recording electricity consumption meter was a DC
meter by Dr Hermann Aron, who patented it in 1883. Hugo Hirst of the British General
Electric Company introduced it commercially into Great Britain from 1888.[3] Unlike
their AC counterparts, DC meters did not measure energy. Instead they measured
charge in ampere-hours. Since the voltage of the supply should remain substantially
constant, the reading of the meter was proportional to actual energy consumed. For
example: if a meter recorded that 100 ampere-hours had been consumed on a 200 volt
supply, then 20 kilowatt-hours of energy had been supplied. Aron's meter recorded the
total charge used over time, and showed it on a series of clock dials.
Page 13
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
The first specimen of the AC kilowatt-hour meter produced on the basis of Hungarian
Ott Blthy's patent and named after him was presented by the Ganz Works at the
Frankfurt Fair in the autumn of 1889, and the first induction kilowatt-hour meter was
already marketed by the factory at the end of the same year. These were the first
alternating-current watt-hour meters, known by the name of Blthy-meters. The AC
kilowatt hour meters used at present operate on the same principle as Blthy's original
invention. Also around 1889, Elihu Thomson of the American General Electric company
developed a recording watt meter (watt-hour meter) based on an ironless commutator
motor. This meter overcame the disadvantages of the electrochemical type and could
operate on either alternating or direct current.
In 1894 Oliver Shallenberger of the Westinghouse Electric Corporation applied the
induction principle previously used only in AC ampere-hour meters to produce a watthour meter of the modern electromechanical form, using an induction disk whose
rotational speed was made proportional to the power in the circuit. The Blthy meter
was similar to Shallenberger and Thomson meter in that they are two-phase motor
meter. Although the induction meter would only work on alternating current, it
eliminated the delicate and troublesome commutator of the Thomson design.
Shallenberger fell ill and was unable to refine his initial large and heavy design,
although he did also develop a polyphase version.
5.2 Energy Meter Reading
The most common unit of measurement on the electricity meter is the kilowatt hour
[kWh], which is equal to the amount of energy used by a load of one kilowatt over a
period of one hour, or 3,600,000 joules. Some electricity companies use the SI
megajoule instead.
Demand is normally measured in watts, but averaged over a period, most often a
quarter or half hour.
Reactive power is measured in "thousands of volt-ampere reactive-hours", (kvarh). By
convention, a "lagging" or inductive load, such as a motor, will have positive reactive
power. A "leading", or capacitive load, will have negative reactive power.
Page 14
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 15
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 16
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
mechanism which counts revolutions, much like the odometer in a car, in order to
render a measurement of the total energy used.
The type of meter described above is used on a single-phase AC supply. Different phase
configurations use additional voltage and current coils.
Three-phase electromechanical induction meter, metering 100 A 240/415 V supply.
Horizontal aluminum rotor disc is visible in center of meter
The disc is supported by a spindle which has a worm gear which drives the register. The
register is a series of dials which record the amount of energy used. The dials may be of
the cyclometer type, an odometer-like display that is easy to read where for each dial a
single digit is shown through a window in the face of the meter, or of the pointer type
where a pointer indicates each digit. With the dial pointer type, adjacent pointers
generally rotate in opposite directions due to the gearing mechanism.
The amount of energy represented by one revolution of the disc is denoted by the
symbol Kh which is given in units of watt-hours per revolution. The value 7.2 is
commonly seen. Using the value of Kh one can determine their power consumption at
any given time by timing the disc with a stopwatch.
P = {{3600 \cdot Kh } \over t}.
Where:
t = time in seconds taken by the disc to complete one revolution,
P = power in watts.
For example, if Kh = 7.2 as above, and one revolution took place in 14.4 seconds, the
power is 1800 watts. This method can be used to determine the power consumption of
household devices by switching them on one by one.
Page 17
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
reading may be supplied to the power company by telephone, post or over the internet.
The electricity company will normally require a visit by a company representative at
least annually in order to verify customer-supplied readings and to make a basic safety
check of the meter.
In an induction type meter, creep is a phenomenon that can adversely affect accuracy,
that occurs when the meter disc rotates continuously with potential applied and the
load terminals open circuited. A test for error due to creep is called a creep test.
Page 18
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
The processing and communication section has the responsibility of calculating the
various derived quantities from the digital values generated by the metering engine.
This also has the responsibility of communication using various protocols and interface
with other addon modules connected as slaves to it.
RTC and other add-on modules are attached as slaves to the processing and
communication section for various input/output functions. On a modern meter most if
not all of this will be implemented inside the microprocessor, such as the real time clock
(RTC), LCD controller, temperature sensor, memory and analog to digital converters.
Page 19
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 20
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 21
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 22
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 23
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
The AVR core combines a rich instruction set with 32 general purpose working
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in one single instruction executed in
one clock cycle. The resulting architecture is more code efficient while achieving
throughputs up to ten times faster than conventional CISC microcontrollers. The
ATmega16 provides the following features: 16K bytes of In-System Programmable Flash
Program memory with Read-While-Write capabilities, 512 bytes EEPROM, 1K byte
SRAM, 32 general purpose I/O lines, 32 general purpose working registers, a JTAG
interface for Boundary scan, On-chip Debugging support and programming, three
flexible Timer/Counters with compare modes, Internal and External Interrupts, a serial
programmable USART, a byte oriented Two-wire Serial Interface, an 8-channel, 10-bit
ADC with optional differential input stage with programmable gain (TQFP package
only), a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and
six software selectable power saving modes. The Idle mode stops the CPU while
allowing the USART, Two-wire interface, A/D Converter, SRAM, Timer/Counters, SPI
port, and interrupt system to continue functioning. The Power-down mode saves the
register contents but freezes the Oscillator, disabling all other chip functions until the
next External Interrupt or Hardware Reset. In Power-save mode, the Asynchronous
Timer continues to run, allowing the user to maintain a timer base while the rest of the
device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules
except Asynchronous Timer and ADC, to minimize switching noise during ADC
conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest
of the device is sleeping. This allows very fast start-up combined with low-power
consumption. In Extended Standby mode, both the main Oscillator and the
Asynchronous Timer continue to run. The device is manufactured using Atmels high
density non-volatile memory technology. The On chip ISP Flash allows the program
memory to be reprogrammed in-system through an SPI serial interface, by a
conventional non-volatile memory programmer, or by an On-chip Boot program
running on the AVR core. The boot program can use any interface to download the
application program in the Application Flash memory. Software in the Boot Flash
section will continue to run while the Application Flash section is updated, providing
true Re ad-While-Write operation. By combining an 8-bit RISC CPU with In-System SelfProgrammable Flash on a monolithic chip, the Atmel ATmega16 is a powerful
Robo India | www.roboindia.com
Page 24
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
GND: Ground.
Page 25
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
RESET: Reset Input. A low level on this pin for longer than the minimum
pulse length will generate a reset, even if the clock is not running.
AVCC: AVCC is the supply voltage pin for Port A and the A/D Converter. It
should be externally connected to VCC, even if the ADC is not used. If the
ADC is used, it should be connected to VCC through a low-pass filter.
AREF: AREF is the analog reference pin for the A/D Converter.
Page 26
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 27
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
is used to alert the receiver that a word of data is about to be sent, and to force the clock
in the receiver into synchronization with the clock in the transmitter.
Page 28
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Chapter 7
References
1. Atmega 16 data sheet.
2. USB to serial data sheet.
3. Energy meter manuals
4. Serial communication manuals of Xbee
Page 29
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Appendix 1
The codding
/*
**
* Created: 19/Mar/2014 15:48:10
* Author: acer
*/
#include <avr/io.h>
#include <util/delay.h>
#include "lcd.h"
Page 30
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
uint16_t E_data;
char digits[2];
/*Macros definition*/
#define BIT(x)
(1 << (x))
Page 31
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
UBRRL = ubrr_value;
UBRRH = (ubrr_value>>8);
*/
UCSRC=(1<<URSEL)|(3<<UCSZ0);
Page 32
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
return UDR;
}
Page 33
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
{
//Wait untill the transmitter is ready
while(!(UCSRA & (1<<UDRE)))
{
//Do nothing
}
UDR=data;
}
int main(void)
{
char check=0;
int unit_main;
char unit_decimal;
InitLCD(LS_BLINK);
USARTInit(103);
LCDClear();
LCDWriteStringXY(0,0," ENERGY METER ");
LCDWriteStringXY(0,1," READING ");
Page 34
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
_delay_ms(1000);
LCDClear();
LCDWriteStringXY(0,0,"
ON
LCDWriteStringXY(0,0,"
X-BEE
");
");
_delay_ms(1000);
SETBIT(DDRC,BIT(5));
CLEARBIT(DDRC,BIT(4));
SETBIT(PORTC,BIT(4));
LCDClear();
/**********************************/
//First Time Initialisation to erase memory block//
//keep the fuse EF C1 to avoid erasing memory block//
//save_EEPROM(20,0);
//EEPROM_write(30,0);
//EEPROM_write(40,0);
/*********************************/
int i = EEPROM_read(40);
unit_decimal = EEPROM_read(30);
unit_main = read_EEPROM(20);
LCDWriteStringXY(4,1,".");
LCDWriteStringXY(0,0," ENERGY METER ");
Page 35
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
while(1)
{
//TODO:: Please write your application code
if(
(PINC&(1<<4)) == 0 )
{
//LCDWriteStringXY(0,1,"if loop");
SETBIT(PORTC,BIT(5));
_delay_ms(200);
CLEARBIT(PORTC,BIT(5));
i++;
//LCDWriteIntXY(0,0,i,3);
EEPROM_write(40,i);
check=1;
}
if(i==32)
{
i=0;
unit_decimal ++;
EEPROM_write(30,unit_decimal);
}
if (unit_decimal == 100)
{
Page 36
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
unit_decimal = 0;
unit_main ++;
save_EEPROM(20,unit_main);
}
if(check == 1)
{
check = 0;
USARTWriteChar('*');
USART_SEND_INT(unit_main);
USART_SEND_DEC(unit_decimal);
}
LCDWriteIntXY(0,1,unit_main,4);
LCDWriteIntXY(5,1,unit_decimal,2);
LCDWriteStringXY(8,1,"KWh");
_delay_ms(10);
//LCDWriteIntXY(5,0,unit_decimal,2);
//
else
//
Page 37
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
//
LCDWriteStringXY(0,1,"else loop");
//
}
}
if(num>=0)
{
while(num)
{
digits[i]=num%10;
i++;
num=num/10;
}
Page 38
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
for(j=i;j<=2;j++)
{
digits[j]=0;
}
}
USARTWriteChar(digits[2]+48);
USARTWriteChar(digits[1]+48);
USARTWriteChar(digits[0]+48);
if(num>=0)
{
Page 39
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
while(num)
{
digits[i]=num%10;
i++;
num=num/10;
}
for(j=i;j<=1;j++)
{
digits[j]=0;
}
}
//USARTWriteChar(digits[2]+48);
USARTWriteChar(digits[1]+48);
USARTWriteChar(digits[0]+48);
Page 40
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 41
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
sei();
sei();
Page 42
ROBO INDIA | A project report on Wireless Energy Meter Reading using X-Bee
Page 43