Upload
dhanshrideshmukh
View
31.876
Download
2
Embed Size (px)
Citation preview
[MGM’s COE NANDED] Page 1
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Chapter 1
INTRODUCTION
1.1 INTRODUCTION TO GSM
A digital mobile telephony system, which is globally accessed by more than 212
countries and territories. Global system for mobile communication is completely
optimized for full duplex voice telephony. Initially developed for the replacement of
first generation (1G) technology, now GSM is available with lots of salient features
with the constant up gradation of third generation (3G) technology. And now with the
alliance of microcontroller, GSM MODEM could be further tailor-made for some of
very innovative applications including GSM based Wireless electronic notice board ,
GSM based DC motor controller, GSM based home security system, GSM based
robot control, GSM based voting machine control, GSM based stepper motor
controller etc.
1.2 INTRODUCTION TO EMBEDDED SYSTEM
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.
Let us take a detailed look at these features of embedded systems:
Single functioned: An embedded system executes a specific program repeatedly. For
example, a pager is always a pager. In contrast a desktop system executes a variety of
programs like spreadsheets, word processors, etc. However there are exceptions
where in an embedded system’s program is updated with newer program versions.
Cell phones are examples of being updated in such a manner.
[MGM’s COE NANDED] Page 2
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Tightly constrained: All computing systems have constraints on design metrics but
those on embedded systems can be especially tight. A design metric is a measure of
an implementation’s features, such as cost, size performance and power.
Reactive and real time: Many embedded systems must continually react to changes in
the system’s environment and must compute certain results in real time without delay.
1.2.1 Embedded Hardware
All embedded systems need a microprocessor, 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.
1.2.2 Embedded Software
The software for the embedded systems is called firmware. The firmware will
be written in assembly languages for time or resource critical operations or using
higher-level languages like C or embedded C. The software will be simulated using
micro code simulators for the target processor. Since they are supposed to perform
only specific tasks these programs are stored in Read Only Memories (ROM’s).
1.2.3 Application areas for embedded systems
Embedded software is present in almost every electronic device you use today.
There is embedded software inside your watch, cellular phone, automobile,
thermostats, Industrial control equipment and scientific and medical equipment.
Defence services use embedded software to guide missiles and detect aircraft’s.
Communication satellites, medical instruments and deep space probes would have
been nearly impossible without these systems. Embedded systems cover such as broad
range of products that generalization is difficult.
[MGM’s COE NANDED] Page 3
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
1.2.4 Block diagram of Embedded System:
Figure 1.1: Embedded System Block Diagram
Software deals with the languages like ALP, C, and VB etc., and Hardware deals with
Processors, Peripherals, and Memory. Memory is used to store data or address.
Processor is an IC which is used to perform some task. There are four types of
processor Micro Processor (µp), Micro controller (µc),Digital Signal Processor
(DSP), Application Specific Integrated Circuits (ASIC).
Embedded
System
Software Hardware
o ALP
o C
o VB
Etc.,
o Processor
o Peripherals
o memory
[MGM’s COE NANDED] Page 4
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
CHAPTER 2
DESIGN OVERVIEW
2.1 BLOCK DIAGRAM OF GSM-BASED E-NOTICE BOARD:
Figure.2.1 Block diagram of wireless notice board
Figure.2.2 Basic Overview
[MGM’s COE NANDED] Page 5
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
2.2 HISTORY OF GSM
During the early 1980s, analog cellular telephone systems were experiencing rapid
growth in Europe, particularly in Scandinavia and the United Kingdom, but also in
France and Germany. Each country developed its own system, which was
incompatible with everyone else's in equipment and operation. This was an
undesirable situation, because not only was the mobile equipment limited to operation
within national boundaries, which in a unified Europe were increasingly unimportant,
but there was also a very limited market for each type of equipment, so economies of
scale and the subsequent savings could not be realized.
The Europeans realized this early on, and in 1982 the Conference of European
Posts and Telegraphs (CEPT) formed a study group called the Groupe Spécial
Mobile (GSM) to study and develop a pan-European public land mobile system. And
interaction with the Integrated service digital network (ISDN) which offers the
capability to extend the single-subscriber –line system with the various to a
multiservice system. The first commercial GSM system, called D2, was implemented
in Germany in 1982. This valuable channel of communication can equip us with a
powerful tool for controlling desired device or process parameter from distant
location, through electromagnetic waves. With a little effort logic can be setup to even
receive a feedback on the status of the device or the process being controlled.
2.3 SERVICES PROVIDED BY GSM
From the beginning, the planners of GSM wanted ISDN compatibility in terms of the
services offered and the control signalling used. However, radio transmission
limitations, in terms of bandwidth and cost, do not allow the standard ISDN B-
channel bit rate of 64 kbps to be practically achieved. Using the ITU-T definitions,
telecommunication services can be divided into bearer services, teleservices, and
supplementary services. The most basic teleservice supported by GSM is telephony.
As with all other communications, speech is digitally encoded and transmitted
through the GSM network as a digital stream. There is also an emergency service,
where the nearest emergency-service provider is notified by dialing three digits.
[MGM’s COE NANDED] Page 6
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
A variety of data services is offered. GSM users can send and receive data, at
rates up to 9600 bps, to users on POTS (Plain Old Telephone Service), ISDN, Packet
Switched Public Data Networks, and Circuit Switched Public Data Networks using a
variety of access methods and protocols, such as X.25 or X.32. Since GSM is a digital
network, a modem is not required between the user and GSM network, although an
audio modem is required inside the GSM network to interwork with POTS. Other
data services include Group 3 facsimile, as described in ITU-T recommendation T.30,
which is supported by use of an appropriate fax adaptor. A unique feature of GSM,
not found in older analog systems, is the Short Message Service (SMS). SMS is a
bidirectional service for short alphanumeric (up to 160 bytes) messages. Messages are
transported in a store-and-forward fashion. For point-to-point SMS, a message can be
sent to another subscriber to the service, and an acknowledgement of receipt is
provided to the sender. SMS can also be used in a cell-broadcast mode, for sending
messages such as traffic updates or news updates. Messages can also be stored in the
SIM card for later retrieval .
Supplementary services are provided on top of teleservices or bearer services.
In the current (Phase I) specifications, they include several forms of call forward
(such as call forwarding when the mobile subscriber is unreachable by the network),
and call barring of outgoing or incoming calls, for example when roaming in another
country. Many additional supplementary services will be provided in the Phase 2
specifications, such as caller identification, call waiting, multi-party conversations.
2.4 ARCHITECTURE OF THE GSM NETWORK
A GSM network is composed of several functional entities, whose functions and
interfaces are specified. Figure 1.1 shows the layout of a generic GSM network. The
GSM network can be divided into three broad parts. The Mobile Station is carried by
the subscriber. The Base Station Subsystem controls the radio link with the Mobile
Station. The Network Subsystem, the main part of which is the Mobile services
Switching Center (MSC), performs the switching of calls between the mobile users,
and between mobile and fixed network users. The MSC also handles the mobility
management operations. Not shown is the Operations and Maintenance Center, which
oversees the proper operation and setup of the network. The Mobile Station and the
Base Station Subsystem communicate across the Um interface, also known as the air
[MGM’s COE NANDED] Page 7
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
interface or radio link. The Base Station Subsystem communicates with the Mobile
services Switching Center across the A interface.
Fig. 2.3 General Architecture of a GSM Network
2.4.1 Mobile Station
The mobile station (MS) consists of the mobile equipment (the terminal) and a smart
card called the Subscriber Identity Module (SIM). The SIM provides personal
mobility, so that the user can have access to subscribed services irrespective of a
specific terminal. By inserting the SIM card into another GSM terminal, the user is
able to receive calls at that terminal, make calls from that terminal, and receive other
subscribed services. The mobile equipment is uniquely identified by the International
Mobile Equipment Identity (IMEI). The SIM card contains the International Mobile
Subscriber Identity (IMSI) used to identify the subscriber to the system, a secret key
for authentication, and other information. The IMEI and the IMSI are independent,
thereby allowing personal mobility. The SIM card may be protected against
unauthorized use by a password or personal identity number.
[MGM’s COE NANDED] Page 8
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
2.4.2 Base Station Subsystem
The Base Station Subsystem is composed of two parts, the Base Transceiver Station
(BTS) and the Base Station Controller (BSC). These communicate across the
standardized Abis interface, allowing (as in the rest of the system) operation between
components made by different suppliers. The Base Transceiver Station houses the
radio transceivers that define a cell and handles the radio-link protocols with the
Mobile Station. In a large urban area, there will potentially be a large number of BTSs
deployed, thus the requirements for a BTS are ruggedness, reliability, portability, and
minimum cost.
The Base Station Controller manages the radio resources for one or more
BTSs. It handles radio-channel setup, frequency hopping, and handovers, as described
below. The BSC is the connection between the mobile station and the Mobile service
Switching Center (MSC).
2.4.3 Network Subsystem
The central component of the Network Subsystem is the Mobile services Switching
Center (MSC). It acts like a normal switching node of the PSTN or ISDN, and
additionally provides all the functionality needed to handle a mobile subscriber, such
as registration, authentication, location updating, handovers, and call routing to a
roaming subscriber. These services are provided in conjuction with several functional
entities, which together form the Network Subsystem. The MSC provides the
connection to the fixed networks (such as the PSTN or ISDN). Signalling between
functional entities in the Network Subsystem uses Signalling System Number 7
(SS7), used for trunk signalling in ISDN and widely used in current public networks.
The Home Location Register (HLR) and Visitor Location Register (VLR),
together with the MSC, provide the call-routing and roaming capabilities of GSM.
The HLR contains all the administrative information of each subscriber registered in
the corresponding GSM network, along with the current location of the mobile. The
location of the mobile is typically in the form of the signalling address of the VLR
associated with the mobile station. The actual routing procedure will be described
later. There is logically one HLR per GSM network, although it may be implemented
[MGM’s COE NANDED] Page 9
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
as a distributed database. The Visitor Location Register (VLR) contains selected
administrative information from the HLR, necessary for call control and provision of
the subscribed services, for each mobile currently located in the geographical area
controlled by the VLR. Although each functional entity can be implemented as an
independent unit, all manufacturers of switching equipment to date implement the
VLR together with the MSC, so that the geographical area controlled by the MSC
corresponds to that controlled by the VLR, thus simplifying the signalling required.
Note that the MSC contains no information about particular mobile stations --- this
information is stored in the location registers.
The other two registers are used for authentication and security purposes. The
Equipment Identity Register (EIR) is a database that contains a list of all valid mobile
equipment on the network, where each mobile station is identified by its International
Mobile Equipment Identity (IMEI). An IMEI is marked as invalid if it has been
reported stolen or is not type approved. The Authentication Center (AuC) is a
protected database that stores a copy of the secret key stored in each subscriber's SIM
card, which is used for authentication and encryption over the radio channel.
[MGM’s COE NANDED] Page 10
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
CHAPTER 3
MICROCONTROLLER
Basically, a microcontroller is a device which integrates a number of the components
of a microprocessor system onto a single microchip. So a microcontroller combines
onto the same microchip. The components are CPU Core ,Memory (Both RAM and
ROM),Some Parallel Digital I/Os.The microprocessor is the integration of a number
of useful functions into a single IC package. Has the ability to execute a stored set of
instructions to carry out user defined tasks; also has ability to access external memory
chips to both read and write data from and to the memory.
Essentially, a microcontroller is obtained by integrating the key components of
microprocessor, RAM, ROM, and Digital I/O onto the same chip die. Modern
microcontrollers also contain a wealth of other modules such as Serial I/O, Timers,
and Analogue to Digital Converters. There are a large number of specialized devices
with additional modules for specific needs.
3.1 MICROCONTROLLER (AT89S52)
Microcontroller AT89S52 has following features ,Compatible with MCS-51 Products
8K Bytes of In-System Programmable (ISP) Flash Memory ,4.0V to 5.5V Operating
Range, Fully Static Operation: 0 Hz to 33 MHz, 256Bytes Internal RAM,32
Programmable I/O Lines,3 16-bit Timer/Counters, Full Duplex UART Serial
Channel.
3.2 DESCRIPTION OF MICROCONTROLLER AT 89S52:
The AT89S52 is a low-power, high-performance CMOS 8-bit micro controller with
8Kbytes of in-system programmable Flash memory. The device is manufactured
using Atmel’s high-density non-volatile memory technology and is compatible with
the industry-standard 80C51 micro controller. The on-chip Flash allows the program
memory to be reprogrammed in-system or by a conventional non-volatile memory
programmer. By combining a versatile 8-bit CPU with in-system programmable flash
[MGM’s COE NANDED] Page 11
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
one monolithic chip; the Atmel AT89S52 is a powerful micro controller, which
provides a highly flexible and cost- effective solution to many embedded control
applications.
Fig. 3.1 Block Diagram of AT 89S52 microcontroller
[MGM’s COE NANDED] Page 12
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Fig.3.2 pin configuration
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, full duplex serial port, on-chip oscillator, and clock circuitry. In
addition, the AT89S52 is designed with static logic for perationdown 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.
[MGM’s COE NANDED] Page 13
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
3.3 PIN DESCRIPTION OF MICROCONTROLLER AT89S52
VCC: Supply voltage.
GND:Ground.
Port 0: Port 0 is an 8-bit open drain bi-directional I/O port. As an output port,
each pin can sink eight TTL inputs. When 1sare 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 bi-directional 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. 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 .
Table.3.1 Port 1 functions
Port 2: Port 2 is an 8-bit bi-directional 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. 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
[MGM’s COE NANDED] Page 14
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to
external data memory that use 8-bit addresses (MOVX @ RI), Port 2emits 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 bi-directional 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 also serves the functions of various special
features of the AT89S52, as shown in the following table. Port 3 also receives
some control signals for Flash programming and verification.
Table. 3.2 port 3 functions
RST:Reset input. A high on this pin for two machine cycles while the oscillator is
running resets the device.
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 of1/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
[MGM’s COE NANDED] Page 15
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
pulled high. Setting the ALE-disable bit has no effect if the micro controller 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. A should be strapped to VCC for internal program
executions. This pin also receives the 12-voltProgramming enables 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.
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 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 2.
Fig.3.3 circuit diagram of crystal oscillator
[MGM’s COE NANDED] Page 16
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
3.4 Microcontroller – MODEM Interfacing
3.4.1 DTE and DCE
The terms DTE and DCE are very common in the data communications market. DTE
is short for Data Terminal Equipment and DCE stands for Data Communications
Equipment. But what do they really mean? As the full DTE name indicates this is a
piece of device that ends a communication line, whereas the DCE provides a path for
communication. Let's say we have a computer on which wants to communicate with
the Internet through a modem and a dial-up connection. To get to the Internet you tell
your modem to dial the number of your provider. After your modems has dialed the
number, the modem of the provider will answer your call and your will hear a lot of
noise. Then it becomes quiet and you see your login prompt or your dialing program
tells you the connection is established. Now you have a connection with the server
from your provider and you can wander the Internet. In this example you PC is a Data
Terminal (DTE). The two modems (yours and that one of your provider) are DCEs,
sthey make the communication between you and your provider possible. But now we
have to look at the server of your provider.
Is that a DTE or DCE? The answer is a DTE. It ends the communication line between
you and the server. When you want to go from your provided server to another place
it uses another interface. So DTE and DCE are interfacing dependent. It is e.g.
possible that for your connection to the server, the server is a DTE, but that that same
server is a DCE for the equipment that it is attached to on the rest of the Net.
3.4.2 RS-232
In telecommunications, RS-232 is a standard for serial binary data signals connecting
between a DTE (Data terminal equipment) and a DCE (Data Circuit-terminating
Equipment). It is commonly used in computer serial ports. In RS-232, data is sent as a
time-series of bits. Both synchronous and asynchronous transmissions are supported
by the standard. In addition to the data circuits, the standard defines a number of
control circuits used to manage the connection between the DTE and DCE. Each data
or control circuit only operates in one direction that is, signaling from a DTE to the
attached DCEor the reverse. Since transmit data and receive data are separate circuits,
the interface can operate in a full duplex manner, supporting concurrent data flow in
[MGM’s COE NANDED] Page 17
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
both directions. The standard does not define character framing within the data
stream, or character encoding.
Fig 3.4 Female 9 pin plug
Table.3.3 RS232 signals
3.4.3 RS-232 Signals
Transmitted Data (TxD) :Data sent from DTE to DCE.
Received Data (RxD) :Data sent from DCE to DTE.
Request To Send (RTS) :Asserted (set to 0) by DTE to prepare DCE to receive data.
This may require action on the part of the DCE, e.g. transmitting a carrier or reversing
the direction of a half-duplex line.
[MGM’s COE NANDED] Page 18
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Clear To Send (CTS): Asserted by DCE to acknowledge RTS and allow DTE to
transmit.
Data Terminal Ready (DTR): Asserted by DTE to indicate that it is ready to be
connected. If the DCE is a modem, it should go "off hook" when it receives this
signal. If this signal is deasserted, the modem should respond by immediately hanging
up.
Data Set Ready (DSR): Asserted by DCE to indicate an active connection. If DCE is
not a modem (e.g. anull-modem cable or other equipment), this signal should be
permanently asserted (set to 0), possibly by a jumper to another signal.
Carrier Detect (CD): Asserted by DCE when a connection has been established with
remote equipment.
Ring Indicator (RI) :Asserted by DCE when it detects a ring signal from the
telephone line.
3.4.4 RTS/CTS Handshaking
The standard RS-232 use of the RTS and CTS lines is asymmetrical. The DTE asserts
RTS to indicate a desire to transmit and the DCE asserts CTS in response to grant
permission. This allows for half-duplex modems that disable their transmitters when
not required, and must transmit a synchronization preamble to the receiver when they
are reenabled. There is no way for the DTE to indicate that it is unable to accept data
from the DCE. A non-standard symmetrical alternative is widely used: CTS indicates
permission from the DCE for the DTE to transmit, and RTS indicates permission from
the DTE for the DCE to transmit. The "request to transmit" is implicit and continuous.
The standard defines RTS/CTS as the signaling protocol for flow control for data
transmitted from DTE to DCE. The standard has no provision for flow control in the
other direction. In practice, most hardware seems to have repurposed the RTS signal
for this function. A minimal “3-wire” RS-232 connection consisting only of transmits
data, receives data and ground, and is commonly used when the full facilities of RS-
232 are not required. When only flow control is required, the RTS and CTS lines are
added in a 5-wire version. In our case it was imperative that we connected the RTS
line of the microcontroller (DTE) to ground to enable receipt of bit streams from the
modem.
[MGM’s COE NANDED] Page 19
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
3.4.5 Specifying Baud Rate, Parity & Stop bits
Serial communication using RS-232 requires that you specify four parameters: the
baud rate of the transmission, the number of data bits encoding a character, the sense
of the optional parity bit, and the number of stop bits. Each transmitted character is
packaged in a character frame that consists of a single start bit followed by the data
bits, the optional parity bit, and the stop bit or bits. A typical character frame encoding
the letter "m" is shown here. Character Frame Encoding ‘m’ We specified the
parameters as baud rate – 4800 bps, 8 data bits, no parity, and 1 stop bit. This was set
in pre-operational phase while setting up the modem through the hyper terminal, as
per the serial transmission standards in 8051 microcontroller.
Fig.3.5 Character Frame Encoding ‘m’
3.4.5.1. DCE Baud Rates
110,300,1200,2400,4800,9600,19200,38400,57600,115200,230400,460800,921600
(Possible Baud Rates)
Baud Rate Used Power on default rate
[MGM’s COE NANDED] Page 20
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
3.5 Microcontroller – LCD Interfacing
Fig.3.6 LCD Interfacing
Above is the quite simple schematic. The LCD panel’s Enable and Register Select is
connected to the Control Port. The Control Port is an open collector / open drain
output. While most Parallel Ports have internal pull-up resistors, there are a few which
don’t. Therefore by incorporating the two 10K external pull up resistors, the circuit is
moreportable for a wider range of computers, some of which may have no internal
pull up resistors. We make no effort to place the Data bus into reverse direction.
Therefore we hard 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 we cannot read back the LCD’s
internal Busy Flag which tells us if the LCD has accepted and finished processing the
last instruction. This problem is overcome by inserting known delays into our
program. The 10k Potentiometer controls the contrast of the LCD panel. Nothing
fancy here. As with all the examples, I’ve left the power supply out. You can use a
bench power supply set to 5v or use a onboard +5 regulator.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. The three control lines are EN, RS,
and RW. Note that the EN line must be raised/lowered before/after each instruction
sent to the LCD regardless of whether that instruction is read or write text or
instruction. In short, you must always manipulate EN when communicating with the
LCD. EN is the LCD’s way of knowing that you are talking to it. If you don’t
raise/lower EN, the LCD doesn’t know you’re talking to it on the other lines.
[MGM’s COE NANDED] Page 21
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
3.6 LIQUID CRYSTAL DISPLAY
A liquid crystal display (LCD) is a thin, flat display device made up of any number of
color or monochrome pixels arrayed in front of a light source or reflector. Each pixel
consists of a column of liquid crystal molecules suspended between two transparent
electrodes, and two polarizing filters, the axes of polarity of which are perpendicular
to each other. Without the liquid crystals between them, light passing through one
would be blocked by the other. The liquid crystal twists the polarization of light
entering one filter to allow it to pass through the other.For an 8-bit data bus, the display
requires a +5V supply plus 11 I/O lines. For a 4-bit data bus it only requires the supply
lines plus seven extra lines. When the LCD display is not enabled, data lines are tri-state
and they do not interfere with the operation of the microcontroller.
Data can be placed at any location on the LCD. For 16×2 LCD, the address
locations
First
line
80 81 82 83 84 85 86 through 8F
Second
line
C0 C1 C2 C3 C4 C5 C6 through CF
Table. 3.4 Address location for a 2/16 line LCD
3.6.1 SIGNAL TO LCD
The LCD also requires 3 control lines from the microcontroller:
A. Enable:This line allows access to the display through R/W and RS lines. When
this line is low, the LCD is disabled and ignores signals from R/W and RS. When
(E) line is high, the LCD checks the state of the two control lines and responds
accordingly
B. Read/Write(R/W):This line determines the direction of data between the
LCD and microcontroller.When it is low, data is written to the LCD. When
it is high, data is read from LCD.
C. Register select(RS):With the help of this line, the LCD interprets the type of
data on data lines. When it is low, an instruction is being written to the LCD.
[MGM’s COE NANDED] Page 22
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
3.6.2 writing and reading the data from LCD
Writing data to the LCD is done in several steps:
1) Set R/W bit to low
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low Read data from data lines (if it is reading)
1) Set R/W bit to high
2) Set RS bit to logic 0 or 1 (instruction or character)
3) Set data to data lines (if it is writing)
4) Set E line to high
5) Set E line to low
3.7 PIN DESCRIPTION
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins
(two pins are extra in both for back-light LED connections).
Fig.3.7 Basic LCD Interfacing Circuit
[MGM’s COE NANDED] Page 23
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Table.3.5 Pin Configuration of 16X2 Lcd
[MGM’s COE NANDED] Page 24
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Table 3.5 Control Codes of LCD
[MGM’s COE NANDED] Page 25
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
CHAPTER 4
HARDWARE PROFILE
4.1 BLOCK DIAGRAM OF WIRELESS NOTICE BOARD
Fig.4.1 block diagram of wireless notice board
[MGM’s COE NANDED] Page 26
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
4.2 POWER SUPPLY
The power supply unit is used to provide a constant 5V of DC supply from a 230V of AC
supply. These 5V DC will acts as power to different standard circuits. It mainly consists of
follwing blocks.
Fig. 4.2 Block Diagram Of Power Supply
4.2.1 BRIDGE WAVE RECTIFIER
A rectifier is an electrical device that converts alternating current (AC) to direct current
(DC), a process known as rectification. The term rectifier describes a diode that is being
used to convert AC to DC. A bridge-wave rectifier converts the whole of the input
waveform to one of constant polarity (positive or negative) at its output. Bridge-wave
rectifier converts both polarities of the input waveform to DC (direct current), and is more
efficient. However, in a circuit with a center tapped transformer (9-0-9) is used.
Fig.4.3 Bridge Wave Rectifier
For single-phase AC, if the transformer is center-tapped, then two diodes back-to-back(i.e.
anodes-to-anode or cathode-to-cathode) can form a full-wave rectifier. Many windings are
required on the transformer secondary to obtain the same output voltage.
[MGM’s COE NANDED] Page 27
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
In this only two diodes are activated at a time i.e. D1 and D3 activate for positive cycle
and D2 and D4 activates for negative half cycle. D2 and D4 convert negative cycle to
positive cycle as it as negative supply and negative cycle as positive cycle at its output.
4.2.2 VOLTAGE REGULATOR
This is most common voltage regulator that is still used in embedded designs.
LM7805 voltage regulator is a linear regulator. With proper heat sink these LM78xx
types can handle even more than 1A current. They also have Thermal overload
protection, Short circuit protection. This will connect at the output of rectifier to get
constant Dc supply instead of ripple voltages. It mainly consists of 3 pins That are
input voltage, ground, output voltage. For some devices we require 12V/9V/4V Dc
supply at that time we go for 7812/7809/7804 regulator instead of 7805 regulator. It
also have same feature and pins has 7805 regulator except output is of 12V/9V/4V
instead of 5V.The general circuit diagram for total power supply to any embedded
device is as shown below.
Fig.4.4 general circuit diagram for total power supply
[MGM’s COE NANDED] Page 28
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
4.3 UART
Fig.4.5 UART Block Diagram
Atmel microcontroller features a full duplex (separate receive and transmit registers)
Universal Asynchronous Receiver and Transmitter (UART).The main features are
Baud rate generator that can generate a large number of baud rates (bps) , High baud
rates at low XTAL frequencies, 8 or 9 bits data, Noise filtering, Overrun detection
Framing Error detection, False Start Bit detection,Three separate interrupts on TX
Complete, TX Data Register Empty and RX Complete.The alternative function of
portd0, portd1 is UART. Portd0 is the receiver pin and portd1 is the transmitter pin.
Here we are using IC MAX232 as a UART driver.This micro controller board
contains max232 IC which is used as a voltage converter.
[MGM’s COE NANDED] Page 29
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Fig.4.6 Max 232 Schematics
The output supply of computer will be 10V and we require 5V of supply for our
microcontroller board.When we want to take some input from the computer to the
micro controller, then we require some means in order to down convert that 10V to
5V. This is done through max232 IC. Similarly, when we are reading some thing from
the micro controller in to the micro controller, then we need some up converter that
converts 5V to 10V to the computer. This is also done through max232 only.This all
work is done through the 4 capacitors present near the max232. These capacitors
provide charge when required and store the charge when not required.So, Max232
requires power supply of 5V,2 RS232 Drivers,4 External Capacitors of 1micro farad
Dual charge pumps DC-DC voltage converters ,Receiver and Transmitter Enable
control pins.Temperature of 00to +70
0 . The transmit pin of the micro controller [txd]
pin 11 is connected to pin no 10 of MAX 232 IC. The receive pin of the micro
controller [rxd] pin 10 is connected to pin no 9 of MAX 232 IC. In the DB9 connector
pin no 5 is GROUND. Pin no 2 is receive pin. Pin no 3 is Transmit pin.
[MGM’s COE NANDED] Page 30
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
4.4 NULL MODEMS
A Null Modem is used to connect two DTE's together. This is commonly used as a
cheap way to network games or to transfer files between computers using Zmodem
Protocol, Xmodem Protocol etc. This can also be used with many Microprocessor
Development Systems.
Fig.4.7 Null Modem Wiring Diagram
Above is my preferred method of wiring a Null Modem. It only requires 3 wires (TD,
RD & SG) to be wired straight through thus is more cost effective to use with long
cable runs. The theory of operation is reasonably easy. The aim is to make to
computer think it is talking to a modem rather than another computer. Any data
transmitted from the first computer must be received by the second thus TD is
connected to RD. The second computer must have the same set-up thus RD is
connected to TD. Signal Ground (SG) must also be connected so both grounds are
common to each computer.
The Data Terminal Ready is looped back to Data Set Ready and Carrier Detect
on both computers. When the Data Terminal Ready is asserted active, then the Data
Set Ready and Carrier Detect immediately become active. At this point the computer
thinks the Virtual Modem to which it is connected is ready and has detected the
carrier of the other modem. All left to worry about now is the Request to Send and
Clear To Send. As both computers communicate together at the same speed, flow
control is not needed thus these two lines are also linked together on each computer.
When the computer wishes to send data, it asserts the Request to Send high and as it's
hooked together with the Clear to Send, It immediately gets a reply that it is ok to
send and does so.
[MGM’s COE NANDED] Page 31
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
4.5 GSM MODEM
GSM Modem Product, from Sparr Electronics limited (SEL), provides full functional
capability to Serial devices to send SMS and Data over GSM Network. The product is
available as Board Level or enclosed in Metal Box. The Board Level product can be
integrated in to Various Serial devices in providing them SMS and Data capability
and the unit housed in a Metal Enclosure can be kept outside to provide serial port
connection. The GSM Modem supports popular "AT" command set so that users can
develop applications quickly. The product has SIM Card holder to which activated
SIM card is inserted for normal use. The power to this unit can be given from UPS to
provide uninterrupted operation. This product provides great feasibility for Devices in
remote location to stay connected which otherwise would not have been possible
where telephone lines do not exist.
The GSM module offers the advantages as, Ultra small size (22x22x3 mm),
lightweight (3.2 g) and easy to integrate, Low power consumption,R&TTE type
approval plus CE, GCF, FCC,PTCRB, IC, Full RS232 on CMOS level with flow
control (RX,TX, CTS, RTS, CTS, DTR, DSR, DCD, RI) High performance on low
price
Product Features are,
A. E-GSM 900/1800 MHz and GSM 1800/1900 with GSM Phase 2 / 2+
B. Control via AT commands (ITU, GSM, GPRS and manufacturer supplementary)
C. Supply Voltage range: 3.22 V - 4.2 V,nominal:3.8V
D. Power consumption: Idle mode: <1.8 mA, speech mode: 200 mA (average)
Figure.4.8 Connection Diagram
[MGM’s COE NANDED] Page 32
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
4.5.2 GSM MODULE WITH RS232
Full Type Approved Quad Band Embedded GSM Module (GSM 850/900 1800/1900)
with AT command set and RS232 interface on CMOS level shown in figure 2. This
GSM wireless data module is the ready a solution for remote wireless applications,
machine to machine or user to machine and remote data communications in all
vertical market applications. A range of dual band GSM radio modems, which give
compatible mobile devices wireless connectivity using the GSM900/1800 cellular
networks. Each modem interfaces to the host via a Universal Synchronous /
Asynchronous Serial Receiver-Transmitter (USART), which is automatically detected
by the operating system and easily configured using standard operating system
drivers.The modems are controlled by industry standard AT commands
Figure.4.9 GSM modem
[MGM’s COE NANDED] Page 33
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
CHAPTER 5
SOFTWARE PROFILE
5.1 User Perspective
Figure 5.1 User Perspective Flowchart
The above given flowchart gives the end user perspective on the control flow. During
normal operations the LCD reads a message from a fixed memory location in the
Microcontroller and displays it continuously, until a new message arrives for
validation. It is then when a branching occurs basing on the validity of the sender’s
number and further taking into account the priority assigned to the new message in
comparison to the previous one.
[MGM’s COE NANDED] Page 34
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Figure 5.2 operational flowchart
5.2. Control Flow in Code
5.2.1. Initializations
The baud rate of the modem was set to be 4800 bps using the command
AT+IPR=4800.The ECHO from the modem was turned off using the command
ATE/ATE0 at the hyper terminal. 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 4800bps, we set terminal count of Timer 1 at 0FFh
(clock frequency = 1.8432). The TCON and SCON registers were set accordingly.
[MGM’s COE NANDED] Page 35
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
5.2.2. Serial transfer using TI and RI flags
After setting the baud rates of the two devices both the devices are now ready to
transmit and receive data in form of characters. Transmission is done when TI flag is
set and similarly data is known to be received when the Rx flag is set. The
microcontroller then sends an AT command to the modem in form of string of
characters serially just when the TI flag is set. After reception of a character in the
SBUF register of the microcontroller (response of MODEM with the read message in
its default format or ERROR message or OK message), the RI flag is set and the
received character is moved into the physical memory of the microcontroller.
5.2.3. Validity Check
After serially receiving the characters the code then checks for start of the sender’s
number and then compares the number character by character with the valid number
prestored in the memory. Since we are employing just one valid number, we are able
to do the validation process dynamically i.e. without storing the new message in
another location in the memory. For more than one valid numbers we would require
more memory locations to first store the complete (valid/invalid) message in the
memory and then perform the comparison procedure.
5.2.4 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.
5.3 SHORT MESSAGE COMMANDS
5.3.1READ MESSAGE +CMGR
5.3.1.1 Description
This command allows the application to read stored messages. The messages are read
from the memory selected by +CPMS command.
[MGM’s COE NANDED] Page 36
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
5.3.1.2 Syntax
Command syntax : AT+CMGR=<index>
Response syntax for text mode:
+CMGR : <stat>,<oa>,[<alpha>,] <scts> [,<tooa>,<fo>,
<pid>,<dcs>,<sca>,<tosca>,<length>] <CR><LF> <data> (for SMS
MS MS-DELIVER only)
+CMGR : <stat>,<da>,[<alpha>,] [,<toda>,<fo>,<pid>,<dcs>, [<vp>], <sca>,
<tosca>,<length>]<CR><LF> <data> (for SMS-SUBMIT only)
+CMGR : <stat>,<fo>,<mr>,[<ra>],[<tora>],<scts>,<dt>,<st> (for SMS SMS
STATUS-REPORT only)
5.3.2Response syntax for PDU mode :
+CMGR: <stat>, [<alpha>] ,<length> <CR><LF> <pdu>
A message read with status “REC UNREAD” will be updated in memory with the
status “REC READ”.
5.3.2.1 SEND MESSAGE +CMGS Description :
The <address> field is the address of the terminal to which the message is sent. To
send the message, simply type, <ctrl-Z> character (ASCII 26). The text can contain
all existing characters except <ctrl-Z> and <ESC> (ASCII 27). This command can be
aborted using the <ESC> character when entering text. In PDU mode, only
hexadecimal characters are used (‘0’…’9’,’A’…’F’).
5.3.2.2 Syntax
Command syntax in text mode:
AT+CMGS= <da> [ ,<toda> ] <CR>
text is entered <ctrl-Z / ESC >
Command syntax in PDU mode :
AT+CMGS= <length> <CR>
PDU is entered <ctrl-Z / ESC >
[MGM’s COE NANDED] Page 37
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
COMMAND POSSIBLE RESPONSE
AT+CMTI:”SM”,1
Note: New message received
AT+CMGR=1
Note: read the message
+CMGR :”REC UNREAD”,”0146290800”,
“98/10/01;18:22:11+00”,<CR><LF>
ABcdefGH
Ok
AT+CMGR=1
Note: read the message again
+CMGR:”REC UNREAD”,”0146290800”,
“98/10/01,18:22:11+00”,<CR><LF>
ABCdefGHI
OK
Note: message is read now
AT+CMGR=2
Note :Read at a wrong index
+CMS ERROR:321
Note : Error : invalid index
AT+CMGF=0 : +CMGR=1
Note :In PDU mode
+CMGR: 2,<Length><CR><LF><pde>
OK
Note :Message is stored but unsent, no
<alpha>field
AT+CMGF=1;+CPMS+”SR”;+CNMI=…2
Reset to text mode ,set read memory to
“SR”,and allow storage of further SMS
Status Report into”SR”memory
OK
AT+CMSS=3
Send an SMS previously stored
+CMSS :160
OK
+CDSI :”SR”,1
New SMS Status Report Stored in “SR”
Memory at index 1
AT+CMGR=1
Read the SMS Status Report
+CMGR :’READ’,6,160,
“+33612345678’,129,”01/05/31,15:15:09
+00’,’01/05/31,15:15:09+00”,0
OK
Table 5.1 Example for CMGR command
[MGM’s COE NANDED] Page 38
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
Command Possible response
AT+CMGS=”+33146290800”<CR>
Please call me soon, fred. <ctrl.z>
Note: send a message in text mode.
+CMGS;<mr>
Ok
Note:successful transmission
AT+CMGS+<length><CR><pdu><ctrlz>
Note: Send a message in pdu mode.
+CMGS;<mr>
Ok
Note:Sucessful transmission.
Table 5.2 Examples for CMGS commands
[MGM’s COE NANDED] Page 39
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
PROGRAM CODING
1. LCD coding
#include<reg52.h>
#include<intrins.h>
#include<string.h>
#include "lcd.h"
sbit BZ=P1^1;
bit flag = 0;
bit r_flag = 0;
bit sucess = 0;
sbit AB = P3^2;
int i=0;
char idata buff[150];
//char idata num[12];
char idata mes[60];
void send_chr(unsigned char);
bit vl=0,li=0;
void serial_intr(void) interrupt 4
{
if(TI==1)
{
TI=0;
flag=1;
}
[MGM’s COE NANDED] Page 40
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
else
{
RI=0;
r_flag=1;
if(i<150)
buff[i++]=SBUF;
}
}
void print(char *str)
{
while(*str)
{
flag=0;
SBUF=*str++;
while(flag==0);
}
}
void transmit(unsigned char *s)
{
while(*s)
{
SBUF=*s++;
delay_ms(40);
}
[MGM’s COE NANDED] Page 41
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
}
unsigned char m;
void main()
{
int I;
char t=0;
TMOD=0x21;
SCON=0x50;
TH1=0XFD;
TR1=1;
IE=0X92;
TH0=0X00;
TL0=0X00;
init_lcd();
display_lcd("GSM BASED");
cmd_lcd(0XC0);
display_lcd("MESSAGE DISPLAY");
delay_ms(3000);
cmd_lcd(0x01);
display_lcd("INITIALIZING");
i=0;
print("AT+CMGF=1\r\n");
delay_ms(100);
sucess=0;
do
[MGM’s COE NANDED] Page 42
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
{
strcpy(buff," ");
r_flag=0;
i=0;
print("AT+CMGD=1,4\r\n");
while(i<16)
delay_ms(100);
cmd_lcd(0xc0);
display_lcd("MODEM CONNECTED");
// display_lcd(buff);
delay_ms(1000);
I=0;
while(buff[I]!='\0')
{
if(buff[I++]=='E')
sucess=1;
}
delay_ms(1000);
}while(sucess!=1);
while(1)
{
AB=1;
sucess=0;
do
[MGM’s COE NANDED] Page 43
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
{
i=0;
strcpy(buff,'"');
r_flag=0;
do
{
i=0;
//
//
strcpy(buff,'"');
}
while(r_flag==0);
delay_ms(100);
if(buff[2]=='+')
sucess=1;
} while(sucess!=1);
cmd_lcd(0x01);
display_lcd("MESSAGE RECEIVED");
BZ=0;
delay_ms(2000);
BZ=1;
i=0;
strcpy(buff,'"');
print("AT+CMGR=1\r\n");
[MGM’s COE NANDED] Page 44
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
delay_ms(1000);
I=0;
while(buff[I++]!=',');
// cmd_lcd(0x01);
//display_lcd("CELL NO:");
//cmd_lcd(0xc0);
//I=I+4;
t=0;
while(buff[I]!='"');
buff[I++];
do
{
buff[I++];
//num[t++]=buff[I++];
delay_ms(50);
}
while(buff[I]!='"');
//num[t]='\0';
// cmd_lcd(0x01);
//display_lcd(num);
//delay_ms(1000);
cmd_lcd(0x01);
cmd_lcd(0xc0);
[MGM’s COE NANDED] Page 45
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
while(buff[I]!='"')
(buff[I++]);
while(buff[I]!='"')
(buff[I++]);
while(buff[I++]!=0x0d);
cmd_lcd(0x01);
display_lcd("MESSAGE:");
cmd_lcd(0xc0);
//buff[I++];
//write_lcd(buff[I]);
do
{
mes[t++]=buff[I++];
// delay_ms(50);
}
while(buff[I]!=0x0d);
mes[t]='\0';
delay_ms(1000);
cmd_lcd(0X01);
// cmd_lcd(0X18);
display_lcd(mes);
cmd_lcd(0XC0);
delay_ms(2000);
sucess=0;
do
[MGM’s COE NANDED] Page 46
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
{
strcpy(buff," ");
r_flag=0;
i=0;
print("AT+CMGD=1,0\r\n");
while(i<14);
delay_ms(100);
I=0;
while(buff[I]!='\0')
{
if(buff[I++]=='E')
sucess=1;
}
delay_ms(500);
}while(sucess!=1);
// cmd_lcd(0x01);
}
}
void send_chr(unsigned char c)
{
flag=0;
SBUF=c;
while(flag==0);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[MGM’s COE NANDED] Page 47
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
//lcd.h
#include <reg52.h>
#define LCD P2
sbit RS=P0^0;
sbit RW=P0^1;
sbit EN=P0^2;
void delay_ms(unsigned int i)
{
unsigned int j;
while(i-->0)
{
for(j=0;j<500;j++)
{
;
}
}
}
void cmd_lcd(unsigned char c)
{
RS=0;
RW=0;
EN=1;
LCD=c;
delay_ms(10);
[MGM’s COE NANDED] Page 48
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
EN=0;
delay_ms(10);
}
void init_lcd(void)
{
delay_ms(10);
cmd_lcd(0x38);
delay_ms(10);
cmd_lcd(0x0c);
delay_ms(10);
cmd_lcd(0x06);
delay_ms(10);
cmd_lcd(0x01);
}
void write_lcd(unsigned char c)
{
RS=1;
RW=0;
EN=1;
LCD=c;
delay_ms(10);
EN=0;
delay_ms(10)
}
void display_lcd(unsigned char *s)
[MGM’s COE NANDED] Page 49
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
{
while(*s)
write_lcd(*s++);
}
2.MAIN EMBEDDED C CODE
#include<reg52.h>
#include<intrins.h>
#include<string.h>
#include "lcd.h"
sbit AB = P3^2;
bit flag = 0;
bit r_flag = 0;
bit sucess = 0;
int i=0;
char idata buff[140];
char idata num[12];
char idata mes[20];
void send_chr(unsigned char);
void transmit(unsigned char *t_data)
{
[MGM’s COE NANDED] Page 50
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
while(*t_data!='\0')
{
SBUF = *t_data;
t_data++;
delay_ms(30);
}
}
void serial_intr(void) interrupt 4
{
if(TI==1)
{
TI=0;
flag=1;
}
else
{
RI=0;
r_flag=1;
if(i<160)
buff[i++]=SBUF;
}
[MGM’s COE NANDED] Page 51
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
}
void print(char *str)
{
while(*str)
{
flag=0;
SBUF=*str++;
while(flag==0);
}
}
unsigned char m;
void main()
{
int I;
char t=0;
TMOD=0x21;
SCON=0x50;
TH1=0XFD;
TR1=1;
IE=0X90;
init_lcd();
display_lcd("GSM SCROLLING");
cmd_lcd(0XC0);
[MGM’s COE NANDED] Page 52
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
display_lcd("LED DISPLAY SYS");
delay_ms(3000);
AB=0;
cmd_lcd(0x01);
display_lcd("INITIALIZING");
i=0;
print("AT+CMGF=1\r\n");
delay_ms(100);
sucess=0;
do
{
strcpy(buff," ");
r_flag=0;
i=0;
print("AT+CMGD=1,4\r\n");
while(i<16)
delay_ms(100);
I=0;
while(buff[I]!='\0')
{
if(buff[I++]=='E')
sucess=1;
}
delay_ms(1000);
}while(sucess!=1);
[MGM’s COE NANDED] Page 53
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
cmd_lcd(0x01);
display_lcd("MODEM CONNECTED");
delay_ms(1000);
cmd_lcd(0x01);
display_lcd("GSM SCROLLING");
cmd_lcd(0XC0);
display_lcd("LED DISPLAY SYS");
delay_ms(1000);
while(1)
{
AB=0;
sucess=0;
init_lcd();
display_lcd("GSM SCROLLING");
cmd_lcd(0XC0);
display_lcd("LED DISPLAY SYS");
delay_ms(200);
do
{
i=0;
strcpy(buff,'"');
r_flag=0;
do
{
i=0;
[MGM’s COE NANDED] Page 54
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
strcpy(buff,'"');
}
while(r_flag==0);
delay_ms(100);
if(buff[2]=='+')
sucess=1;
} while(sucess!=1);
cmd_lcd(0x01);
display_lcd("MESSAGE RECIVED");
delay_ms(1000);
i=0;
strcpy(buff,'"');
print("AT+CMGR=1\r\n");
delay_ms(1000);
I=0;
while(buff[I++]!=',');
cmd_lcd(0x01);
display_lcd("CELL NO:");
cmd_lcd(0xc0);
//I=I+4;
t=0;
while(buff[I]!='"');
buff[I++];
do
[MGM’s COE NANDED] Page 55
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
{
//buff[I++];
num[t++]=buff[I++];
delay_ms(50);
}
while(buff[I]!='"');
num[t]='\0';
cmd_lcd(0xc0);
display_lcd(num);
delay_ms(1000);
while(buff[I]!='"')
(buff[I++]);
while(buff[I]!='"')
(buff[I++]);
while(buff[I++]!=0x0d);
cmd_lcd(0x01);
display_lcd("MESSAGE READING");
cmd_lcd(0xc0);
buff[I++];
//write_lcd(buff[I]);
//delay_ms(1000);
t=0;
//while(buff[I]!='"');
//buff[I++];
[MGM’s COE NANDED] Page 56
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
do
{
mes[t++]=buff[I++];
delay_ms(5);
}
while(buff[I]!=0x0d);
mes[t]='\0';
delay_ms(200);
cmd_lcd(0x01);
display_lcd(mes);
delay_ms(2000);
if(strcmp(mes,"FORMAT") == 0)
{
AB = 1;
cmd_lcd(0x01);
display_lcd("MESSAGES DELETED");
delay_ms(100);
send_chr('#');
delay_ms(1000);
send_chr('4');
delay_ms(1000);
send_chr('6');
delay_ms(5000);
AB=0;
[MGM’s COE NANDED] Page 57
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
}
else
{
AB=1;
// EA=0;
cmd_lcd(0x01);
display_lcd("DISPLAY SETTING");
delay_ms(100);
send_chr('*');
delay_ms(2000);
transmit("<M ");
transmit(mes);
transmit(" ><S 1><D L1>\r\n");
send_chr(0x0d);
delay_ms(3000);
send_chr(0x0d);
delay_ms(5000);
EA=1;
AB = 0;
}
//delay_ms(2000);
send_chr(0x0d);
print("AT+CMGD=1\r\n");
delay_ms(1000);
print("AT+CMGD=2\r\n");
[MGM’s COE NANDED] Page 58
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
delay_ms(1000);
print("AT+CMGD=3\r\n");
delay_ms(1000);
cmd_lcd(0x01);
}
}
void send_chr(unsigned char c)
{
flag=0;
SBUF=c;
while(flag==0);
}
[MGM’s COE NANDED] Page 59
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
CONCLUSION
The project “wireless electronic notice board using GSM technology” has been
successfully completed and tested with integration of the features of every hardware
component for its development. Presence of every block has been reasoned out and
placed carefully thus contributing to the best working of the unit.
The project was finished using very simple and easily available components
making it lightweight and portable. This helps for wireless notice board application
with the help of GSM Technology. We believe that our step is towards complete
automation for notice board application which can be used in colleges,
Finally we can conclude that this project application gives a very good feature
and there is huge scope for further research and development for using the same with
the help of advanced technology.
[MGM’s COE NANDED] Page 60
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
FUTURE IMPROVEMENTS
The use of microcontroller in place of a general purpose computer allows us to
theorize on many further improvements on this project prototype. Temperature
display during periods wherein no message buffers are empty is one such theoretical
improvement that is very possible.
The ideal state of the microcontroller is when the indices or storage space in
the SIM memory are empty and no new message is there to display. With proper use
of interrupt routines the incoming message acts as an interrupt, the temperature
display is halted and the control flow jumps over to the specific interrupt service
routine which first validates the sender’s number and then displays the information
field. Another very interesting and significant improvement would be to
accommodate multiple receiver MODEMS at the different positions in a geographical
area carrying duplicate SIM cards.
With the help of principles of TDMA technique, we can choose to simulcast
and /or broadcast important notifications. After a display board receives the valid
message through the MODEM and displays it, it withdraws its identification from the
network & synchronously another nearby MODEM signs itself into the network and
starts to receive the message. The message is broadcast by the mobile switching
center for a continuous time period during which as many possible display board
MODEMS “catch” the message and display it as per the constraint of validation.
Multilingual display can be another added variation of the project.
The displayboards are one of the single most important media for information
transfer to the maximum number of end users. This feature can be added by
programming the 40 microcontroller to use different encoding decoding schemes in
different areas as per the local language. This will ensure the increase in the number
of informed users. Graphical display can also be considered as a long term but
achievable and target able output. MMS technology along with relatively high end
microcontrollers to carry on the tasks of graphics encoding and decoding along with a
more expansive bank of usable memory can make this task a walk in the park.
[MGM’s COE NANDED] Page 61
WIRELESS ELECTRONIC NOTICE BOARD USING GSM TECHNOLGY
REFERENCES
Literature
A. 8051 Microcontroller and Embedded Systems – Muhammad A. Mazidi
B. MATRIX SIMADO GDT11 GSM MODEM Manual
C. Frank Vahid, Embedded system design, Tata Mc Graw hill, 3 Edition, 1995.
D. Raj Kamal, Embedded Systems, JWE, 4 Edition, 2000.
Links
MAX – 232 data sheet from Texas Instruments
A. http://www.datasheetcatalog.com
B. http://www.8052.com
C. www.wikipedia.org
D. www.keil.com/forum/docs
E. www.embeddedrelated.com