CHAPTER 1 INTRODUCTION
1.1 OVERVIEW From the early days till today meter reading for
electricity consumption and billing is done by human operators from
houses to houses. This therefore requires a very large number of
human operators and long working hours to acquire complete data
reading and billing in a particular area. However, there may be
cases where human operators miss to bill few houses in an area or
restricted and slowed down by bad weather condition, transportation
problems, etc. Moreover human operators are very much likely to
make mistake while billing or reading a meter and sometimes the
houses electric power meter may be placed in a location where it is
not easily accessible. Again printed billing has the tendency of
being lost in the mail box or being never delivered. Day by day due
to the increasing number of residential housings and commercial
buildings, more human operators and longer working hours is needed
to complete the meter reading task which eventually increases the
energy provider operation costs for meter reading.
To achieve efficient meter reading, reduce billing error and
operation costs, an Automatic Electric Meter reading system can be
introduced with every energy meter in an area. It is an effective
means of data collection that allow substantial saving through the
reduction of meter re read, greater data accuracy, frequent
reading, improved billing and customer service, more energy
profiles and consumption trends updates and better deployment of
human resource."Electricity meter reading using GSM" implements the
emerging applications of the GSM technology. GSM is a Global system
for mobile communication (GSM) and is a wide area wireless
communications system that uses digital radio transmission to
provide voice, data, and multimedia communication services. A GSM
system coordinates the communication between mobile telephones
(mobile stations), base stations (cell sites), and switching
systems. Each GSM radio channel is 200 KHz wide channels that are
further divided into frames that hold 8 time slots. The GSM system
includes mobile telephones (mobile stations), radio towers (base
stations), and interconnection switching systems. We have selected
a particular GSM modem SIM300 for our project. The message are sent
from the mobile set that contain commands in written form which are
then processed accordingly to perform the required task. The
proposed approach for designing this system is to implement
microcontroller based control module that receives its instructions
and command from a cellular phone over the GSM network. The
microcontroller then will carry out the issued commands and then
communicate the status of a given appliance or device back to the
cellular phone. First, the sent SMS is stored and polled from the
receiver mobile station and then the required control signal is
generated and sent to the intermediate hardware that we have
designed according to the command received in form of the sent
message.1.2 OBJECTIVE OF THE PROJECTThe main objectives of the
project are:(i) To co-ordinate appliances and other devices through
Short Message Service (SMS).(ii) To efficiently receive and
transmit data via SMS.(iii) Minimize power and time wastage.(iv) To
eliminate the need of being physically present in any location for
tasks involving the operation of appliances within a
household/office.(v) To design a circuit that can automatically
switch ON and OFF the home appliance.
1.3 NEED FOR GSM BASED EB SYSTEM WITH LOAD CONTROL The present
day electricity billing (EB) system therefore requires a very large
number of human operators and long working hours to acquire
complete data reading and billing in a particular area. Inorder to
reduce the man power and to save time automation in billing system
is required. This automation is achieved by interfacing a GSM
module along with the energy meter. The GSM module is interfaced
using a microcontroller. The GSM module gets the meter reading and
it sends the current reading information to the customers mobile in
the form of SMS. The customers mobile number is to be registered
before in the GSM module. There for the billing information is sent
to the electricity distribution office and even to the user
.Therefore a lot of time is saved and man power requirement is also
reduced. Certain attempts have been made to achieve automation in
electricity billing system. Many companies came up with automatic
meter reading system with GSM and few companies came up with smart
home technologies which involve control of home appliances. Here
control of home appliances includes ON and OFF of electrical and
electronic home appliances. Our project involves both automatic
meter reading system and load control system. Therefore our project
provides billing information to the user as well as also helps the
user to control the load (home appliance).
1.4 RELATED WORKThis section provides a previous study of
related work regarding the application of SMS services in a various
fields. Some previous researches have been studied to gain more
information about current existing GSM control system that was
previously implemented. It is necessary to know and understand how
the software and hardware were used in the SMS controlled system
development. This is to ensure that the study that currently being
conducted contribute at certain level of application thus it become
more efficient and practical. Several smart home projects such as
Home Security with Messaging System , Security & Control System
, and Remote and Security Control via SMS were the three alarm
system that were designed using SMS application to securely monitor
the home condition when the owner are away or at night. A system as
suggested by messaging system triggered by SMS to the home owner to
notify the owner of any incident happened around the house such as
robbery or fire.
Meanwhile, the system developed by tan, H.G.R Lee, C.H.R Mok is
automating the power reading meter to send the energy consumed to
e-billing system at authorized office. The system works by
integrating the GSM modem that was embedded with digital kWh power
meter. It utilizes the GSM network to send power usage reading
using SMS to the authorized office. The authorized office collect
and manage the received SMS message contains the meter reading to
generate the billing cost and send back the cost to the respective
consumer through SMS. The work presented by mohd helmy is about the
development of Integrated Water Billing System with SMS capability.
The system is designed to facilitate the Water authorized to manage
the monthly billing system without the use of human services. The
system receives SMS from the meter to central databases. Then the
information received is processed to generate current billing. The
system again sends a SMS notification to the user regarding the
total amount that has been billed. The system was implemented using
Visual Basic and database in order to perform the prototype and the
system works successfully in sending SMS to user for
notification.
1.5 PROBLEM FORMULATION
The Electricity meter reading using GSM system takes the
advantage of existing GSM infrastructure that have virtually full
coverage of all housing and building area across the country which
lead to low infrastructure implementation cost, simple and easy
installation of GSM system at consumer side as this system is no
difference from existing ordinary analogue or digital meter
installation. The complete Electricity Meter Reading Using GSM
required an ICT expertise personnel to setup, run and maintain all
the servers. The Electricity Meter Reading Using GSM provides
effective, reliable and efficient wireless automatic electric meter
readiFng, billing and notification through the use of GSM network,
thus reducing human operator meter reading operation cost.The
importance of proposed work can be well understood if we keep in
mind the amount of electricity being stolen every day. As a user
can get his or her bill at any instant and can even pay it at any
instant, so any kind of misuse by any other person can be avoided.
The message are sent from the mobile set that contain commands in
written form which are then processed accordingly to perform the
required task. The proposed approach for designing this system is
to implement microcontroller based control module that receives its
instructions and command from a cellular phone over the GSM
network. The microcontroller then will carry out the issued
commands and then communicate the status of a given appliance or
device back to the cellular phone. First, the sent SMS is stored
and polled from the receiver mobile station and then the required
control signal is generated and sent to the intermediate hardware
that we have designed according to the command received in form of
the sent message
CHAPTER 2 HARDWARE DEVELOPMENT2.1 BLOCK DIAGRAM
Figure 2.1 Block diagram of GSM based electricity system with
load control
BLOCKSCOMPONENT USED
TransformerStep down transformer
RectifierBridge rectifier
Voltage RegulatorLM7805
Micro ControllerAT89S52
Energy MeterElectro-mechanical type
ComparatorLM358
GSM ModemSIM 300
Crystal Oscillator11.0592 MHz
Relay DriverULN2003A
RelaySPDT Relay
LoadAny electrical appliance
LCD Display162 LCD Display
Table 2.1 Block description2.2 POWER SUPPLY Every electronic
system whether an entertainment gadget or a test and measurement
equipment requires one or more than one DC voltages for its
operation, most of the time it is essential and almost always
desirable that these DC voltages are nicely filtered and well
regulated. Power supply does the job of providing required DC
voltages from available AC mains in case of mains operated systems
and DC input in case of portable systems. Power supplies are often
classified as linear power supplies depending upon the nature of
regulation circuit.
Figure 2.2 Block Diagram of Power SupplyLinear power supply unit
essentially comprises of: Mains Transformer Rectifier Filter
Regulator Here 5V D.C. output is used as power supply to AT89S52
Microcontroller, RF Transmitter & Receiver pair and LCD display
etc and 12 Volt D.C. power supply is mainly used for relays.2.2.1
DESCRIPTION OF A POWER SUPPLY UNIT A 220v ac to 12-0-12v
transformer is used and for rectification, four diodes IN4007 are
connected for rectification of the step down ac supply. Filter
capacitor of 1000F is used. It is regulated to +5v using a
regulator 7805.2.2.1.1 Transformer A bridge rectifier coupled with
a step down transformer is used for our design. The voltage rating
of transformer used is 0-12V and the current rating is 500mA. When
AC voltage of 230V is applied across the primary winding an output
AC voltage of 12V is obtained. One alteration of input causes the
top of transformer to be positive and the bottom negative. The next
alteration will temporarily cause the reverse.
2.2.1.2 Rectifier In the power supply unit, rectification is
normally achieved using a solid state diode. Diode has the property
that will let the electron flow easily at one direction at proper
biasing condition. Bridge rectifiers of 4 diodes are used to
achieve full wave rectification. Two diodes will conduct during the
negative cycle and the other two will conduct during the positive
half cycle.
2.2.1.3 Filtering Unit Filter circuit which is usually a
capacitor acts as a surge arrester always follows the rectifier
unit. This capacitor is also called as a decoupling capacitor or a
bypass capacitor, is used not only to short the ripple with
frequency to ground but also leave the frequency of the DC to
appear at the output.
2.2.1.4 Voltage Regulators The voltage regulators play an
important role in any power supply unit. The primary purpose of a
regulator is to aid the rectifier and filter circuit in providing a
constant DC voltage to the device. Power supplies without
regulators have an inherent problem of changing DC voltage values
due to variations in the load or due to fluctuations in the AC line
voltage. With a regulator connected to DC output, the voltage can
be maintained within a close tolerant region of the desired output.
Figure 2.3 LM78052.2.2 OPERATION The transformer provides voltage
transformation and produces AC voltage required for producing the
desired DC voltages across its secondary windings. It also provides
electrical isolation between the power supply input i.e., AC mains
and output. The rectifier circuit changes the AC voltages appearing
at transformer secondary to DC. Commonly used rectifier circuits
include half-wave rectifier, conventional full-wave rectifier
requiring a tapped secondary or a bridge rectifier.
Figure 2.4 A Simple 5V DC Regulated Power System
The rectified voltage will always have some AC content known as
power supply ripple. The filter circuit levels the ripple of the
rectified voltage. The filtering action of the capacitor connected
across the output of the rectifier comes from the fact that it
offers a low reactance to AC components. The ripple in nature is
inversely proportional to capacitance. Thus, the capacitor
connected across the output of the rectifier, which provides the
filtering action, must be large enough to avoid the ripple.
The regulated circuit is a type of feedback circuit that ensures
the output DC voltage does not change from its normal value due to
changes in line voltage or load current. It is the nature of
regulator circuit that distinguishes the linear power supply from a
switching supply. In a linear power supply, the active device
(linear regulator) that provides regulation, usually bipolar
transistor is operated anywhere between cut-off and saturation
i.e., in active region whereas in switching mode power supply,
switching regulator is operated either in cut-off or in saturation.
7812 or 7805 are linear, fixed voltage series regulators, which
provide regulated 12V and 5V DC respectively. In case of a series
regulator a change in the output voltage due to a change in input
voltage or load current results in a change in the voltage drop
across the regulator transistor so as to maintain a constant output
voltage across the load. 12V and 5V regulated DC power supplies are
obtained across 10 micro farad capacitors. 2.3 MICRO CONTROLLER The
AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller
with 8K bytes of in-system programmable Flash memory. The device is
manufactured using Atmels high-density nonvolatile memory
technology and is compatible with the industry-standard 80C51
instruction set and pin out. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional
nonvolatile memory programmer. By combining a versatile 8-bit CPU
with in-system programmable Flash on a monolithic chip, the Atmel
AT89S52 is a powerful microcontroller which provides a
highly-flexible and cost-effective solution to many embedded
control applications. The AT89S52 provides the following standard
features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines,
Watchdog timer, two data pointers, three 16-bit timer/counters, a
six-vector two-level interrupt architecture, a full duplex serial
port, on-chip oscillator, and clock circuitry. In addition, the
AT89S52 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes.
The Idle Mode stops the CPU while allowing the RAM, timer/counters,
serial port, and interrupt system to continue functioning. The
Power-down mode saves the RAM contents but freezes the oscillator,
disabling all other chip functions until the next interrupt or
hardware reset.2.3.1 FEATURES Compatible with MCS-51 Products. 8K
Bytes of In-System Programmable (ISP) Flash Memory. Endurance:
10,000 Write/Erase Cycles. 4.0V to 5.5V Operating Range. Fully
Static Operation: 0 Hz to 33 MHz. Three-level Program Memory Lock.
256 x 8-bit Internal RAM. 32 Programmable I/O Lines. Three 16-bit
Timer/Counters. Eight Interrupt Sources. Full Duplex UART Serial
Channel. Low-power Idle and Power-down Modes. Interrupt Recovery
from Power-down Mode. Watchdog Timer. Dual Data Pointer. Power-off
Flag. Fast Programming Time. Flexible ISP Programming (Byte and
Page Mode). Green (Pb/Halide-free) Packaging Option.
2.3.2 PIN DIAGRAM Figure 2.5 Pin Diagram of AT89S52
2.3.3 PIN DESCRIPTIONVCC: Supply voltage.GND: Ground.Port 0:
Port 0 is an 8-bit open drain bidirectional I/O port. As an output
port, each pin can sink eight TTL inputs. When 1s are written to
port 0 pins, the pins can be used as high-impedance inputs. Port 0
can also be configured to be the multiplexed low-order address/data
bus during accesses to external program and data memory. In this
mode, P0 has internal pull-ups. Port 0 also receives the code bytes
during Flash programming and outputs the code bytes during program
verification. External pull-ups are required during program
verification.Port 1: Port 1 is an 8-bit bidirectional I/O port with
internal pull-ups. The Port 1 output buffers can sink/source four
TTL inputs. When 1s are written to Port 1 pins, they are pulled
high by the internal pull-ups and can be used as inputs. As inputs,
Port 1 pins that are externally being pulled low will source
current (IIL) because of the internal pull-ups. In addition, P1.0
and P1.1 can be configured to be the timer/counter 2 external count
input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX),
respectively, as shown in the following table. Port 1 also receives
the low-order address bytes during Flash programming and
verification.Port PinAlternate Functions
P1.0T2(external count input to Timer/Counter 2), clock-out
P1.1T2EX (Timer/Counter 2 capture/reload trigger and direction
control)
P1.5MOSI (used for In-System Programming)
P1.6MISO (used for In-System Programming)
P1.7SCK (used for In-System Programming)
Table 2.2 Alternate functions of Port 1Port 2: Port 2 is an
8-bit bidirectional I/O port with internal pull-ups. The Port 2
output buffers can sink/source four TTL inputs. When 1s are written
to Port 2 pins, they are pulled high by the internal pull-ups and
can be used as inputs. As inputs, Port 2 pins that are externally
being pulled low will source current (IIL) because of the internal
pull-ups. Port 2 emits the high-order address byte during fetches
from external program memory and during accesses to external data
memory that uses 16-bit addresses (MOVX @ DPTR). In this
application, Port 2 uses strong internal pull-ups when emitting 1s.
During accesses to external data memory that uses 8-bit addresses
(MOVX @ RI), Port 2 emits the contents of the P2 Special Function
Register. Port 2 also receives the high-order address bits and some
control signals during Flash programming and verification.Port 3:
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups.
The Port 3 output buffers can sink/source four TTL inputs. When 1s
are written to Port 3 pins, they are pulled high by the internal
pull-ups and can be used as inputs. As inputs, Port 3 pins that are
externally being pulled low will source current (IIL) because of
the pull-ups. Port 3 receives some control signals for Flash
programming and verification. Port 3 also serves the functions of
various special features of the AT89S52, as shown in the following
table.Port PinAlternate Functions
P3.0RXD (serial input port)
P3.1TXD (serial output port)
P3.2 (external interrupt 0)
P3.3 (external interrupt 1)
P3.4T0 (timer 0 external input)
P3.5T1 (timer 1 external input)
P3.6 (external data memory write strobe)
P3.7 (external data memory read strobe)
Table 2.3 Alternate Functions of Port 3RST: Reset input. A high
on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives high for 98 oscillator periods
after the Watchdog times out. The DISRTO bit in SFR AUXR (address
8EH) can be used to disable this feature. In the default state of
bit DISRTO, the RESET HIGH out feature is enabled.ALE/PROG: Address
Latch Enable (ALE) is an output pulse for latching the low byte of
the address during accesses to external memory. This pin is also
the program pulse input (PROG) during Flash programming. In normal
operation, ALE is emitted at a constant rate of 1/6 the oscillator
frequency and may be used for external timing or clocking purposes.
Note, however, that one ALE pulse is skipped during each access to
external data memory. If desired, ALE operation can be disabled by
setting bit 0 of SFR location 8EH. With the bit set, ALE is active
only during a MOVX or MOVC instruction. Otherwise, the pin is
weakly pulled high. Setting the ALE-disable bit has no effect if
the microcontroller is in external execution mode.PSEN: Program
Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S52 is executing code from external program memory,
PSEN is activated twice each machine cycle, except that two PSEN
activations are skipped during each access to external data
memory.EA/VPP: External Access Enable. EA must be strapped to GND
in order to enable the device to fetch code from external program
memory locations starting at 0000H up to FFFFH. Note, however, that
if lock bit 1 is programmed, EA will be internally latched on
reset. EA should be strapped to VCC for internal program
executions. This pin also receives the 12-volt programming enable
voltage (VPP) during Flash programming.XTAL1: Input to the
inverting oscillator amplifier and input to the internal clock
operating circuit.XTAL2: Output from the inverting oscillator
amplifier.Memory Organization: MCS-51 devices have a separate
address space for Program and Data Memory. Up to 64K bytes each of
external Program and Data Memory can be addressed.Program Memory:
If the EA pin is connected to GND, all program fetches are directed
to external memory. On the AT89S52, if EA is connected to VCC,
program fetches to addresses 0000H through 1FFFH are directed to
internal memory and fetches to addresses 2000H through FFFFH are to
external memory.Data Memory: The AT89S52 implements 256 bytes of
on-chip RAM. The upper 128 bytes occupy a parallel address space to
the Special Function Registers. This means that the upper 128 bytes
have the same addresses as the SFR space but are physically
separate from SFR space. When an instruction accesses an internal
location above address 7FH, the address mode used in the
instruction specifies whether the CPU accesses the upper 128 bytes
of RAM or the SFR space. Instructions which use direct addressing
access the SFR space. For example, the following direct addressing
instruction accesses the SFR at location 0A0H (which is P2). MOV
0A0H, #data instructions that use indirect addressing access the
upper 128 bytes of RAM. For example, the following indirect
addressing instruction, where R0 contains 0A0H, accesses the data
byte at address 0A0H, rather than P2 (whose address is 0A0H). MOV
@R0, #data Note that stack operations are examples of indirect
addressing, so the upper 128 bytes of data RAM are available as
stack space.Oscillator Characteristics XTAL1 and XTAL2 are the
input and output, respectively, of an inverting amplifier that can
be configured for use as an on-chip oscillator, as shown in Figure
16-1. Either a quartz crystal or ceramic resonator may be used. To
drive the device from an external clock source, XTAL2 should be
left unconnected while XTAL1 is driven, as shown in Figure 16-2.
There are no requirements on the duty cycle of the external clock
signal, since the input to the internal clocking circuitry is
through a divide-by-two flip-flop, but minimum and maximum voltage
high and low time specifications must be observed. Figure 2.6
Oscillator characteristics C1, C2 = 30pF 10pF for Crystals = 40pF
10pF for Ceramic Resonator
2.3.4 BLOCK DIAGRAM
Figure 2.7 Block diagram of 8051 micro controller2.3.5 MODES
2.3.5.1 Idle Mode In idle mode, the CPU puts itself to sleep while
all the on-chip peripherals remain active. The mode is invoked by
software. The content of the on-chip RAM and all the special
functions registers remain unchanged during this mode. The idle
mode can be terminated by any enabled interrupt or by a hardware
reset. Note that when idle mode is terminated by a hardware reset,
the device normally resumes pro-gram execution from where it left
off, up to two machine cycles before the internal reset algorithm
takes control. On-chip hardware inhibits access to internal RAM in
this event, but access to the port pins is not inhibited. To
eliminate the possibility of an unexpected write to a port pin when
idle mode is terminated by a reset, the instruction following the
one that invokes idle mode should not write to a port pin or to
external memory. 2.3.5.2 Power-Down Mode In the Power-down mode,
the oscillator is stopped, and the instruction that invokes
Power-down is the last instruction executed. The on-chip RAM and
Special Function Registers retain their values until the Power-down
mode is terminated. Exit from Power-down mode can be initiated
either by a hardware reset or by an enabled external interrupt.
Reset redefines the SFRs but does not change the on-chip RAM. The
reset should not be activated before VCC is restored to its normal
operating level and must be held active long enough to allow the
oscillator to restart and stabilize.ModeProgram MemoryALEPort 0Port
1Port 2Port 3
IdleInternal11DataDataDataData
IdleExternal11FloatDataAddressData
Power-DownInternal00DataDataDataData
Power-DownExternal00FloatDataDataData
Table 2.4 Status of External Pins During Idle and Power-Down
Mode2.4 COMPARATOR & CRYSTAL OSCILLATOR
2.4.1 COMPARATOR (LM358) A Dual Op-Amp IC with high gain,
frequency compensated operational amplifier with single power
source. These circuits consist of two independent, high gain,
internally frequency-compensated op-amps, specifically designed to
operate from a single power supply over a wide range of voltages.
The low-power supply drain is independent of the magnitude of the
power supply voltage. Application areas include transducer
amplifiers, DC gain blocks and all the conventional op-amp
circuits, which can now be more easily implemented in single power
supply systems. For example, these circuits can be directly
supplied with the standard +5 V, which is used in logic systems and
will easily provide the required interface electronics with no
additional power supply.
Figure 2.8 LM358 IC
2.4.1.1 Features Large DC voltage gain: 100 dB Wide bandwidth
(unity gain): 1.1 MHz (temperature compensated) Very low supply
current per operator essentially independent of supply voltage Low
input bias current: 20 nA (temperature compensated) Low input
offset voltage: 2 mV Low input offset current: 2 nA Input
common-mode voltage range includes negative rails Differential
input voltage range equal to the power supply voltage Large output
voltage swing 0 V to (VCC + -1.5 V)
2.4.1.2 Specification Supply Voltage: 3.0 V to 32 V Output
Current: 40mA per Channel Package: 8 pin DIP package.
2.4.1.3 Pin Diagram
Figure 2.9 Pin diagram of LM358 IC
2.4.2 CRYSTAL OSCILLATOR Acrystal oscillatoris anelectronic
oscillatorcircuit that uses the mechanicalresonanceof a
vibratingcrystalofpiezoelectric materialto create an electrical
signal with a very precisefrequency. This frequency is commonly
used to keep track of time (as inquartz wristwatches), to provide a
stableclock signalfordigitalintegrated circuits, and to stabilize
frequencies forradio transmittersandreceivers. The most common type
of piezoelectric resonator used is thequartzcrystal, so oscillator
circuits incorporating them became known as crystal oscillators,
but other piezoelectric materials including polycrystalline
ceramics are used in similar circuits. Quartz crystals are
manufactured for frequencies from a few tens ofkilohertzto hundreds
of megahertz. More than two billion crystals are manufactured
annually. Most are used for consumer devices such
aswristwatches,clocks,radios,computers, and cell phones. Quartz
crystals are also found inside test and measurement equipment, such
as counters,signal generators, and oscilloscopes.
Figure 2.10 Crystal Oscillator 11.0592 MHz 2.5 RELAY DRIVER
& RELAY SWITCH 2.5.1 RELAY DRIVER (ULN 2003) The ULN2003 is a
monolithic high voltage and high current Darlington transistor
arrays. It consists of seven NPN darlington pairs that features
high-voltage outputs with common-cathode clamp diode for switching
inductive loads. The collector-current rating of a single
darlington pair is 500mA. The darlington pairs may be paralleled
for higher current capability. Applications include relay drivers,
hammer drivers, lamp drivers, display drivers (LED gas discharge),
line drivers, and logic buffers. The ULN2003 has a 2.7k series base
resistor for each darlington pair for operation directly with TTL
or 5V CMOS devices. Figure 2.11 ULN2003 IC
2.5.2 FEATURES * 500mA rated collector current (Single output) *
High-voltage outputs: 50V * Inputs compatible with various types of
logic. * Relay driver application
2.5.3 PIN DIAGRAM
Figure 2.12 Pin diagram of ULN2003
2.5.2 RELAY SWITCH Arelayis anelectricallyoperatedswitch. Many
relays use anelectromagnetto mechanically operate a switch, but
other operating principles are also used, such assolid-state
relays. Relays are used where it is necessary to control a circuit
by a low-power signal or where several circuits must be controlled
by one signal. The first relays were used in long
distancetelegraphcircuits as amplifiers: they repeated the signal
coming in from one circuit and re-transmitted it on another
circuit. Relays were used extensively in telephone exchanges and
early computers to perform logical operations.The Single Pole
Double Throw Relay
Figure 2.13 SPDT relayA single pole double throw (SPDT) relay
configuration switches one common pole to two other poles, flipping
between them. As shown in the schematic diagram, the common point E
completes a circuit with C when the relay coil is at rest, that is,
no voltage is applied to it. This circuit is "closed." A gap
between the contacts of point E and D creates an "open" circuit.
When you apply power to the coil, a metal level is pulled down,
closing the circuit between points E and D and opening the circuit
between E and C. A single pole double throw relay can be used to
alternate which circuit a voltage or signal will be sent to.
2.6 LINEAR ELEMENTS 2.6.1 CAPACITOR A capacitor is a passive
two-terminal electrical component used to store energy
electro-statically in an electric field. The forms of practical
capacitors vary widely, but all contain at least two electrical
conductors (plates) separated by a dielectric (i.e. insulator). The
conductors can be thin films, foils or sintered beads of metal or
conductive electrolyte, etc. The non-conducting dielectric acts to
increase the capacitor's charge capacity. A dielectric can be
glass, ceramic, plastic film, air ,vacuum, paper, mica, oxide layer
etc. Capacitors are widely used as parts of electrical circuits in
many common electrical devices. Unlike a resistor, an ideal
capacitor does not dissipate energy. Instead, a capacitor stores
energy in the form of an electrostatic field between its plates.
Capacitors used in the project are 10F, 100F, 1000F. Figure 2.14
Capacitor working Figure 2.15 100F capacitor Figure 2.16 1000F
capacitor Figure 2.17 10F capacitor
2.6.2 RESISTORS Aresistoris apassivetwo-terminalelectrical
componentthat implementselectrical resistanceas a circuit element.
Resistors act to reduce current flow, and, at the same time, act to
lower voltage levels within circuits. In electronic circuits
resistors are used to limit current flow, to adjust signal
levels,biasactive elements, terminatetransmission linesamong other
uses. High-power resistors that can dissipate manywattsof
electrical power as heat may be used as part of motor controls, in
power distribution systems, or as test loads forgenerators. Fixed
resistors have resistances that only change slightly with
temperature, time or operating voltage. Variable resistors can be
used to adjust circuit elements (such as a volume control or a lamp
dimmer), or as sensing devices for heat, light, humidity, force, or
chemical activity.The resistors used in the project are mainly 1K
and 10K.
Figure 2.18 1K and 10K resistors 2.6.3 CONNECTORS Connector is a
device for keeping two parts of an electric circuit in contact. A
connector is best known for providing the physical link between two
components. Connections differ in various ways, which help in
determining where that type of connector can be used. These
features include: Shape Size Gender Connection mechanism
Function2.6.3.1 JumpersJumpers are small blocks on a circuit board
with two or more pins emerging from them. Plastic plugs containing
a wire fit down over the pins. The wire connects the pins and
creates a circuit. To change a jumper setting, pull the plug off
its pin(s) and carefully fit it down onto the pin(s) indicated. A
jumper is referred to as open or unjumpered when the plug is pushed
down over only one pin or if there is no plug at all. When the plug
is pushed down over two pins, the jumper is referred to as
jumpered. The jumper setting is often shown in text as two numbers,
such as 1-2. The number 1 is printed on the circuit board so that
you can identify each pin number based on the location of pin 1.
There are two types of jumper connectors:1. Male jumper
connector
Figure 2.19 Male jumper connector 2. Female jumper connector
Figure 2.20 Female jumper connector 2.7 GSM MODULE GSM(Global
System for Mobile Communications) is a standard developed by
theEuropean Telecommunications Standards Institute(ETSI) to
describe protocols for second-generation (2G) digitalcellular
networksused bymobile phones. As of 2014it has become the default
global standard for mobile communications - with over 90% market
share, operating in over 219 countries and territories. 2G networks
developed as a replacement for first generation (1G) analog
cellular networks, and the GSM standard originally described a
digital, circuit-switched network optimized forfull
duplexvoicetelephony. This expanded over time to include data
communications, first by circuit-switched transport, then
bypacketdata transport viaGPRS(General Packet Radio Services)
andEDGE(Enhanced Data rates for GSM Evolution or
EGPRS).Subsequently, the3GPPdeveloped third-generation
(3G)UMTSstandards followed by fourth-generation (4G)LTE
Advancedstandards, which do not form part of the ETSI GSM
standard.
Figure 2.21 SIM 300 GSM Module
2.7.1 NETWORK STRUCTUREThe network is structured into a number
of discrete sections: Base Station Subsystem the base stations and
their controllers explained Network and Switching Subsystem the
part of the network most similar to a fixed network, sometimes just
called the "core network" GPRS Core Network the optional part which
allows packet-based Internet connections Operations support
system(OSS) network maintenance
Figure 2.22 Structure of a GSM network2.7.1.1 Base Station
SubsystemGSM is acellular network, which means thatcell
phonesconnect to it by searching for cells in the immediate
vicinity. There are five different cell sizes in a GSM
networkmacro,micro,pico,femto, andumbrella cells. The coverage area
of each cell varies according to the implementation environment.
Macro cells can be regarded as cells where thebase stationantennais
installed on a mast or a building above average rooftop level.
Micro cells are cells whose antenna height is under average rooftop
level; they are typically used in urban areas. Picocells are small
cells whose coverage diameter is a few dozen metres; they are
mainly used indoors. Femtocells are cells designed for use in
residential or small business environments and
Figure 2.23 Base stationconnect to the service providers network
via a broadband internet connection. Umbrella cells are used to
cover shadowed regions of smaller cells and fill in gaps in
coverage between those cells. Cell horizontal radius varies
depending on antenna height, antenna gain, and propagation
conditions from a couple of hundred meters to several tens of
kilometres. The longest distance the GSM specification supports in
practical use is 35 kilometres (22mi). There are also several
implementations of the concept of an extended cell,where the cell
radius could be double or even more, depending on the antenna
system, the type of terrain, and thetiming advance.Indoor coverage
is also supported by GSM and may be achieved by using an indoor
picocell base station, or anindoor repeaterwith distributed indoor
antennas fed through power splitters, to deliver the radio signals
from an antenna outdoors to the separate indoor distributed antenna
system. These are typically deployed when significant call capacity
is needed indoors, like in shopping centers or airports. However,
this is not a prerequisite, since indoor coverage is also provided
by in-building penetration of the radio signals from any nearby
cell.2.7.2 GSM CARRIER FREQUENCIESGSM networks operate in a number
of different carrier frequency ranges (separated intoGSM frequency
rangesfor 2G andUMTS frequency bandsfor 3G), with most2GGSM
networks operating in the 900MHz or 1800MHz bands. Where these
bands were already allocated, the 850MHz and 1900MHz bands were
used instead (for example in Canada and the United States). In rare
cases the 400 and 450MHz frequency bands are assigned in some
countries because they were previously used for first-generation
systems.Most3Gnetworks in Europe operate in the 2100MHz frequency
band. For more information on worldwide GSM frequency usage, seeGSM
frequency bands.Regardless of the frequency selected by an
operator, it is divided intotimeslotsfor individual phones. This
allows eight full-rate or sixteen half-rate speech channels
perradio frequency. These eight radio timeslots (orburstperiods)
are grouped into aTDMAframe. Half-rate channels use alternate
frames in the same timeslot. The channel data rate for all8
channelsis270.833 kbit/s,and the frame duration is4.615 ms.The
transmission power in the handset is limited to a maximum of 2
watts inGSM 850/900and1 wattinGSM 1800/1900.2.7.3 SUBSCRIBER
IDENTITY MODULE (SIM)One of the key features of GSM is
theSubscriber Identity Module, commonly known as aSIM card. The SIM
is a detachablesmart cardcontaining the user's subscription
information and phone book. This allows the user to retain his or
her information after switching handsets. Alternatively, the user
can also change operators while retaining the handset simply by
changing the SIM. Some operators will block this by allowing the
phone to use only a single SIM, or only a SIM issued by them; this
practice is known asSIM locking. 2.7.4 GSM SERVICE SECURITY GSM was
designed with a moderate level of service security. The system was
designed to authenticate the subscriber using apre-shared
keyandchallenge-response. Communications between the subscriber and
the base station can be encrypted. The development ofUMTSintroduces
an optionalUniversal Subscriber Identity Module(USIM), that uses a
longer authentication key to give greater security, as well as
mutually authenticating the network and the user, whereas GSM only
authenticates the user to the network (and not vice versa). The
security model therefore offers confidentiality and authentication,
but limited authorization capabilities, and nonon-repudiation.GSM
uses several cryptographic algorithms for security. TheA5/1,A5/2,
andA5/3stream ciphersare used for ensuring over-the-air voice
privacy. A5/1 was developed first and is a stronger algorithm used
within Europe and the United States; A5/2 is weaker and used in
other countries. Serious weaknesses have been found in both
algorithms: it is possible to break A5/2 in real-time with
aciphertext-only attack, and in January 2007,The Hacker's
Choicestarted the A5/1 cracking project with plans to useFPGAsthat
allow A5/1 to be broken with arainbow tableattack.The system
supports multiple algorithms so operators may replace that cipher
with a stronger one. New attacks have been observed that take
advantage of poor security implementations, architecture, and
development for smart phoneapplications. Some wiretapping and
eavesdropping techniqueshijackthe audio input and output providing
an opportunity for a third party to listen in to the conversation.
GSM usesGeneral Packet Radio Service(GPRS) for data transmissions
like browsing the web. The most commonly deployed GPRS ciphers were
publicly broken in 2011. The researchers revealed flaws in the
commonly used GEA/1 and GEA/2 ciphers and published the open-source
"gprs decode" software forsniffingGPRS networks. They also noted
that some carriers do not encrypt the data (i.e., using GEA/0) in
order to detect the use of traffic or protocols they do not like
(e.g.,Skype), leaving customers unprotected. GEA/3 seems to remain
relatively hard to break and is said to be in use on some more
modern networks. If used withUSIMto prevent connections tofake base
stationsand downgrade attacks, users will be protected in the
medium term, though migration to 128-bit GEA/4 is still
recommended.2.8 ENERGY METER Anelectricity meter,electric meter,
orenergy meteris a device that measures the amount ofelectric
energyconsumed by aresidence, business, or an electrically powered
device. Electric utilitiesuse electric meters installed at
customers premises to measure electric energy delivered to their
customers for billing purposes. They are typically calibrated in
billing units, the most common one being thekilowatt hour[kWh].
They are usually read once each billing period.In settings when
energy savings during certain periods are desired, meters may
measure demand, the maximum use of power in some interval. "Time of
day" metering allows electric rates to be changed during a day, to
record usage during peak high-cost periods and off-peak,
lower-cost, periods. Also, in some areas meters have relays
fordemand responseload shedding during peak load periods.
Figure 2.24 Energy meterUnits of measurementThe most common unit
of measurement on the electricity meter is thekilowatt hour[kWh],
which is equal to the amount of energy used by a load of
onekilowattover a period of onehour, or 3,600,000joules. Some
electricity companies use theSImegajouleinstead. There are two
types of energy meters. They are:2.8.1 ELECTROMECHANICAL METERSThe
most common type of electricity meter is
theelectromechanicalinductionwatt-hour meter. The
electromechanicalinductionmeter operates by counting the
revolutions of a non-magnetic, but electrically conductive, metal
disc which is made to rotate at a speed proportional to the power
passing through the meter. The number of revolutions is thus
proportional to the energy usage. The voltage coil consumes a small
and relatively constant amount of power, typically around 2 watts
which is not registered on the meter. The current coil similarly
consumes a small amount of power in proportion to the square of the
current flowing through it, typically up to a couple of watts at
full load, which is registered on the meter.The disc is acted upon
by two sets ofcoils, which form, in effect, a two phaseinduction
motor. One coil is connected in such a way that it produces
amagnetic fluxin proportion to thevoltageand the other produces a
magnetic flux in proportion to thecurrent. The field of the voltage
coil is delayed by 90 degrees, due to the coil's inductive nature,
and calibrated using a lag coil.This produceseddy currentsin the
disc and the effect is such that aforceis exerted on the disc in
proportion to the product of the instantaneous current, voltage and
phase angle (power factor) between them. Apermanent magnetexerts an
opposing force proportional to thespeed of rotationof the disc. The
equilibrium between these two opposing forces results in the disc
rotating at a speedproportionalto the power or rate of energy
usage. The disc drives a register mechanism which counts
revolutions, much like theodometerin a car, in order to render a
measurement of the total energy used. Figure 2.25
Electro-mechanical meter 1 - Voltage coil - many turns of fine wire
encased in plastic, connected in parallel with load.2 - Current
coil - three turns of thick wire, connected in series with load.3 -
Stator - concentrates and confines magnetic field.4 - Aluminum
rotor disc.5 - Rotor brake magnets.6 - Spindle with worm gear.7 -
Display dials - note that the 1/10, 10 and 1000 dials
rotateclockwisewhile the 1, 100 and 10000 dials rotate
counter-clockwise. 2.8.2 ELECTRONIC METERSElectronic meters display
the energy used on anLCDor LED display, and some can also transmit
readings to remote places. In addition to measuring energy used,
electronic meters can also record other parameters of the load and
supply such as instantaneous and maximum rate of usage
demands,voltages,power factorandreactive powerused etc. They can
also support time-of-day billing, for example, recording the amount
of energy used during on-peak and off-peak hours.
Figure 2.26 Electronic Meter 2.9 LCD DISPLAY (16x2)
LCD (Liquid Crystal Display) screen is an electronic display
module and find a wide range of applications. A 16x2 LCD display is
very basic module and is very commonly used in various devices and
circuits. These modules are preferred overseven segmentsand other
multi segmentLEDs. The reasons being: LCDs are economical; easily
programmable; have no limitation of displaying special &
evencustom characters(unlike in seven segments),animationsand so
on.A16x2 LCDmeans it can display 16 characters per line and there
are 2 such lines. In this LCD each character is displayed in 5x7
pixel matrix. This LCD has two registers, namely, Command and
Data.The command register stores the command instructions given to
the LCD. A command is an instruction given to LCD to do a
predefined task like initializing it, clearing its screen, setting
the cursor position, controlling display etc. The data register
stores the data to be displayed on the LCD. The data is the ASCII
value of the character to be displayed on the LCD. Click to learn
more about internal structure of aLCD.
Figure 2.27 16x2 LCDDisplay
2.9.1 PIN DESCRIPTIONPin NoFunctionName
1Ground (0V)Ground
2Supply voltage; 5V (4.7V 5.3V)Vcc
3Contrast adjustment; through a variable resistorVEE
4Selects command register when low; and data register when
highRegister Select
5Low to write to the register; High to read from the
registerRead/write
6Sends data to data pins when a high to low pulse is
givenEnable
78-bit data pinsDB0
8DB1
9DB2
10DB3
11DB4
12DB5
13DB6
14DB7
15Backlight VCC(5V)Led+
16Backlight Ground (0V)Led-
Table 2.5 Pin description of LCD display
CHAPTER 3 IMPLEMENTATION AND WORKINGImplementation part includes
bringing together all the hardware components used in the project
and interfacing them to the microcontroller which is the heart of
the project. We need to interface GSM modem, LCD display and energy
meter to the microcontroller.3.1 INTERFACING GSM MODULE AND LCD
DISPLAY
Figure 3.1 Interfacing of GSM and LCD display to microcontroller
Serial communication takes place between GSM module and
microcontroller. This serial communication is achieved by RS232
serial protocol.3.1.1 RS-232 SERIAL PROTOCOL One of the most common
serial interfaces is based on the RS-232 standard. This standard
was developed to allow individuals to use remote computer systems
over dialup telephone lines with remote terminals. The standard
includes provisions for a remote terminal that is connected to a
modemthat places a telephone call, a modem that answers the
telephone call, and a computer that is connected to thatmodem. The
terminal can be connected directly to the computer, eliminating the
need for two modems, through the use of a special device called
anullmodemadapter. Sometimes this device is built directly into a
cable, in which case the cable is called anullmodemcable.3.1.2 AT
COMMANDSGSM modem communicates with the microcontroller in the form
of AT commands. Here AT refers to attention.
Figure 3.2 Communication between microcontroller and GSM
moduleThe microcontroller sends the AT command through the Tx pin
and this command is received by the receiver of the GSM module. The
GSM module responds to the command and transmits the information
required and the result code. This information is received by the
microcontroller and it displays the result in the LCD display.
3.1.2.1 List of Important AT Commands:
Overview of AT Commands Description
AT+CMGD DELETE SMS MESSAGE
AT+CMGF SELECT SMS MESSAGE FORMAT
AT+CMGL LIST SMS MESSAGES FROM PREFERRED STORE
AT+CMGR READ SMS MESSAGE
AT+CMGS SEND SMS MESSAGE
AT+CMGW WRITE SMS MESSAGE TO MEMORY
AT+CMSS SEND SMS MESSAGE FROM STORAGE
AT+CMGC SEND SMS COMMAND
AT+CNMI NEW SMS MESSAGE INDICATIONS
AT+CPMS PREFERRED SMS MESSAGE STORAGE
AT+CRES RESTORE SMS SETTINGS
AT+CSAS SAVE SMS SETTINGS
AT+CSCA SMS SERVICE CENTER ADDRESS
AT+CSCB SELECT CELL BROADCAST SMS MESSAGES
AT+CSDH SHOW SMS TEXT MODE PARAMETERS
AT+CSMP SET SMS TEXT MODE PARAMETERS
AT+CSMS SELECT MESSAGE SERVICE
Table 3.1 List of AT Commands
3.2 INTERFACING ENERGY METEREnergy meter produces pulses when
LED blinks. These pulses produced due to LED blinking are to be
given to microcontroller to display to the meter reading in the LCD
display. A comparator circuit which is basically an op-amp LM385 IC
is used to convert these pulses into 5V dc and the output of the
this IC is given to the microcontroller. 3.3 WORKING OF THE PROJECT
The energy meter records the amount of power consumption. It does
so by an electromechanical system. The system is provided with such
a mechanism that an increment in amount of current flow through
circuit causes the disc to rotate faster, means that the rotational
speed of disc is directly proportional to the amount of current
flowing through circuit. This rotation effect of disc causes the
gear mechanism to work accordingly. And in similar fashion rate of
power consumption increases the blinking rate of LED integrated
within the meter. This blinking of LED regards to number of Pulses.
The pulses from this LED are fed to comparator circuit that is
Op-Amp (LM358), So that the pulse amplitude is level to the
required microcontroller voltage. These compared pulses are fed to
microcontroller for counting operation i.e. these pulses are
counted by microcontroller and readings are stored in registers.
Then Microcontroller displays the readings on LCD, and also
readings are fed to GSM modem for sending SMS to the registered
user number. Whenever a command is sent to the GSM modem , it
decodes the commands and works accordingly and sends the same
information via wireless network. LOAD CONTROL To control the load
first mobile number should be registered and it can be done by
sending any SMS to the number installed in GSM modem. Once the SMS
is received, System replies Mobile no is Registered and at the same
time it is displayed on LCD Mobile no is registered. User should
send * to ON the Load, # to OFF the Load and @ for bill request.
When modem receives the above Symbols it converts into hex format
and it is fed to microcontroller, then microcontroller sends logic
1 or 0 as per the received symbol, to relay driver this switches
the relay 1 to ON 0 to OFF and hence load is controlled. CHAPTER 4
RESULTS At first when initializing the Electricity Meter Reading
using GSM system, the microcontroller sends command to operate the
GSM modem. The GSM modem will now read the immediate incoming
messages. Whenever the GSM modem gets the command message i.e.
"STATUS", for sending the present meter reading. Then the GSM modem
will send the current meter reading to the mobile number which is
stored in the microcontroller The project- GSM based Electricity
Billing System with load control is designed in such way that it
sends the power usage reading to the consumer and the company
through an SMS and it can even control the electrical and
electronic appliances.
PROJECT OUTLOOK
Figure 4.1 Project Outlook
Figure 4.2 Initial MSG 1 Figure 4.3 Initial MSG 2Firstly an
initial message is displayed on the LCD. It indicates that we need
to send a message to the stored mobile number in the GSM
module.
Figure 4.4 Register our mobile number Figure 4.5 Acknowledgement
to mobileIn the first step we need to send a message which may
contain any symbol to stored number in GSM module. Then an
acknowledgment is received to the mobile which acknowledges us that
the mobile number has been registered.
Figure 4.6 Acknowledgement displayed on LCD Figure 4.7 Initial
MSGThe acknowledgement is displayed on the LCD. Later it displays
an initial message.
Figure 4.8 load ON request Figure 4.9 Acknowledgement on LCD
displayIn order to ON the load we need to send symbol * as a
message to the GSM modem. The GSM modem sends the symbol to
microcontroller. Then the loads are switched ON.
Figure 4.10 Load OFF request Figure 4.11 Acknowledgement on LCD
displayThe loads are switched OFF by sending the symbol #. The
acknowledgement is displayed on the LCD display.
Figure 4.12 Request for meter reading Figure 4.13 Reading
received as SMSTo get the meter reading we have to send @ symbol as
text message and the meter reading is displayed on the LCD display
as well as an SMS is sent to the mobile also. CONCLUSION
There is a lot of wastage of power due to inefficient
consumption of electricity by consumers. The distribution company,
most of the time, has to receive huge amounts due to pending bills
which results in substantial revenue losses and also causes hurdles
to modernization because of lack of funds. The consumer, on the
other hand, is facing problems like receiving due bills for bills
that have already been paid and poor reliability of electricity
supply. The remedy for all these problems is to keep track of the
consumers load on a timely basis, which will help assure accurate
billing, track maximum demand, and detect online theft. These are
all the features to be taken into account for designing an
efficient energy billing system. The present project incorporates
these features to address the problems faced by both the consumers
and the distribution companies.
REFERENCES
1. Dr.T. Vigneswaran, M. Srikarthik and S. Altamash, Modern
Electricity Billing System Using GSM, International Conference on
Computing and Control Engineering (ICCCE), Vol 40, pp. 315-317,12
and 13April, 20122. M.A. Mazidi and Janice G. Mazidi And Rolin D.
Mckinlay, The 8051 Microcontroller and Embedded3. Systems Using
Assembly and C Prentice Hall, pp. 300-330.4. Frederic P. Miller,
Agnes F. Vandome, GSM: Cellular Network, Subscriber Identity Module
2004.5. The ATMEL AT89S52 8-Bit Microcontroller, 8KB ISP Flash6.
http://www.atmel.com/devices/AT89S52.aspx7. Prepaid electricity
billing system using GSM mobile
http://www.seminarprojects.com/Threadprepaid-energy-meter-using-gsmmobile#
ixzz1BUylZEck8. http://probots.co.in/Manuals/SIM300.pdf9.
http://www.engineersgarage.com/tutorials/at-commands10. Ramakant A.
Gayakwad, Op-Amps and Linear Integrated Circuit PHI Learning, 4th
edition, pp. 315-317
APPENDIX
Program code:#include#include#include"serial.h"#define lcd_data
P2
sbit lcd_rs = P2^0;sbit lcd_en = P2^1;sbit relay1 = P1^0;sbit
relay2= P1^1;sbit mtr = P1^2;int energy_val,relay_val;int
amt;unsigned char rcv;unsigned char rcg,pastnumber[11],i,count;
void lcdcmd(unsigned char value) // LCD COMMAND{
lcd_data=value&(0xf0); //send msb 4 bits lcd_rs=0; //select
command register lcd_en=1; //enable the lcd to execute command
delay(3); lcd_en=0; lcd_data=((value