Professional Documents
Culture Documents
7276 EnergyMeter PDF
7276 EnergyMeter PDF
Contact us:
+91-120-4298000
+91-9212314779
info@hbeonlabs.com
training@hbeonlabs.com
www. hbeonlabs.com
SMS
PORT1
Level
Convert
er
TABLE OF CONTENTS
INTRODUCTION
Introduction
Methodology
Scope of Work
Aims of the GSM Electronic Notice Board
Objectives of the GSM Home Appliance Control Device
Block diagram
Circuit diagram
Component list
Technical Details
Main Cellular Standards
GSM Frequencies
Network Structure
Subscriber Identity Module (SIM)
Literature Review
GSM Security
HARDWAR DISCRIPTION
DESIGN AND CONSTRUCTION
GSM Modem
Accessing GSM MODEM using Microsoft HyperTerminal
Testing of GSM Modem
3
INTRODUCTION
GSM and GPRS based Designs have developed another
innovative and Public utility product for mass communication
[1]. The purpose of this project is to remote monitoring and
control of the Domestic Energy meter. This system enables the
Electricity Department to read the meter readings regularly
without the person visiting each house. This can be achieved by
the use of micro controller unit that continuously monitors and
records the Energy Meter readings in its permanent (nonvolatile) memory location. This system also makes use of a
GSM modem for remote monitoring and control of Energy
Meter.
The Microcontroller based system continuously records
the readings and the live meter reading can be sent to the
Electricity department on request. This system also can be used
to disconnect the power supply to the house in case of nonpayment of electricity bills. A dedicated GSM modem with SIM
card is required for each energy meter.
SMS to Electricity
METHODOLOGY
The method used to carry out this project is the principle of
serial communication in collaboration with embedded systems.
This is a very good project for Industries. This project has a
GSM ENERGY METER, which will be used as the electronic
device, and also a GSM modem, which is the latest technology
used for communication between the mobile and the embedded
devices.
System will work like when the user wants to receive a
sms on the consumption of the engery in houses and offices; the
modem sent a message through the subscriber identity module
(SIM) which is inserted in the display system MODEM.
SCOPE OF WORK
I will use liquid crystal display for displaying the message; I will
also use GSM modem as an interface between mobile and
microcontroller. It will send message to any phone irrespective
of the GSM network through the modem connected to the
programmable device.
BLOCK DIAGRAM
REGULATED POWER
SUPPLY
METER
LCD
RELAY
BUZZER
GSM MODEM
89S52
MOBILE PHONES
CIRCUIT DIAGRAM
10
COMPONENT LIST
Capacity
Quantity
Code
Regulator
7805
U1
Regulator
7812
U3
Capacitor
1000f
C1
Capacitor
10f
C2
Ceramic Capacitor
22pf
C3,C4
Diode
D1,D2,D3,D4
Push Button
Mobile Phone
Relay
LCD
16*2
RL1
40 Pin Base
U2
16 Pin Base
U5
ULN2003
8051(AT89S52)
Oscillator
11.0592mhz
11
X1
LED
D5,D7
Resistance
220
R1,R4,R8
Resistance
1k
R3
Resistance
10k
R2,R5
Buzzer
BUZ1
BC547
Q1
Energy meter
12
GSM ARCHITECTURE
GSM is a complex system and difficult to understand. The
Mobile Station (MS) refers to the mobile equipment [6]. The
Base Station Subsystem controls the radio link with the Mobile
Station. The Network Subsystem performs main functions such
as switching of calls between mobile users, mobility
management operations, and proper operation and setup of a
network [7]. These functions are controlled by the Mobile
Services Switching Center (MSC).
TECHNICAL DETAILS
GSM is a cellular network, which means that mobile phones
connect to it by searching for cells in the immediate vicinity.
MAIN CELLULAR STANDARDS
YEAR
STANDARD
MOBILE
TECHNO
PRIMARY
TELEPHONE
LOGY
MARKETS
14
SYSTEM
1981
NMT540
NORDIC
MOBILE ANALOG
TELEPHONY
1985
TACS
TOTAL
UE
ACCESS ANALOG
COMMUNUNICATION
UE
EUROPE,MIDDL
E EAST
EUROPE
AND
CHINA
SYSTEM
1986
NMT900
NORDIC
MOBILE ANALOG
TELEPHONY
1991
GSM
UE
EUROPE,
MIDDLE EAST
WORLD-WIDE
MOBILE
COMMUNICATION
1991
TDMA
TIME
DIVISION DIGITAL
AMERICA
MULTIPLE ACCESS
1993
CDMA
CODE
DIVISION DIGITAL
MULTIPLE ACCESS
NORTH
AMERICA,
KOREA
1992
GSM 1800
EUROPE
MOBILE
COMMUNICATION
1994
PDC
PERSONAL
DIGITAL DIGITAL
JAPAN
CELLULAR
1995
2001
PCS 1900
GSM 800
PERSONAL
DIGITAL
NORTH
COMPUTER SERVICES
AMERICA
NORTH
MOBILE
AMERICA
COMMUNICATION
2006-TILL
DATE
GSM 450
15
WORLD-WIDE
GSM FREQUENCIES
GSM networks operate in a number of different frequency
ranges (separated into GSM frequency ranges for 2G and UMTS
frequency bands for 3G). Most 2G GSM networks operate in the
900 MHz or 1800 MHz bands. Some countries in the Americas
(including Canada and the United States) use the 850 MHz and
1900 MHz bands because the 900 and 1800 MHz frequency
bands were already allocated. Most 3G GSM networks in
Europe operate in the 2100 MHz frequency band [9]
NETWORK STRUCTURE
The network behind the GSM seen by the customer is large and
complicated in order to provide all of the services which are
required.
16
LITERATURE REVIEW
This project is an implementation to the idea of the wireless
communication between a mobile phone and a microcontroller.
Currently the main work that has been done on this proposed
system is through serial port to the computer but not wireless. If
they want to switch on and off the appliance, they have to go to
the remote area and one /off the appliance. But in this new
design, the systems need not be reprogrammed to control
another home appliance without changing the programming of
microcontroller. The user will send SMS from his phone and he
will be able to control the appliance.
18
GSM SECURITY
GSM was designed with a moderate level of security. The
system was designed to authenticate the subscriber using a preshared key and challenge-response. Communications between
the subscriber and the base station can be encrypted.
19
20
HARDWARE DISCRIPTION
POWER SUPPLY:
Power supply is a reference to a source of electrical power. A
device or system that supplies electrical or other types of energy
to an output load or group of loads is called a power supply
unit or PSU. The term is most commonly applied to electrical
energy supplies, less often to mechanical ones, and rarely to
others.
Here in our application we need a 5v DC power supply for all
electronics involved in the project. This requires step down
transformer, rectifier, voltage regulator, and filter circuit for
generation of 5v DC power. Here a brief description of all the
components is given as follows
TRANSFORMER:
A transformer is a device that transfers electrical energy from
one circuit to another through inductively coupled conductors
the transformer's coils or "windings". Except for air-core
transformers, the conductors are commonly wound around a
21
single iron-rich core, or around separate but magneticallycoupled cores. A varying current in the first or "primary"
winding creates a varying magnetic field in the core (or cores) of
the transformer. This varying magnetic field induces a varying
electromotive force (EMF) or "voltage" in the "secondary"
winding. This effect is called mutual induction.
22
23
an
IRON-CORE
TRANSFORMER.
Most
power
BRIDGE RECTIFIER
25
BASIC OPERATION
According to the conventional model of current flow originally
established by Benjamin Franklin and still followed by most
engineers today, current is assumed to flow through electrical
conductors from the positive to the negative pole. In actuality,
free electrons in a conductor nearly always flow from the
negative to the positive pole. In the vast majority of
applications, however, the actual direction of current flow is
irrelevant. Therefore, in the discussion below the conventional
model is retained.
In the diagrams below, when the input connected to the left
corner of the diamond is positive, and the input connected to the
right corner is negative, current flows from the upper supply
terminal to the right along the red (positive) path to the output,
and returns to the lower supply terminal via the blue (negative)
path.
26
When the input connected to the left corner is negative, and the
input connected to the right corner is positive, current flows
from the lower supply terminal to the right along the red path to
the output, and returns to the upper supply terminal via the blue
path.
In each case, the upper right output remains positive and lower
right output negative. Since this is true whether the input is AC
or DC, this circuit not only produces a DC output from an AC
27
28
29
30
withstand the current surge that occurs when the power is turned
on at the peak of the AC voltage and the capacitor is fully
discharged. Sometimes a small series resistor is included before
the capacitor to limit this current, though in most applications
the power supply transformer's resistance is already sufficient.
Output can also be smoothed using a choke and second
capacitor. The choke tends to keep the current (rather than the
voltage) more constant. Due to the relatively high cost of an
effective choke compared to a resistor and capacitor this is not
employed in modern equipment.
Some early console radios created the speaker's constant field
with the current from the high voltage ("B +") power supply,
which was then routed to the consuming circuits, (permanent
magnets were then too weak for good performance) to create the
speaker's constant magnetic field. The speaker field coil thus
performed 2 jobs in one: it acted as a choke, filtering the power
supply, and it produced the magnetic field to operate the
speaker.
32
REGULATOR IC (78XX)
REGULATORS
regulators. The most commonly used ones are 7805 and 7812.
7805 gives fixed 5V DC voltage if input voltage is in (7.5V,
20V).
36
37
39
become more positive than the anode, and the diode ceases to
conduct.
Operation of the simple capacitor filter using a full-wave
rectifier is basically the same as that discussed for the half-wave
rectifier. Referring to figure 4-18, you should notice that
because one of the diodes is always conducting on. either
alternation, the filter capacitor charges and discharges during
each half cycle. (Note that each diode conducts only for that
portion of time when the peak secondary voltage is greater than
the charge across the capacitor.)
Figure 4-18. - Full-wave rectifier (with capacitor filter).
41
42
43
44
capacitor, and the lower the average value of output voltage. For
this reason, the simple capacitive filter is seldom used with
rectifier circuits that must supply a relatively large load current.
Using the simple capacitive filter in conjunction with a fullwave or bridge rectifier provides improved filtering because the
increased ripple frequency decreases the capacitive reactance of
the filter capacitor.
CIRCUIT DIAGRAM OF POWER SUPPLY
45
RELAY
The relay takes advantage of the fact that when electricity flows
through
coil,
it
becomes
an
electromagnet.
The
46
Relays
There are many kind of relays. You can select one according to
your needs. The various things to consider when selecting a
relay are its size, voltage and current capacity of the contact
points, drive voltage, impedance, number of contacts, resistance
of the contacts, etc. The resistance voltage of the contacts is the
maximum voltage that can be conducted at the point of contact
in the switch. When the maximum is exceeded, the contacts will
spark and melt, sometimes fusing together. The relay will fail.
The value is printed on the relay
47
GSM MODEM
A GSM modem is a wireless modem that works with a GSM
wireless network. A wireless modem behaves like a dial-up
modem. The main difference between them is that a dial-up
modem sends and receives data through a fixed telephone line
while a wireless modem sends and receives data through radio
waves. Like a GSM mobile phone, a GSM modem requires a
SIM card from a wireless carrier in order to operate [11].
ACCESSING
GSM
MODEM
USING
MICROSOFT
HYPERTERMINAL
tell what causes the problem. The cause can be the program, the
GSM device or the SIM card. If GSM device and SIM card with
MS HyperTerminal are operating properly, then it is very likely
that the problem is caused by the program or other hardware
[12]. For Linux users, Mincom can be used instead of
HyperTerminal.
->
Accessories
->
Communications
->
HyperTerminal.
4. In the Connection Description dialog box (as shown in the
screenshot given below), I enter any file name and choose an
icon I like for the connection. Then I click the OK button.
49
. In the Connect To dialog box, choose the COM port that your
mobile phone or GSM modem is connecting to in the Connect
using combo box. I choose COM1 because my mobile phone is
connected to the COM1 port. Then click the OK button. Type
"AT" in the main window. A response "OK" will be returned
from the mobile phone or GSM modem. Type "AT+CPIN?" in
the main window. The AT command "AT+CPIN?" is used to
query whether the mobile phone or GSM modem is waiting for a
PIN (personal identification number, i.e. password). If the
response is "+CPIN: READY", it means the SIM card does not
require a PIN and it is ready for use. If my SIM card requires a
PIN, you need to set the PIN with the AT command
"AT+CPIN=<PIN>".
[
LIST OF IMPORTANT AT COMMANDS
After successfully testing the MODEM for its correct
operational state, I then set the MODEM parameters like Baud
rate, Echo off etc to enable easier access via a microcontroller
which I used in this project. The following are the
ATCOMMAND used for programming the gsm modem
50
place the Data bus into reverse direction. Therefore I had wire
the R/W line of the LCD panel, into write mode. This will cause
no bus conflicts on the data lines. As a result I cannot read back
the LCDs internal Busy Flag which tells us if the LCD has
accepted and finished processing the last instruction [20]. This
problem is overcome by inserting known delays into my
program. The 10k Potentiometer controls the contrast of the
LCD panel. Nothing fancy here.
I used a power supply of 5volt. The user may select whether the
LCD is to operate with a 4-bit data bus or an 8- bit data bus. If a
4-bit data bus is used, the LCD will require a total of 7 data
lines. If an 8-bit data bus is used, the LCD will require a total of
11 data lines [20]. LCD with 8-bit data bus is used for this
design. The three control lines are EN, RS, and RW. EN line
must be raised/lowered before/after each instruction sent to the
LCD regardless of whether that instruction is read or write text
53
54
55
Test
Result
meeting by 2pm
12345 I want
2pm
to see Mr. I want to see Mr. Musa
Musa
12345 I will not come to I will not come to school
school today
today
12345 I am in India
I am in India
Please hurry up
30 minute
INITIALIZATIONS
The baud rate of the modem was set to be 9600 bps using the
HyperTerminal, The ECHO from the modem was turned off
using the command ATE0 at the HyperTerminal. For serial
transmission and reception to be possible both the DTE and
DCE should have same operational baud rates. Hence to set the
microcontroller at a baud rate of 9600bps, I set terminal count of
Timer 1 at 0FFh (clock frequency = 1.8432). The TCON and
SCON registers were set accordingly.
DISPLAY
After validity check the control flow goes into the LCD program
module to display the valid message stored in the memory. In
case of multiple valid numbers all invalid stored messages are
deleted by proper branching in the code to the delete-message
module.
PROGRAMMER
When we have to learn about a new computer we have to
familiarize about the machine capability we are using, and we
can do it by studying the internal hardware design (devices
architecture), and also to know about the size, number and the
size of the registers.
A microcontroller is a single chip that contains the processor
(the CPU), non-volatile memory for the program (ROM or
flash), volatile memory for input and output (RAM), a clock and
an I/O control unit. Also called a "computer on a chip," billions
of microcontroller units (MCUs) are embedded each year in a
myriad of products from toys to appliances to automobiles. For
59
61
62
The pin diagram of the 8051 shows all of the input/output pins
unique to microcontrollers:
63
Internal ROM 4k
clock circuits.
SIMULATOR
65
66
6. Select Project - Options and set the tool options. Note that
when the target device is selected from the Device
Database all-special options are set automatically. Default
memory model settings are optimal for most applications.
7. Select Project - Rebuild all target files or Build target.
To create a new project, simply start micro vision and
select Project=>New Project from the pulldown menus.
In the file dialog that appears, a filename and directory was
chosen for the project. It is recommended that a new directory
be created for each project, as several files will be generated.
Once the project has been named, the dialog shown in the
figure below will appear, prompting the user to select a target
device. The chip being used is the AT89S52, which is listed
under the heading Atmel.
68
69
microcontrollers.
CONCLUSION
The prototype of the GSM based display electronic notice board
was efficiently designed. This prototype has facilities to be
integrated with a display board thus making it truly mobile. The
toolkit accepts the SMS, stores it, validates it and then displays
it in the LCD module. The SMS is deleted from the phone each
time it is read, thus making room for the next SMS. The major
constraints incorporated are the use of * as the termination
70
again.
A leg of the crystal oscillator was broken during mounting.
So it has to be replaced.
LED`s get damaged when we switched ON the supply so
we replace it by the new one.
TROUBLESHOOT
Care should be taken while soldering. There should be no
shorting of joints.
Proper power supply should maintain.
71
FUTURE IMPROVEMENT
Control
the
home
device
by
utilizing
AT
72
REFERENCES
1. The 8051Microcontroller by Kenneth J. Ayala
2. The 8051 Microcontroller and Embedded Systems by
Muhammad Ali Mazidi.
3. Principles and Applications of GSM by Vijay Garg.
4. Artificial Intelligence Elain Rich & Kevin Knight, Tata Mc
Graw Hill, 2nd Edition.
5. Artificial Intelligence A Modern approach Slaurt Russel
and Peter Norving, Pearson Education, 2nd Edition.
6. Introduction to Robotics P.J.Mc Kerrow, Addisson Wesley,
USA,
1991
Bernard
Sklar,
Digital
Communications:
Mobile
Network
(PLMN).
European
10. GSM
Multiple
Access
Scheme,
http://www.eecg.toronto.edu/~nazizi/gsm/ma/
William
Equipment
(SIM-ME)
Interface.
European
Course on Computer
Zimmermann
and
A.
Kirsch,
The
AN/GSC-
C168
http://developer.motorola.com/getDocument.do?docId=65054
20. http://www.mobilegpsonline.com/downloads/GM2829%20Datasheet%20R1G.pdf
21. http://www.mobilegpsonline.com/GSMJC01Spec.pdf
22. http://www.visualgsm.com/wire_sms_index.htm
23. http://en.wikipedia.org/wiki/Gsm
75
76