major project file 01
TRANSCRIPT
1
1. INTRODUCTION
GSM Modem is mainly used to introduce the pre-paid concept in energy meter. GSM
which stands for Global System for Mobile Communication is widely used mobile
communication architecture used in most of the countries. With the help of GSM
modem one can embed a feature of pre-paid through mobile, also one can recharge
energy meter through mobile by SMS. The GSM modem loads the recharge amount
in one of the register of controller. For each pulses received at interrupt pin, the
controller decrement the content of the register which is equivalent to the recharged
amount left. If the content of the register falls below the threshold level, the controller
activates the GSM to send a message to the user which indicates that amount left in
the meter is low.
1.1 BACKGROUND
The traditional utility meter displays energy usage as an accumulation of counts
(KWH) presented to a display, which is used to calculate the monthly bill. It has
applications within the electricity, gas and water utility industries for domestic,
commercial and industrial applications. Sub metering is often used within a building,
retail or industrial facility where it is desirable to measure power consumption for
specific equipment, locations or sub-level accounts.
Reducing losses and waste, and adopting power efficient products and technology
can achieve this utilizing by remote management. Predicting energy usage remains
a key issue in an industry or Utility sector where downtime is unacceptable.
However, since power losses are not easy to identify, it is difficult to determine the
key culprits whether they are human users or power –hungry devices. In many cases
it is difficult to store energy e.g. electricity, which must be generated to 1ulfil
immediate demand. Predicting usage remains a key issue in an industry where
downtime is unacceptable, which is made difficult by slow access to the remote
meter readings.
2
Fig. 1.1 Traditional Electric Meter
1.2 LITERATURE SURVEY AND RELATED WORKS
For this work existing meter reading techniques in India are analyzed and conducted
an extensive study on different energy measuring instruments available now. In
existing system either an electronic energy meter or an electro-mechanical meter is
fixed in the premise for measuring the usage. The meters currently in use are only
capable of recording kWh units. The kWh units used then still have to be recorded by
meter readers monthly, on foot. The recorded data need to be processed by a meter
reading company. For processing the meter reading, company needs to firstly link
each recorded power usage datum to an account holder and then determine the
amount owed by means of the specific tariff in use. Many systems built on various
platforms have been proposed by different research groups all over the world for
Automatic Meter Reading. There are two types of AMR systems, wire-based and
wireless. Power Line Carrier (PLC) and Telephone Line Network (optical/ cable) are
3
wire-based are primarily designed for low power consumption. As they were
operating within a short range (power class- dependent: 1meter, 10 meters, 100
meters) this technique was not effective and implemented only in areas with high
population density. So a new approach of using an energy measurement technique
that encompasses the GSM network as a mean of transmitting energy data is more
relevant. The GSM/GPRS network offers most coverage in most developed and
developing countries. This method is also effective in rural areas, which are not
densely populated, and in which, most people do not have access to a fixed
telephone network. So in a country like India we need to focus more on this method
as it can be implemented very easily and effectively. According to the latest report by
researcher Gartner India’s mobile subscriber base should grow to 993 million by
2014, which expects the world’s fastest-growing mobile market to close 2010 with
more than 660 million subscribers.
India is the second-largest wireless market in the world after China with its 618
million mobile subscribers at end-May, according to data from the country’s telecoms
regulator. Mobile connections were at 525 million.
4
1.3 PRESENT SCENARIO
Several transmission protocols in wired/wireless manner were introduced so far to
read digital meters remotely at different areas of India. The Digital watt-hour meters
are microprocessor based meters which replaced traditional electromechanical
meters.. Tele watt meters were implemented to transmit data on monthly basis to a
remote central office through a dedicated telephone line and a pair of modems. A
microprocessor/DSP based meter is used in this to measure the electricity
consumption of multiple users in a residential area. A master PC at the control centre
was used to send commands to a remote meter, which in turn transmitted data back,
using the Power Line Communication (PLC) technique. These techniques were
mainly implemented in areas that had a fixed telephone network. Bluetooth energy
meters were designed and implemented in some areas where several meters in
close proximity, communicated wirelessly with a Master PC
Fig. 1.2 A GSM BASED AUTOMATIC METER
5
2. SYSTEM DISCRIPTION
The GSM based automatic electricity recharge system is very simple to operate and
is very effective in domestic use.
2.1 Design Description
In this system we have used Atmega8L microcontroller which has very simple
configuration and is easy to program. In the above system we have removed the
meter the load is directly connected to the controller as we know that the controller
signal is very low so it is amplified through an amplifier the load is connected to the
a.c supply though the relay. The microcontroller is so programmed that it will send
signal to the load only if it get a message from the GSM module
Fig. 2.1 CIRCUIT DIAGRAM
6
2.2 APPLICATIONS
Working as a two-way communication with each meter—with intelligent
power meters and two way communications, the power company can manage
their peak loads better and offer incentives for customers to shift their power
usage to off –peak times.
Theft of service detection and prevention—Meter tampering is detected
instantly through the wireless network, making it much more difficult for
someone to steal the service.
Sub metering-Multi-tenant properties can provide individual user data to the
utility on a remote basis. The reduction of associated costs coupled with the
magnitude of the transmitted information can, in many cases, allow the utility
to offer its commercial customers new report –oriented services.
Down loading of all relevant data from the meter installed at consumer
premises or valves/checkpoints for pipelines.
Transform the data into signals suitable for transmission through the wireless
communication media.
Transmit info to information centers of a company based on the priority.
Transform the data into a format suitable for report generation, invoicing
confrom the computer system at any of above information centers.
Also transform the data into a format suitable for management information.
Alarm the above information centers in a selectable cycle, in case of
occurrence of deliberate tampering, pre specified parameters of system
anomaly/variations/irregularity, initiated from the CMU itself without waiting for
the interrogation from information centers.
The system will have security features to prevent any access by unauthorized
personnel to the data, hardware & software.
7
The system will have security features for restricting personnel from
performing activities, which are not within their authorization.
The communication links between CMU & Boards various information
centers will be fully encrypted as per relevant Data Encryption Standards
Security of Data in transit will be provided by using standard protocols,
Error detection and correction protocols & security measures
Intelligent building applications –An area of overlap between intelligent
buildings and the AMR system is customer information coupled with the
variable rate structures. The AMR system can act as a specialized interface
between the building and the outside world.
8
3. HARDWARE DISCRIPTION
In the proposed system the hardware used is very cheap and is very easily available
in market. The discussion of all the component used in the project in given below.
3.1 GSM MODULE
Global system for mobile communication (GSM) is a globally accepted
standard for digital cellular communication. GSM is the name of a
standardization group established in 1982 to create a common European
mobile telephone standard that would formulate specifications for a pan-
European mobile cellular radio system operating at 900 MHz It is estimated
that many countries outside of Europe will join the GSM Partnership.
GSM was devised as a cellular system specific to the 900 MHz band, called
“The Primary Band”. The primary band includes two sub bands of 25 MHz
each, 890 to 915 MHz and 935 MHz to 960 MHz GSM-PLMN has allocated
124 duplex carrier frequencies over the following bands of operate
Fig. 3.1 GSM Module
Uplink frequency band: 890 to 915 MHz(MS transmits , BTS receives).
Downlink frequency band: 935 to 960 MHz (BTS transmits, MS
receives). Carrier spacing : 200 KHZ
9
3.2 LCD DISPLAY
LCD is a type of display used in digital watches and many portable
computers. LCD displays utilize to sheets of polarizing material with a liquid crystal
solution between them. An electric current passed through the liquid causes the
crystals to align so that light cannot pass through them. LCD technology has
advanced very rapidly since its initial inception over a decade ago for use in lap top
computers. Technical achievements has resulted in brighter displace, higher
resolutions, reduce response times and cheaper manufacturing process. The liquid
crystals can be manipulated through an applied electric voltage so that light is
allowed to pass or is blocked. By carefully controlling where and what wavelength
(color) of light is allowed to pass, the LCD monitor is able to display images. A
backlight provides LCD monitor’s brightness .Over the years many improvements
have been made to LCD to help enhance resolution, image, sharpness and
response times .One of the latest such advancement is applied to glass during acts
as switch allowing control of light at the pixel level, greatly improving LCD’s ability to
display small-sized fonts and image clearly. Other advances have allowed LCD’s to
greatly reduce liquid crystal cell response times. Response time is basically the
amount of time it takes for a pixel to “change colors”, in reality response time is the
amount of time it takes a liquid crystal cell to go from being active to inactive.
Fig. 3.2 LCD Display
10
3.2.1 PIN DIAGRAM OF LCD
3.2.2 PIN DISCRIPTION OF LCD
Pin No
Function Name
1 Ground (0V) Ground
2 Supply voltage; 5V (4.7V – 5.3V) Vcc
3 Contrast adjustment; through a variable resistor VEE
4 Selects command register when low; and data register when high
Register Select
5 Low to write to the register; High to read from the register Read/write
6 Sends data to data pins when a high to low pulse is given Enable
7
8-bit data pins
DB0
8 DB1
9 DB2
10 DB3
11 DB4
12 DB5
13 DB6
14 DB7
15 Backlight VCC (5V) Led+
16 Backlight Ground (0V) Led-
Fig 3.3 Pin Discription of LCD
11
LED(LIGHT EMITTING DIODE)
A light-emitting diode (LED) is a two-lead semiconductor light source that
resembles a basic pn-junction diode, except that an LED also emits light. Whn an
LED's anode lead has a voltage that is more positive than its cathode lead by at least
the LED's forward voltage drop, current flows. Electrons are able to recombine with
holes within the device, releasing energy in the form of photons. This effect is called
electroluminescene, and the color of the light (corresponding to the energy of the
photon) is determined by the energy band gap of the semiconductor.
An LED is often small in area (less than 1 mm2), and integrated optical components
may be used to shape its radiation pattern.
Appearing as practical electronic components in 1962,the earliest LEDs emitted low-
intensity infrared light. Infrared LEDs are still frequently used as transmitting
elements in remote-control circuits, such as those in remote controls for a wide
variety of consumer electronics. The first visible-light LEDs were also of low intensity,
and limited to red. Modern LEDs are available across the visible, ultraviolet, and
infrared wavelengths, with very high brightness.
Fig. 3.4 LED Display
12
3.3 MICROCONTROLLER
Microcontrollers these days are silent workers in many apparatus, ranging from the
washing machine to the video recorder. Nearly all of these controllers are mask
programmed and therefore are of very little use for applications that require the
programs to be changed during the course of execution. Even if the programs could
be altered, the information necessary to do so an instruction set, an assembler
language and description for the basic hardware is either very difficult to obtain or
are in adequate when it came to the issue of accessibility. A marked exception to the
above category is the ATMEGA8L micro controller belonging to the PIC family. This
microcontroller has features that seem to make it more accessible than any other
single chip microcontroller with a reasonable price tag. The ATMEGA8 an 8-bit
single chip microcontroller has got a powerful CPU optimized for control applications.
The ATMEGA8L is an 8 – bit single chip microcontroller. The ATMEGA8L is a
complete micro controller. There are 40 pins needed by the five-bidirectional ports.
Pins provide power, allow you to connect a crystal clock and provide a few timing
and control signals. The architecture includes the ALU, W register, the stack; a block
of registers. All these devices are connected to via internal 8-bit data bus. Each I/O
port is also connected to the 8-bit internal data bus through a series of registers.
These registers hold data during I/O transfers and control the I/O ports.
Fig3.5 Microcontroller
13
3.3.1 ATMEGA 8L
Features
High-performance, Low-power AVR® 8-bit Microcontroller
Advanced RISC Architecture
130 Powerful Instructions – Most Single-clock Cycle Execution
32 x 8 General Purpose Working Registers
Fully Static Operation
Up to 16 MIPS Throughput at 16 MHz
On-chip 2-cycle Multiplier
High Endurance Non-volatile Memory segments
8K Bytes of In-System Self-programmable Flash program memory
512 Bytes EEPROM
1K Byte Internal SRAM
Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
Data retention: 20 years at 85°C/100 years at 25°C
Optional Boot Code Section with Independent Lock Bits
In-System Programming by On-chip Boot Program
True Read-While-Write Operation
Programming Lock for Software Security
Peripheral Features
Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode
One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and
Capture Mode
Real Time Counter with Separate Oscillator
Three PWM Channels
8-channel ADC in TQFP and QFN/MLF package
Eight Channels 10-bit Accuracy
6-channel ADC in PDIP package
Six Channels 10-bit Accuracy
14
Byte-oriented Two-wire Serial Interface
Programmable Serial USART
Master/Slave SPI Serial Interface
Programmable Watchdog Timer with Separate On-chip Oscillato
3.3.2 PIN DIAGRAM OF ATmega8L MICROCONTROLLER
Fig. 3.6 Pin Diagram of Atmega8L
15
3.4 PASSIVE COMPONANTS
3.4.1 Resistors
A resistor is a passive two-terminal electrical component that implements electrical
resistances a circuit element. Resistors act to reduce current flow, and, at the same
time, act to lower voltage levels within circuits. Resistors may have fixed resistances
or variable resistances, such as those found in thermistors, varistors, trimmers,
photo resistors and potentiometers.
The current through a resistor is in direct proportion to the voltage across the
resistor's terminals. This relationship is represented by Ohm's law:
where I is the current through the conductor in units of amperes, V is the potential
difference measured across the conductor in units of volts, and R is the resistance of
the conductor in units of ohms (symbol: Ω).
The ratio of the voltage applied across a resistor's terminals to the intensity of current
in the circuit is called its resistance, and this can be assumed to be a constant
(independent of the voltage) for ordinary resistors working within their ratings.
Iin this module we use 1kilo ohm resistor with 5% tolerance.
Fig. 3.7 Resistors of 1kilo ohm
16
The resistors are specified in terms of their resistance values, tolerance power rating
and thermal stability. By tolerance, we mean the allowed variation permitted in the
normal or marred value or the resistor.
3.4.2 CAPACITOR
A capacitor or condenser is a passive electronic component consisting of a pair
of conductors separate by a dielectric (insulator). When a (voltage) exists across the
conductors, an electric field is present in the dielectric. This field stores energy and
produces a mechanical force between the conductors. The effect is greatest when
there is a narrow separation between large areas of conductor, hence capacitor
conductors are often called plates.In practice, the dielectric between the plates
passes a small amount of leakage current. The conductors and leads introduce
an equivalent series resistance and the dielectric has an electric field strength limit
resulting in a breakdown voltage.
Sim 300 module of gsm consist 100 microfarad 16v capacitor & 470
microfarad 25v capacitor. This is a electrolytic capacitor. Capacitance is
expressed as the ratio of the electric charge (Q) on each conductor to the
potential difference (V) between them. The SI unit of capacitance is the farad
(F), which is equal to one coulomb per volt (1 C/V)
Fig3.8 Capacitor
17
3.5 RELAY
Relay is an electromagnetic device which is used to isolate two circuits electrically
and connect them magnetically. They are very useful devices and allow one circuit to
switch another one while they are completely separate. They are often used to
interface an electronic circuit (working at a low voltage) to an electrical circuit which
works at very high voltage. For example, a relay can make a 5V DC battery circuit to
switch a 230V AC mains circuit. Thus a small sensor circuit can drive, say, a fan or
an electric bulb.
A relay switch can be divided into two parts: input and output. The input section has
a coil which generates magnetic field when a small voltage from an electronic circuit
is applied to it. This voltage is called the operating voltage. Commonly used relays
are available in different configuration of operating voltages like 6V, 9V, 12V, 24V
etc. The output section consists of contactors which connect or disconnect
mechanically. In a basic relay there are three contactors: normally open (NO),
normally closed (NC) and common (COM). At no input state, the COM is connected
to NC. When the operating voltage is applied the relay coil gets energized and the
COM changes contact to NO. Different relay configurations are available like SPST,
SPDT, DPDT etc, which have different number of changeover contacts.
Fig. 3.9 Relay
18
3.6 AMPLIFIER
An electronic amplifier, amplifier, or (informally) amp is an electronic device that
increases the power of a signal. It does this by taking energy from a power supply
and controlling the output to match the input signal shape but with a larger
amplitude. In this sense, an amplifier modulates the output of the power supply.
There are four basic types of electronic amplifier: the voltage amplifier, the current
amplifier, the transconductance amplifier, and the transresistance amplifier. A further
distinction is whether the output is a linear or nonlinear representation of the input.
Amplifiers can also be categorized by their physical placement in the signal chain.
Amplifiers are described according to their input and output properties. The gain
may be specified as the ratio of output voltage to input voltage (voltage gain), output
power to input power (power gain), or some combination of current, voltage, and
power. In many cases, with input and output in the same unit, gain is unit less
(though often expressed in decibels (dB)).
ULN2003 is a high voltage and high current Darlington array IC. It contains
seven open collector darlington pairs with common emitters. A darlington pair
is an arrangement of two bipolar transistors.
ULN2003 belongs to the family of ULN200X series of ICs. Different versions
of this family interface to different logic families. ULN2003 is for 5V TTL,
CMOS logic devices. These ICs are used when driving a wide range of loads
and are used as relay drivers, display drivers, line drivers etc. ULN2003 is
also commonly used while driving Stepper Motors. Refer Stepper Motor
interfacing using ULN2003.
Fig. 3.10 Amplifier
19
3.6.1 PIN DISCRIPTION OF ULN2003
20
3.7 BUZZER
A buzzer or beeper is an audio signalling device, which may be mechanical,
electromechanical, or piezoelectric. Typical uses of buzzers and beepers include
alarm devices, timers and confirmation of user input such as a mouse click or
keystroke.
Early devices were based on an electromechanical system identical to an electric
bell without the metal gong. Similarly, a relay may be connected to interrupt its own
actuating current, causing the contacts to buzz. Often these units were anchored to a
wall or ceiling to use it as a sounding board. The word "buzzer" comes from the
rasping noise that electromechanical buzzers made.
Fig. 3.11 Buzzer
The buzzer produces a same noisy sound irrespective of the voltage variation
applied to it. It consists of piezo crystals between two conductors. When a potential
is applied across these crystals, they push on one conductor and pull on the other.
This, push and pull action, results in a sound wave. Most buzzers produce sound in
the range of 2 to 4 kHz.
21
3.8 VOLTAGE REGULATOR
The 7805 voltage regulators employ built-in current limiting, thermal shutdown,
and safe-operating area protection which make them virtually immune to damage
from output overloads. 7805 is a three-terminal positive voltage regulator. With
adequate heat sinking, it can deliver in excess of 0.5A output current. Typical
applications would include local (on-card) regulators which can eliminate the noise
and degraded performance associated with single-point regulation. 7805 regulator
comes from the 78xx family of self-contained fixed linear voltage regulator integrated
circuits. The 78xx family is a very popular choice for many electronic circuits which
require a regulated power supply, due to their ease of use and relative cheapness.
When specifying individual ICs within this family, the xx is replaced with a two-digit
number, which indicates the output voltage the particular device is designed to
provide (for example, the 7805 voltage regulator has a 5 volt output, while the 7812
produces 12 volts). The 78xx line is positive voltage regulators, meaning that they
are designed to produce a voltage that is positive relative to a common ground.
There is a related line of 79xx devices which are complementary negative voltage
regulators. 78xx and 79xx ICs can be used in combination to provide both positive
and negative supply voltages in the same circuit, if necessary.
Input voltage (5V-18V)
Ground (0V)
Regulated output; 5V (4.8V-5.2V)
Fig. 3.12 7805 Voltage regulaor
22
4. SOFTWARE DISCRIPTION
The software used in preparing the project is very easy to operate and is frequently
used in programming almost all the AT mega series microcontroller. The main
software used in programming the microcontroller is given below.
4.1 CODE VISION AVR
Code Vision Avr is a C cross-compiler, Integrated Development Environment,
and Automatic program generator designed Atmel AVR family of microcontrollers.
C cross-compiler- The c cross-compiler implements nearly all the elements of the
ANSI C language, as allowed by the AVR architecture with some features added to
take advantage of specificity of the AVR architecture and the embedded system
needs.
Integrated Development Environment- The IDE as built-in AVR Chip In-System
Programmer software that enables the automatic transfer of the program to the
microcontroller chip after successful compilation/assembly.
Fig. 4.1 Code Vision AVR Startup window
23
Automatic program generator- Code Vision AVR also contains Code Wizard AVR
automatic program generator that allows you to write, in a matter of minutes, all the
code needed for implementing the following functions:
Input/output port initialization
External Interrupts initialization
Timer/ Counter initialization
Watchdog timer initialization
UART initialization
ADC initialization
LCD module initialization
SPI interface initialization, etc
Fig. 4.2 Code Vision AVR pin select window
24
4.2 KHAZAMA SOFTWARE
The goals of this program is a nice small, fast, reliable and simple to use program.
You can set your settings according to your project. This steps will execute after you
push “Auto Program” button on the main window or press CTRL P shortcut.
From the latest version you can override chip signature check (for example for
ATMega48 and ATMega48PA chip signatures are different but with overriding sign
check you can program this chips truly). You can change 24 programming clock
speed too.
Fuses and Lock window help you to set settings for AVR chips. All settings are
documented and can select easily from combos or set directly from check boxes
Fig. 4.3 Khazama startup window
25
5. COMPONENTS DETAILS
Component Used Specification Value
GSM Module SIM 300 950 Mhz
Microcontroller ATmega8L 8Kb Flash Memory
LM7805 Three Terminal Voltage Regulator
5V
Amplifier ULN2003 16 Pin
Relay Magnetic
Resistor 5% tolerance 1 kilo ohm
Capacitor 100,470 micro farad
16 V & 25V
Lcd display 16 pin
Led display Red colour 1.8 – 5 V
26
6. SOURCE CODE
Chip type : ATmega8
Program type : Application
Clock frequency : 1.000000 MHz
Memory model : Small
External SRAM size : 0
Data Stack size : 256
*****************************************************/
#include <mega8.h>
#include <delay.h>
// Standard Input/Output functions
#include <stdio.h>
#include <stdlib.h>
static unsigned char m[100] ;
// Declare your global variables here
unsigned char ok[]={'A','T'};
unsigned char TEXT[]={'A','T','+','C','M','G','F','=','1'};
unsigned char read[]={'A','T','+','C','M','G','R','=','1'};
unsigned char q,v,i,k, n,en=13;
char c;
static unsigned char j=0;
void main(void)
{
// Declare your local variables here
// Port B initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTB=0x00;
DDRB=0x00;
27
// Port C initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTC=0x00;
DDRC=0x00;
// Port D initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTD=0x00;
DDRD=0x00;
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;
// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off
TCCR1A=0x00;
TCCR1B=0x00;
28
TCNT1H=0x00;
TCNT1L=0x00;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;
// Timer/Counter 2 initialization
// Clock source: System Clock
// Clock value: Timer 2 Stopped
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x00;
TCCR2=0x00;
TCNT2=0x00;
OCR2=0x00;
// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;
// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x00;
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud rate: 9600 (Double Speed Mode)
UCSRA=0x02;
29
UCSRB=0x18;
UCSRC=0x86;
UBRRH=0x00;
UBRRL=0x0C;
// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;
for(i=0;i<2;i++){
putchar(ok[i]);
//delay_ms(1000);
}
putchar(en);
//delay_ms(5000);
for(v=0;v<9;v++){
putchar(TEXT[v]);
//delay_ms(1000);
}
putchar(en);
delay_ms(5000);
for(k=0;k<9;k++){
putchar(read[k]);
//delay_ms(1000);
}
putchar(en)
//delay_ms(5000);
for(q=0;q<100;q++){
c=getchar();
m[q]=c;
j++; }
30
while (1)
{ for(n=0;n<100;n++)
putchar(m[n]);
if(PINC.0==1)
z=m[n];
else
(
z--;
if(PINC.1==1)
{
ldc_clear();
lcd_putsf("light mode on");
PORTB.1=1,PORTB.2=1;
delay_ms(5000);
PORTB.1=1,PORTB.2=0;
}
else
{
lcd_clear();
lcd_putsf("message mode on");
PORTB.1=0
}
31
7. RESULT AND DICUSSION
The developed system is highly effective in the sense it is able to eliminate the
drawback of serial communication. i.e even though it lacks acknowledgement of the
sent SMS it is not affecting system performance. If a message is missing then also
as the system is accepting the cumulative value next time is willing, instant payment
by the consumer from anywhere in the world is also possible.
The project we have prepared is very effective in saving electricity by
reducing the theft in electricity. The problem in meter is also reduced by totally
removing the meter from electricity supply system. In the proposed system the load
(bulb) will illuminate only when we recharge it with certain amount as we do in
mobile, when the duration of recharged amount is finished it will turn off.
The system is firstly switched to recharge mode then we recharge it through
mobile as soon as the message is received by the microcontroller a message is
displayed in the LCD than we switch the system to the load mode as soon as the
load is ON the bulb start glowing and will glow till the recharge amount is finished.
7.1 RESULT IN STEPS
Step 1:-
The LCD will display the message LIGHT MODE ON Change 4 Msg, after receiving
message it shows “ WAITING FOR RECHARGE”.
Step 2:-
Then the system is recharged by using mobile by a specific amount.
Step 3:-
The LCD will display the message “MESSAGE RECIEVED”
Step 4:-
The load button is switched ON. The bulb will start glowing.
32
SOME IMPORTANT RESULT
RECHAGE AMOUNT(Paise) DURATION OF BULB GLOW
60 60 sec
120 120 sec
If the system is recharged with 60 Paise the bulb will glow for 60 sec and similarly if
recharged with 120 the bulb will glow for 120 sec.
Fig. 6.1 GSM BASED ELECTRICITY RECHARGE SYSTEM
33
8. CONCLUSION
The reliability and accuracy of a equipment are inversely proportional to the
number of component being used. The less number of the component more
reliability and accuracy can be achieved almost of the electronic component are
temperature and voltage variation dependent, so more number of component more
components. With the increase in number of components maintenance cost also
increases.
After the whole summery we can conclude that by using Gsm based electricity
recharge system we can save power in large amount and can also limit the theft in
electricity system and can also reduce the manpower.
34
9. DATA SHEET
9.1 LM7805:-
35
9.2 ATmega8L:-
Pin Descriptions
Port B (PB7..PB0)
XTAL1/XTAL2/TOSC1/
TOSC2
Port B is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port B output buffers have
symmetrical drive characteristics with both high sink and
source capability. As inputs, Port B pins that are externally
pulled low will source current if the pull-up resistors are
activated. The Port B pins are tri-stated when a reset condition
becomes active, even if the clock is not running.
Port C
(PC5..PC0)
Port C is an 7-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port C output buffers have
symmetrical drive characteristics with both high sink and
source capability. As inputs, Port C pins that are externally
pulled low will source current if the pull-up resistors are
activated. The Port C pins are tri-stated when a reset condition
becomes active, even if the clock is not running.
PC6/RESET
If the RSTDISBL Fuse is programmed, PC6 is used as an I/O
pin. Note that the electrical characteristics of PC6 differ from
those of the other pins of Port C.
Port D (PD7..PD0)
Port D is an 8-bit bi-directional I/O port with internal pull-up
resistors (selected for each bit). The Port D output buffers have
symmetrical drive characteristics with both high sink and
source capability.
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 the A/D Converter, Port C
(3..0), and ADC (7..6). It should be externally connected to
VCC, even if the ADC is not used.
36
9.3 ULN2003:- (AMPLIFIER)
37
10. REFERENCES
Patents and Journals:-
1. H. G. Rodney, C. H. Lee, V. H. Mok, “Automatic power Meter reading system
using GSM network”, The 8th International power engineering conference
(IPEC 2007), .
2. Mohan kumar, , “How Electronic Energy Meter Works?”, Retrieved March 1,
2012, from http:// dmohankumar.files.wordpress.com /2011/05/how-electronic-
energy-meter-works.pdf
3. Jain and Bagree , “A prepaid meter using mobile communication” ,
International Journal of Engineering, Science and 164 Technology, Vol. 3, No.
3, 2011, pp. 160-166.