EMBEDED SYSYEMS SECTION: GLOBAL SYSTEM FOR MOBILE TECHNOLOGY (GSM)
BY NANDEESH.V NANDIKESH.H.P ELECTRONICS AND COMMUNICATION ENGG
SIDDAGANGA INSTITUTE OF TECHNOLOGY TUMKUR KARNATAKA
EMAIL:
[email protected] PHONE: 91-9742020079
1
ABSTRACT:
Embedded systems have grown tremendously in recent years, not only in their popularity but also in their complexity. Gadgets are increasingly becoming intelligent and autonomous. Refrigerators, air-conditioners, automobiles, mobile phones etc are some of the common examples of devices with built in intelligence. These devices function based on operating and environmental parameters. The intelligence of smart devices resides in embedded systems. An embedded system, in general, in co-operates hardware, operating systems, low-level software binding the operating system and peripheral devices, and communication software to enable the device to perform the pre-defined functions. An embedded system performs a single, well-defined task, is tightly constrained, is reactive and computes results in real time. The main principle behind this PPT is to develop a module for Home Automation and Security system mainly in a Home and Industry using Industrial Sensors and transfer the related sensed data using the latest Global System for Mobile Technology (GSM), which intimates the unauthorized entry\Smoke, and Temperature to the Embedded -Controller. The Embedded -Controller maintains the security system, so its present information sends to the user for further investigation.
1.1 INTRODUCTION TO EMBEDDED SYSTEMS
their
complexity.
becoming
Gadgets
intelligent
are
and
increasingly autonomous.
Refrigerators, air-conditioners, automobiles, mobile Embedded systems have grown tremendously in
phones etc are some of the common examples of
recent years, not only in their popularity but also in
devices with built in intelligence. These devices
2
function based on operating and environmental
environment and must compute certain
parameters.
results in real time without delay.
The intelligence of smart devices resides in embedded systems. An embedded system, in general, in cooperates hardware, operating systems, low-level software binding the operating system and
peripheral
devices,
and
communication
software to enable the device to perform the predefined functions. An embedded system performs a single, well-defined task, is tightly constrained, is reactive and computes results in real time.
embedded systems: functioned:
An
and the kinds of microprocessors used in them are quite varied. A list of some of the common microprocessor families is the ZILOG Z8 family, Intel 805/80188/x 86 families, Motorola 68k family and the PowerPC family.The software for the embedded
systems
is
called
firmware. The
firmware will be written in assembly languages for time or or using higher-level languages like C or embedded C.
Let us take a detailed look at these features of
Single
All embedded systems need a microprocessor,
1.2 HOME AUTOMATION AND SECURITY SYSTEM
embedded
system executes a specific program
The main principle of this project is to develop a
repeatedly. For example, a pager is
module for Home Automation and Security system
always a pager. In contrast a desktop
mainly in a Home and Industry using Industrial
system executes a variety of programs
Sensors and transfer the related sensed data using
like spreadsheets, word processors, etc.
the latest Global System for Mobile Technology
However there are exceptions where in
(GSM),
an embedded system’s program is
entry\Smoke, and Temperature to the Embedded
updated with newer program versions.
-Controller. The Embedded -Controller maintains
Cell phones are examples of being
the security system, so its present information sends
updated in such a manner.
to the user for further investigation.
which
intimates
the
unauthorized
Tightly constrained: All computing
The Home Automation and security system, The
systems have constraints on design
Embedded-Controller module is to control the
metrics but those on
embedded
whole module for security purpose. The GSM TX-
systems can be especially tight. A
Modem, The GSM RX-Modem, The unauthorized
design metric is a measure of an
entry, fire detected and variation in the temperature
implementation’s features, such as cost,
after being sensed will be fed to the Embedded-
size performance and power.
Controller which is responsible for processing the
Reactive
and
real
time:
Many
data and gives input to the GSM Modem at Disaster
embedded systems must continually
Base Station. The transmitted data will be received
react to changes in the system’s
through the Short Messaging Service (SMS) at the 3
GSM RX-Modem. The GSM-RX Modem decodes
The system has been designed which is based on
the data and transfers it to the user, which maintains
wireless communication embedded system. The
the security for Home or industry. Relay is used to
design provides the necessary control for the
control the device.
working of home automation and security system.
In Home automation, the devices consist of GSM modem, microcontroller, sensors, relays, memory and displays. If the user want s to control some devices in his house he/she have to send the SMS indicating the operation of the device and then the system password, while the MODEM embedded with the system microcontroller receives SMS the microcontroller will read the SMS and check for
The control software program is written in ‘Embedded C’.The program has the capability of sending and receiving the SMS from and to the user mobile via GSM modem to tell that unauthorized entry/smoke has detected in case of security system and to control some devices in case of automation system respectively. The program also provides the display of current status of the system.
the password the user had sent with the SMS, the passwords
are
stored
in
memory,
so
the
microcontroller will read the password from the memory and compares with the message password.
The fundamental requirements of the system design are as follows: •
from and to the user mobile.
If the password is correct then it will check whether the message is for switch ON or OFF the devices.
GSM modem to send and receive the SMS
•
According to the received message the controller
Sensors
to
detect
unauthorized
entry/smoke.
will switch on/off the relay. • In Security system, the device connected to the
ADC
to
convert
sensed
voltage
to
correspond digital values.
sensors. When somebody had entered home forcibly, the sensor connected to the door will
•
the system.
detect the presence of person, and it will give an interrupt to the microcontroller. Then according to the program load in the flash, the controller will find out from which sensor the interrupt had came,
LCD display to display the current status of
•
UART for the serial communication.
•
Microcontroller for the entire operation of
then it will sent SMS to the owners mobile or
the system.
police by retrieving the phone numbers from memory where numbers are stored in it.
•
A range of voltage levels to compare with the sensed voltage.
2.1 SYSTEM DESCRIPTION
4
2.2 BLOCK DIAGRAM
TRANS-RECEIVER OF USER
TRANS-RECEIVER OF SYSTEM
Fig 1. Block Diagram of Home Automation & Security System
5
2.3 BLOCK DIAGRAM DESCRIPTION
LCD’s can add a lot to your application in terms of providing an useful interface for the user, debugging an application or just giving it a
COMPONENT DETAILS:
"professional" look. The most common type of
POWER SUPPLY:
LCD controller is the Hitachi 44780 which provides
The microcontroller and other devices get power supply from AC to Dc adapter through 7805, 5 volts regulator. The adapter output voltage will be 12V DC non regulated. The 7805/7812 voltage regulators are used to convert 12 V to 5V/12V DC. MICROCONTROLLER-AT89C52:
CMOS 8-bit microcontroller with 8K bytes of insystem programmable Flash memory. The device is using
Atmel’s
high-density
nonvolatile memory technology and is compatible with the industry- standard 80C51 instruction set and pinout. LCD (LIQUID CRYSTAL DISPLAY):
and an LCD. Using this interface is often not attempted
by
inexperienced
designers
and
programmers because it is difficult to find good documentation
on
the
interface,
initializing
interface can be a problem and the displays themselves are expensive.LCD has single line
The AT89C52 is a low-power, high-performance
manufactured
a relatively simple interface between a processor
display, Two-line display, four line display. Every line has 16 characters. RS 232 CONVERTOR (MAX 232N): This is the device, which is used to convert TTL/RS232 vice versa. RS-232 was created for one purpose, to interface between Data Terminal Equipment (DTE) and Data Communications Equipment (DCE) employing serial binary data interchange. So as stated the DTE is the terminal or computer and the DCE is the modem or other communications device. RS-232 pin-outs for IBM compatible computers are shown below. There are two configurations that are typically used: one for a 9-pin connector and the other for a 25-pin connector. EXTERNAL EEPROM MEMORY (2K BYTES): These memory devices are used to store the data for off line process. The AT24C02A provides 2048bits
of
serial
electrically
erasable
and
programmable read only memory (EEPROM) 6
organized as 256words of 8 bits each. The device is
embedded or plugged into any application. The
optimized
and
Smart Modem can be controlled and customized to
commercial applications where low power and low
various levels by using the standard AT commands.
voltage operation are essential. The AT24C02Ais
The modem is fully type-approved, it can speed up
available in space saving 8-pin PDIP.
the operational time with full range of Voice, Data,
for
use
in
many
industrial
Fax and Short Messages (Point to Point and Cell Broadcast), the modem also supports GPRS (Class SENSORS: Here we are using 3 types of sensors. PIR sensor
2*) for spontaneous data transfer. RELAYS:
(Passive infra red sensor) is used to detect the
A relay is used to isolate one electrical circuit
movement. Smoke sensor (Passive infra red
from another. It allows a low current control circuit
sensor) is used to detect the presence of smoke and
to make or break an electrically isolated high
the temperature sensor is used to detect the
current circuit path. Here, it act as a switch between
temperature.
the microcontroller and a device.
GSM MODEM: Semen’s GSM/GPRS Smart Modem is a multifunctional, ready to use, rugged unit that can be
7
2.4 CIRCUIT DIAGRAM
8
3.1 SOFTWARE DESCRIPTION 9
Home automation and security system without software is of little use and hardware with poor software can be worse. The software developed for this project is user friendly. The code is written in ‘EMBEDDED C (KEIL SOFTWORE).
the elements of the 8051 architecture. These C programs are referred as Embedded C programs. UP loader 4.0: This Up-loader is used to flash some of the Micro-Controllers. It Supports only 8051, Atmel
Software requirements:
89c51, 89c52 & 89c55wd. This Up-Loader is used
Keil µVision2 IDE:
to flash the Microcontroller via Hex file and then it
Keil µVision2 IDE (Integrated Development Environment) is a Windows based front end for the C Compiler and assembler. Keil µVision2 is used for writing embedded C programswhich is
verify the written Hex code to the flash memory. The flashing time is faster when we use the uploader. This up-loader is very much compact. Embedded C:
explained later.. Embedded C is a high level language, which includes many aspects of the ANSI (American
National
Standard
Institute)
C
programming language. Standard libraries are altered or enhanced to address the peculiarities of an embedded target processor. Cx51 cross compiler: Cx51 is a cross compiler to compile C programs for your target 8051 environment and provides several extensions to ANSI Standard C to support
10
The C programming language is a generalpurpose programming language that provides code efficiency, elements of structured programming, and a rich set of operators. Its generality combined with its absence of restrictions, makes C a convenient and effective programming solution for a wide variety of software tasks. Many applications can be solved more easily and efficiently with C than with other more specialized languages. Cx51 is not a universal C compiler adapted for the 8951 target.
3.3 FLOW CHART
HOME AUTOMATION SYSTEM:
START
INTIALIZE MODEM
INTIALIZE µC
POLLING
IS PASSWOR D
CHECK FOR DEVICE OPERATION SENT BY USER
A
11
A
IS D1/D2
TURN ON THE DEVICE D1/D2
IS D1/D2
TURN ON THE DEVICE D1/D2
STOP
12
SECURITY SYSTEM:
START
CHECK FOR DEVICE STATUS
STORE THE USER MOBILE NUMBER
POLLING
ONE OF THE SENSORS GET INTERUPTED
µC WILL GET INTERRUPT
ACCORDING TO CODE ACTION, CONTROLLER SENDS SMS TO USER MOBILE
STOP
MICROCONTROLLER 13
nonvolatile memory programmer. The Atmel AT89C52 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. It also provides 32 I/O lines, 256bytes of RAM for data storage.
FEATURES:
Fig 4 pin configuration of AT89C52
•
Compatible with MCS-51™ Products
•
8K Bytes of In-System Reprogrammable Flash
Figure above shows the pinout of 89C52
Memory
µc.The AT89C52 is a low-power, high-performance
•
Endurance: 1,000 Write/Erase Cycles
CMOS 8-bit microcomputer with 8K bytes of Flash
•
Fully Static Operation: 0 Hz to 24 MHz
•
Three-level Program Memory Lock
•
256 x 8-bit Internal RAM
technology and is compatible with the industry-
•
32 Programmable I/O Lines
standard MCS-51 instruction set and pin out. The
•
Three 16-bit Timer/Counters
on-chip Flash allows the program memory to be
•
Six Interrupt Sources
programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s
high-density
nonvolatile
memory
reprogrammed in-system or by a conventional
BLOCK SCHEMATIC OF AT89C52:
14
Fig 5 Block schematic of AT89C52 1. The lower 128bytes of RAM (addresses 00H to 7FH) are directly and indirectly addressable. The four segments are: 15
2. The upper 128 bytes of RAM (addresses 80H to
•
FFH) are indirectly addressable only. 3.
The special function registers, (SFR’s)
B REGISTER: The B register is used during multiply
and
divide
operations
for
other
(addresses 80H to FFH) are directly addressable
instructions it can be treated as another
only.
scratch pad register.
4. 256 bytes expanded RAM (ERAM, 00H-FFH) is
•
PSW (PROGRAM STATUS REGISTER):
indirectly accessed by MOVX instruction and with The PSW contains several status bits that reflect
the EXTRAM bit cleared.
the current state of the cpu. The psw resides in the Either direct or indirect addressing can access the lower 128 bytes.
SFR space.
The upper 128 bytes can be
accessed indirect addressing only. The upper 128
•
bytes occupy the same address but are physically separate from the SFR space. When an instruction accesses an internal location above address 7FH, the CPU knows whether the accesses is to the upper 128 bytes of data RAM or to SFR space by the direct addressing mode used in the instruction. Instructions that use direct addressing access SFR
STACK POINTER: This is of 8-bit wide. It is incremented before data
is stored during PUSH and CALL executions. While the stack pointer may any where in on chip RAM the stack pointer is initialized to 07h after a reset. This causes the stack to begin at location 08h. •
DATA POINTER (DPTR):
space. For example MOV OAOH, #data. This consists of a high type and a low byte. Its SFR (SPECIAL FUNCTION REGISTER): A map of the on-chip memory area is called the special function registers (SFR) space. Note that in the SFR's not all the addresses are occupied.
intended function is to hold a 16-bit address. It may be manipulated as a 16-bit register or as two independent 8-bit registers. •
PORTS 0 TO 3:
Unoccupied addresses are not implemented on the Read accesses to these addresses will in
P0, P1, P2, and P3 are the SFR of ports 0,1,2 & 3
general return random data and write accesses will
respectively. Writing a one of a port SFR causes the
have no-effect.
port output pin to switch low. When used as an
chip.
The functions of SFR's are
described as follows:
input, the external state of a pin will be held in the port SFR.
•
ACCUMULATOR: •
SERIAL DATA BUFFER:
Acc is the accumulator register. The mnemonics for accumulator, specific Instructions. However,
The serial buffer is actually two separate registers
refer to the accumulator simply as "A".
transmit buffer and a receive buffer. When data is
16
involved to SBUF. It goes to transmit buffer and is
The Global System for Mobile communications
held for serial transmission. When data is moved
(GSM: originally from Group Special Mobile) is
from SBUF. It comes from SBUF. It comes the
the most popular standard for mobile phones in the
receive buffer.
world. Over 2 billion people use GSM service
•
across more than 212 countries and territories. Its
TIMER REGISTER BASIC TO 89C51:
ubiquity makes international roaming very common
Register pins (TH0, TL0), (TH1, TL1), (TH2, TL2)
between
mobile
are 16-bit counting registers for timer/counters 0,
subscribers to use their phones in many parts of the
1&2, respectively.
world.
GSM
phone
differs
operators,
significantly
enabling from
its
predecessors in that both signaling and speech •
CONTROL REGISTER FOR THE 89C51:
SFR, IP, IE, TMOD, SCON and PCON contain and status
bits
for
the
interrupt
system.
The
timer/counters and the serial port.
channels are digital call quality, and so is considered a second generation (2G) mobile phone system.
This
has
also
meant
that
data
communication was built into the system from the 3rd Generation Partnership Project (3GPP). The key advantage of GSM systems to consumers has been higher digital voice quality and low cost
4.2 GLOBAL SYSTEM FOR MOBILE COMMUNICATION
alternatives to making calls, such as the Short message
service
(SMS,
also
called
"text
messaging"). The advantage for network operators has been the ease of deploying equipment from any vendors that implements the standard. [3] Like other cellular standards, GSM allows network operators to offer roaming services so that subscribers can use their phones on GSM networks all over the world. Newer versions of the standard were backward compatible with the original GSM phones. For example, Release '97 of the standard added packet data capabilities, by means of General Packet Radio Service (GPRS). Release '99 introduced higher speed data transmission using Enhanced Data Rates for GSM Evolution (EDGE). History of GSM 17
The growth of cellular telephone systems started
Europe.
In
1989,
GSM
responsibility
was
in the early 1980s, particularly in Europe. The lack
transferred to the European Telecommunications
of a technological standardization prompted the
Standards Institute (ETSI), and phase I of the GSM
European
and
specifications was published in 1990. Radiolinja in
Telecommunications Administrations (CEPT) to
Finland launched the first GSM network in 1991.
create the Group Special Mobile (GSM) in 1982
By the end of 1993, over a million subscribers were
with the objective of developing a standard for a
using GSM phone networks being operated by 70
mobile telephone system that could be used across
carriers across 48 countries.
GSM Modem
GSM. The data communication was of secondary
Conference
of
Postal
importance to this network but to support this also, designers have considered the circuit switching
Anten
Serial
itself the mechanism for transmitting data packets.
GSM MODEM FIG 6 SIMPLE BLOCK DIAGRAM OF GSM Microcontr
GSM Architecture
MODEM FIG 6 GSM Architecture
GSM modem is the medium by which the user can interact with the module. It is used to send and receive SMS based on which appropriate actions
•
are taken by the controller. Figure above a simple block diagram of it.
Figure above shows the schematic of GSM Architecture. The Mobile Station (MS) directly interacts with one of the
GSM Network
Base Transceiver Stations, which in
The GSM network was designed keeping in mind
turn interacts with a Base Station
the voice activities of the user and its main purpose
Controllers (BSC). BTS and BSC
was to provide voice connectivity like Public
combined together forms the BSS.
Switched Telephone Networks but with mobility.
More than one BTSs are connected
So Call Processing activities were the major criteria
with one BSC. The BSC further
to decide and fix the implementation standards of
interacts
Handset
HLR/ VLR
UM A-bis
BSC
A
MSC
SS7 PSTN
BTS
OMC (Operation & Maintenance Center) Operation Terminal
18SIM card Mobile station
X.25
Radio sub-system
Network sub-system
Data Terminal
PSTN
with
Mobile
Station
•
Controller (MSC), which is the heart of
If the SIM detect pin indicates “present”,
the GSM network. MSC further gives
and the inserted Card is not a SIM Card,
connectivity to the PSTN and other
the response to AT+CPIN? is CME
PLMNs. MSC is also responsible to
ERROR 10.
interact with HLR and VLR, which
•
These last two states are not given
form the Permanent and Temporary
immediately
data bases for all the subscribers static
initialization. Between the hardware SIM
and
detect pin indicating “present” and the
dynamic
information.
due
to
background
previous results the AT+CPIN? sends “+CME ERROR: 515” (Please wait, init in progress). •
When the SIM detect pin indicates card absence, and if a SIM Card was previously
General Behaviors
inserted, an IMSI detach procedure is SIM Insertion, SIM Removal
performed, all user data is removed from the product (Phonebooks, SMS etc.). The
SIM card Insertion and Removal procedures are supported. There are software functions relying on positive reading of the hardware SIM detect pin.
product then switches to emergency mode. Attention (AT) Commands
This pin state (open/closed) is permanently
GSM modem can be controlled by standard set of
monitored. When the SIM detect pin indicates that
AT (Attention) commands. These commands can be
a card is present in the SIM connector, the product
used to control majority of the functions of GSM
tries to set up a logical SIM session. The logical
modem. Few commands used in this project are
SIM session will be set up or not depending on
described in the chapter APPENDIX.
whether the detected card is a SIM Card or not. The AT+CPIN?
command
delivers
the
following
.
5. ADVANTAGES AND APPLICATIONS
responses: •
If the SIM detect pin indicates “absent”, the response to AT+CPIN? Is “+CME ERROR 10” (SIM not inserted).
•
ADVANTAGES: We can access the devices such as home appliances remotely.
If the SIM detect pin indicates “present”, and the inserted Card is a SIM Card, the
We can detect the unauthorized
response to AT+CPIN? is “+CPIN: xxx”
smoke/entry even if we are not present in
depending on SIM PIN state.
home. Easy to implement. 19
APPLICATIONS:
BIBLIOGRAPHY
Automation and security system is required at: Frank Wahid, Embedded System Home
Muhammad Ali Mazidi, The 8051 Microcontroller and Embedded System
Office
V.K. Mehta, Principles of Electronics Industry Power plants Other valuable areas
6. CONCLUSION
The designed home automation and security system has been successfully demonstrated by connecting GSM modem and sending/receiving the SMS by using GSM mobile from/to the system via GSM modem. The LCD display will display the correct current status of the system. This project is easy to implement and it has become one of the modern wireless privacy system. 7. SCOPE FOR FURTHER IMPLEMENTATIONS
In future we can add a multimedia camera to see what is going inside the home by sitting in office or some where.
We can voice recorder for IR Sensor’s detection
20
www.atmel.com www.electronicsforyou.com