You are on page 1of 70

A

Project Report
On
“Multiuser GSM Based Wireless Electronic Notice Board ”

Session 2010-2011

Submitted By
Ankita Dashora (07EMBEC010)
Swati Dadhich (07EMBEC054)
Aman Jain (07EMBEC005)
Yogesh Kumar Verma(07EMBEC059)
In partial fulfillment for the award of the degree
of
B.TECH
in
Electronics and Communication
Rajasthan Technical University Kota
May,2011

Department of Electronics & Communication Engineering


M. L. V. Textile & Engineering College.
Bhilwara 311001,INDIA.
Candidates Declaration

I hereby declare that the work presented in this project titled GSM Based Wire-
less Electronic Notice Board submitted towards completion of project in Eighth
Semester of B.Tech (ECE) at the MLV Textile and Engineering College, Bhilwara. It
is an authentic record of my original work pursued under the guidance of Mrs.Hareeta
Malani, Assistant Professor, MLVTEC, Bhilwara. I have not submitted the
matter embodied in this project for the award of any other degree.

Place: Bhilwara Submitted by:


Date: 17-05-2011 Ankita Dashora
Swati Dadhich
Aman Jain
Yogesh Kumar Verma

i
BONAFIDE CERTIFICATE
This is to certify that the project work entitled“Multiuser GSM Based Wireless
Electronic Notice Board” is carried out by

Ankita Dashora
Swati Dadhich
Aman Jain
Yogesh Kumar Verma

Under my supervision and guidance during the academic year 2010 and to the best
of our knowledge is original work.

Internal Guide:
Mrs. Hareeta Malani
Asst. Professor, ICT Department

Submitted for viva-voice examination held on Date

Internal Examiner: External Examiner:

i
Abstract

GSM based electronic notice display system is presented in this paper, this is the
model for displaying notices in college on electronic notice board by sending messages
in form of SMS through mobile. Message will be transmitted by user at transmitting
section. This message will be received by mobiles modem at the receiving section.
PC connected to it via Bluetooth extracts the received message .A VB program will
read the message and separates password and the text from the received message.
After checking the password, user is authenticated and the remaining text messages
will then be sent to microcontroller via serial port and then to display. A 16x2 Char-
acter LCD display is attached to microcontroller for display. The microcontroller
is interfaced with serial port via MAX232 level convertor. Microcontroller coding
will be done using Embedded C and Kiel. Multiple Users are authorized to update
notices on the electronic notice board by providing them a password. Although
the system is automated, still a PC with an administrator can be kept for ease of
keeping records monitoring the system.

ii
Acknowledgement

I take immense pleasure in thanking Prof. Mrs. Hareeta Malani, Assistant Profes-
sor, MLVTEC, Bhilwara for having permitted me to carry out this project work.

I wish to express my deep sense of gratitude to my Internal Guide, Mr. Mohd.


Wassiuddin Shiekh, Lecturer, ICT Department for his able guidance and useful sug-
gestions, which helped us in completing the project work, in time.

Needless to mention Mr. G.K. Tyagi, Principal, MLVTEC , who had been a source
of inspiration. I would also like to thank Mr. Ritesh Saraswat Assistant Profes-
sor, H.O.D , ICT Department MLVTEC, Mrs. Sarita Chauhan Assistant Professor,
MLVTEC, Bhilwara for all their valuable guidance in the project work.

Finally, yet importantly, I would like to express my heartfelt thanks to my beloved


parents for their blessings, my friends/classmates for their help and wishes for the
successful completion of this project.

Submitted by:
Ankita Dashora
Swati Dadhich
Aman Jain
Yogesh Kumar Verma

iii
Contents

Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii

1 Introduction and Design Overview 1


1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Design Overview: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Transmitting Section 8
2.1 GSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Technical Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 GSM Frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Subscriber Identity Module (SIM) . . . . . . . . . . . . . . . . . . . . 10
2.5 GSM Network Structure . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.6 GSM Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Receiving Section 12
3.1 Hardware Description . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.1 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.2 GSM Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.3 Display unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.4 MAX 232 Level Converter . . . . . . . . . . . . . . . . . . . . 15
3.1.5 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.6 RS-232 Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Communication within Hardwares . . . . . . . . . . . . . . . . . . . . 18
3.3 Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3.1 Serial Port Communication . . . . . . . . . . . . . . . . . . . 20

4 Software Description 22
4.1 Express PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

iv
4.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2 Embedded C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.2.1 Sample Programming in Embedded C. . . . . . . . . . . . . . 24
4.3 Keil Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3.1 Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4 Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5 Interfacing 29
5.1 Microcontroller-LCD Interfacing: . . . . . . . . . . . . . . . . . . . . 29
5.1.1 Understanding LCD HD44780 pins: . . . . . . . . . . . . . . . 29
5.1.2 Hardware Connections: . . . . . . . . . . . . . . . . . . . . . . 30
5.1.3 Programming the LCD: . . . . . . . . . . . . . . . . . . . . . 31
5.2 Microcontroller-PC Interfacing: . . . . . . . . . . . . . . . . . . . . . 33
5.2.1 RS-232 Level Converters: . . . . . . . . . . . . . . . . . . . . . 34
5.2.2 Serial Communication at PC side . . . . . . . . . . . . . . . . 35
5.2.3 Serial Communication at microcontroller side . . . . . . . . . 36
5.3 Mobile to PC Communication . . . . . . . . . . . . . . . . . . . . . . 36
5.3.1 AT Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.4 Overall Functional Flowcahrt . . . . . . . . . . . . . . . . . . . . . . 39

6 Final Circuit Schematic And PCB Layout 40


6.1 Schematic of final circuit . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.2 PCB Layout-Main PCB . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.3 PCB Layout-Side PCB having MAX232 . . . . . . . . . . . . . . . . 42

7 Conclusion 43
7.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.2 Applications: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.3 Merits: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.4 Demerits: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.5 Future enhancements: . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

v
List of Figures

1.1 Block Diagram of the System . . . . . . . . . . . . . . . . . . . . . . 5


1.2 User Interface Window at PC . . . . . . . . . . . . . . . . . . . . . . 6
1.3 User Interface Window for password setting at PC . . . . . . . . . . . 7
2.1 GSM Bands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Block Diagram of GSM Structure . . . . . . . . . . . . . . . . . . . . 11
3.1 IC Pin Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 LG GB210 Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3 Some common SMS AT Commands . . . . . . . . . . . . . . . . . . 14
3.4 Pin configuration of LCD . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 MAX 232 IC Pin Description . . . . . . . . . . . . . . . . . . . . . . 16
3.6 Power supply Block Diagram . . . . . . . . . . . . . . . . . . . . . . . 16
3.7 Power Supply Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.8 RS-232 Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.9 Connection Between terminals of RS-232 cable . . . . . . . . . . . . . 18
3.10 Screnshot for adding Bluetooth Device . . . . . . . . . . . . . . . . . 19
3.11 Screnshot for Add Bluetooth Device Wizard . . . . . . . . . . . . . . 19
3.12 Serial Port Communication . . . . . . . . . . . . . . . . . . . . . . . . 20
4.1 Express SCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2 Express PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 Program1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.4 Program2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.5 Program3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.6 Keil Compiler Window . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.7 Form to calculate volume of cylinder . . . . . . . . . . . . . . . . . . 27
5.1 Microcontroller-LCD Interfacing . . . . . . . . . . . . . . . . . . . . . 30
5.2 PC-Microcontroller Interfacing . . . . . . . . . . . . . . . . . . . . . . 34
5.3 MAX 232 Internal Circuit . . . . . . . . . . . . . . . . . . . . . . . . 34
5.4 HEX Codes for different Baud Rates . . . . . . . . . . . . . . . . . . 35

vi
6.1 Schematic of Final circuit . . . . . . . . . . . . . . . . . . . . . . . . 40
6.2 PCB Layout of Main PCB . . . . . . . . . . . . . . . . . . . . . . . . 41
6.3 PCB Layout of Side PCB having MAX232 . . . . . . . . . . . . . . . 42

vii
Chapter 1

Introduction and Design Overview

1.1 Introduction
Wireless communication has announced its arrival on big stage and the world is
going mobile. We want to control everything and without moving an inch. This
remote control of appliances is possible through Embedded Systems. The use of
Embedded System in Communication has given rise to many interesting applica-
tions that ensures comfort and safety to human life.

Mobile Phones and the related technologies are becoming more and more ubiq-
uitous. Various technical arenas in the field of Telecommunication and Embedded
Systems have come very near to the common people. The number of people with cell
phones is on the rise. A day will come, somewhere in the near future, when a mobile
phone is referred to in the same class of Food, clothing and shelter”. Improvements
in the Networking technologies have fostered growth of very dense networks. Land
line telephones have been becoming less and less popular and people now prefer
communicating while on the move.

A Remote Control is perhaps the most popular gadget today. Right from the in-
tense creativity of remotely controlling laser chip markers to the highly destructive
remotely ignitable bombs, from the pins to the planes, remote control is not only
occupying a omnipresence state, but is also enhancing its scope and domains.

When people have a good connectivity at their disposal, with tremendous power
of mobile computing to supplement the same, we can think of connecting their

1
home appliances to a mobile phone wirelessly. With this, people would be able to
turn on and off, and to some extent, control the appliances at their home even from
a distant place. One of the very basic examples of an utility of this is switching on
the air conditioner in the room just some time before reaching home, so that the
room is sufficiently cool by then.

This project is an implementation to the idea of the wireless communication be-


tween a mobile phone and a microcontroller.

What makes SMS messaging so successful worldwide?

SMS is a success all over the world. The number of SMS messages exchanged
every day is enormous. SMS messaging is now one of the most important revenue
sources of wireless carriers. What is so special about SMS that makes it so popular
worldwide? Some of the reasons are discussed below:

SMS Messages can be Sent and Read at Any Time: Nowadays, almost every per-
son has a mobile phone and carries it most of the time. With a mobile phone, you
can send and read SMS messages at any time, no matter you are in your office, on
a bus or at home.

SMS Messages can be Sent to an Offline Mobile Phone: Unlike a phone call, you can
send an SMS message to your friend even when he/she has not switched on the mo-
bile phone or when he/she is in a place where the wireless signal is temporarily
unavailable. The SMS system of the mobile network operator will store the SMS
message and later send it to your friend when his/her mobile phone is online.

SMS Messaging is Less Disturbing While You can Still Stay in Touch: Unlike a phone
call, you do not need to read or reply an SMS message immediately. Besides, writing
and reading SMS messages do not make any noise. While you have to run out of a
theater or library to answer a phone call, you do not need to do so if SMS messaging
is used.

SMS Messages are Supported by 100 percent GSM Mobile Phones


SMS messaging is a very mature technology. All GSM mobile phones support it.
Not only that you can exchange SMS messages with mobile users of the same wire-
less carrier, but you can also exchange SMS messages with mobile users of many

2
other wireless carriers worldwide.

SMS is a Suitable Technology for Wireless Applications to Build on: Here are some
of the reasons that make SMS a suitable technology for wireless applications to build
on:

a. Firstly, SMS messaging is supported by 100 percent GSM mobile phones. Build-
ing wireless applications on top of the SMS technology can maximize the potential
user base.

b. Secondly, SMS messages are capable of carrying binary data besides text. They
can be used to transfer ringtones, pictures, operator logos, wallpapers, animations,
VCards, VCals (calendar entries), etc.

c. Thirdly, SMS supports reverse billing, which enables payment to be made conve-
niently. For example, suppose you want to develop a commercial ringtone download
application that charges a fee from the user for each ringtone downloaded. One way
to accept payment is to use a reverse billing phone number obtained from a wireless
carrier. To buy a ringtone, the user will write an ordinary SMS text message that
contains the ID of the ringtone he/she wants to buy and send it to your SMS ap-
plication’s reverse billing phone number. Your SMS application will then send back
one or more reverse billing SMS messages that carry the ringtone. The user will
be charged a fee for the reverse billing SMS messages he/she received. The fee will
be included in the user’s monthly mobile phone bill or be deducted from his/her
prepaid card credits. Depending on the agreement between you and the wireless
carrier, all or part of the money received will be given to you.

Current scenario:

Currently we rely on putting up notices on the notice boards using papers. This is
time consuming since we need time for preparing notices. Also there is wastage of
paper. If we need to renew the notice then we have to take a new hardcopy.

What is wireless notice board?

Wireless notice board is a means of wireless data transfer for quick display of mes-
sages in real time. Updation on the notice board are done with the help of messages

3
send by user. It reduces the use of papers and the latency involved in display of
messages at notice boards.

Transmission techniques:

GSM TECHNOLOGY:
Global System for Mobile Communication is a globally accepted standard for digital
cellular communication. GSM is the name of a standardization group established in
1982 to create a common European mobile telephone standard.

RF MODULES:
An RF wireless communication system operating in the presence of a periodic noise
environment, includes first and second wireless devices, each such device having, a
source of power, a transceiver coupled to the power source, for transmitting and
receiving wireless information and a controller/CPU for controlling the operation of
the transceiver.

BLUETOOTH:
Bluetooth is an open wireless protocol for exchanging data over short distances from
fixed and mobile devices, creating personal area networks (PANs). It was originally
conceived as a wireless alternative to RS232 data cables. It can connect several
devices, overcoming problems of synchronization.

Out of these, we are using GSM and Bluetooth for communication between dif-
ferent sections of the system. This is the model for displaying notices in colleges on
electronic notice board by sending messages in form of SMS through mobile; it is a
wireless transmission system which has very less errors and maintenance.

Message will be transmitted by user at transmitting section. This message will


be received by mobiles modem at the receiving section. PC connected to it via
Bluetooth extracts the received message from its mobiles sim (subscriber identity
module).PC Coding will be done using Visual Basic. VB program will read the mes-
sage and separates password and the text from the received message. After checking
the password, user is authenticated and the remaining text messages will then be
sent to microcontroller via serial port and then to display. A 16x2 Character LCD
display is attached to microcontroller for display. The microcontroller is interfaced
with serial port via MAX232 level convertor. Microcontroller coding will be done

4
using Embedded C and Kiel. Multiple Users are authorized to update notices on
the electronic notice board by providing them a password. Although the system is
automated, PC with an administrator is kept for ease of monitoring.

1.2 Design Overview:


Figure 1.1 shows the block diagram of the system. The whole system is basically
divided into two sections: Transmitting and Receiving.

Figure 1.1: Block Diagram of the System

Transmitting section consists of just a mobile. Multiple users are assigned their own
access password to send message to the receiving section. Authorised users send
this password in a message. In the same message, after a single space, they have to
type the text that they want to display on the notice board to the receiving sections
mobile number and the message will be displayed only if the users have send the
correct password. An acknowledgement message is also sent to the users if their
password is correct and that their message will display on the notice board.

Receiving section on the other hand consists of a mobile, whose modem is used
to receive the messages. Received SMS is then extracted by PC from its sim di-
rectly with the help of a VB program using AT commands. SMS are then sent to
microcontroller via PCs serial port and MAX232 driver IC. Microcontroller finally
displays it on LCD display.

5
As previously mentioned, although the system is automated, still a PC with an
administrator can be kept for ease of keeping records and monitoring the system.
At the PC, a user interface window is provided for the administrators use. This is
done using VB. Also, the password for individual users which can be changed only
by the administrator is changed by typing the new password in the password setting
user interface window. User interface window is shown in figure below:

Figure 1.2: User Interface Window at PC

The microcontroller used in this case is AT89c52. LG Handset GB210 is used as a


GSM mobile phone. LCD IC HD44780 is used for LCD display. In the prototype
model, LCD display is used for simulation purpose. While implementation this can
be replaced by actual display boards.

6
User Interface window for password setting is shown in following figure:

Figure 1.3: User Interface Window for password setting at PC

7
Chapter 2

Transmitting Section

2.1 GSM
Transmitting Section consists of just mobile which has inbuilt GSM modem for
wireless data transfer through GSM. GSM (Global System for Mobile communica-
tions: originally from Group Special Mobile) is the most popular standard for mobile
phones in the world.

Its promoter, the GSM Association, estimates that 80 percent of the global mo-
bile market uses the standard. GSM is used by over 3 billion people across more
than 212 countries and territories. Its ubiquity makes international roaming very
common between mobile phone operators, enabling subscribers to use their phones
in many parts of the world.

2.2 Technical Details


GSM is a cellular network, which means that mobile phones connect to it by search-
ing for cells in the immediate vicinity. There are five different cell sizes in a GSM
networkmacro, micro, pico, femto and umbrella cells. The coverage area of each cell
varies according to the implementation environment. Macro cells can be regarded
as cells where the base station antenna is installed on a mast or a building above
average roof top level. Micro cells are cells whose antenna height is under average
roof top level; they are typically used in urban areas. Picocells are small cells whose
coverage diameter is a few dozen meters; they are mainly used indoors. Femtocells

8
are cells designed for use in residential or small business environments and connect
to the service providers network via a broadband internet connection. Umbrella
cells are used to cover shadowed regions of smaller cells and fill in gaps in coverage
between those cells.

Cell horizontal radius varies depending on antenna height, antenna gain and prop-
agation conditions from a couple of hundred meters to several tens of kilometres.
The longest distance the GSM specification supports in practical use is 35 kilome-
tres (22 mi). There are also several implementations of the concept of an extended
cell, where the cell radius could be double or even more, depending on the antenna
system, the type of terrain and the timing advance.

Indoor coverage is also supported by GSM and may be achieved by using an in-
door picocell base station, or an indoor repeater with distributed indoor antennas
fed through power splitters, to deliver the radio signals from an antenna outdoors
to the separate indoor distributed antenna system. These are typically deployed
when a lot of call capacity is needed indoors, for example in shopping centers or
airports. However, this is not a prerequisite, since indoor coverage is also provided
by in-building penetration of the radio signals from nearby cell.

The modulation used in GSM is Gaussian minimum-shift keying (GMSK), a kind of


continuous-phase frequency shift keying. In GMSK, the signal to be modulated onto
the carrier is first smoothed with a Gaussian low-pass filter prior to being fed to a
frequency modulator, which greatly reduces the interference to neighboring channels
(adjacent channel interference).

2.3 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 Ameri-
cas (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.

GSM uses two bands for duplex communication. Each band is 25 MHz in width,
shifted towards 900 MHz. Each band is divided into 124 channels of 200 kHz sepa-

9
rated by guard bands.

Figure 2.1: GSM Bands

2.4 Subscriber Identity Module (SIM)


One of the key features of GSM is the Subscriber Identity Module, commonly known
as a SIM card. The SIM is a detachable smart card containing the user’s subscription
information and phone book. This allows the user to retain his or her information
after switching handsets. Alternatively, the user can also change operators while
retaining the handset simply by changing the SIM. Some operators will block this
by allowing the phone to use only a single SIM, or only a SIM issued by them; this
practice is known as SIM locking, and is illegal in some countries.

2.5 GSM 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. It is divided into a number
of sections and these are each covered in separate articles.

1. The Base Station Subsystem (the base stations and their controllers).
2. The Network and Switching Subsystem (the part of the network most similar to
a fixed network). This is sometimes also just called the core network.
3. The GPRS Core Network (the optional part which allows packet based Internet
connections).

10
Figure 2.2: Block Diagram of GSM Structure

2.6 GSM Security


GSM was designed with a moderate level of security. The system was designed to
authenticate the subscriber using a pre-shared key and challenge-response. Com-
munications between the subscriber and the base station can be encrypted. The
development of UMTS introduces an optional USIM, that uses a longer authenti-
cation key to give greater security, as well as mutually authenticating the network
and the user - whereas GSM only authenticates the user to the network (and not
vice versa). The security model therefore offers confidentiality and authentication,
but limited authorization capabilities, and no non-repudiation. GSM uses several
cryptographic algorithms for security. The A5/1 and A5/2 stream ciphers are used
for ensuring over-the-air voice privacy. A5/1 was developed first and is a stronger
algorithm used within Europe and the United States; A5/2 is weaker and used in
other countries.

11
Chapter 3

Receiving Section

Receiving Module consists of following parts:

1. Hardware Description
2. Communication within Hardwares

3.1 Hardware Description

3.1.1 Microcontroller

Microcontroller is one of the main component of the system. Here we are using
AT89C52 microcontroller IC. Pin Description is shown below:

Figure 3.1: IC Pin Description

12
It is basically used for recieving the text message to be displayed from serial port of
PC and sends it to LCD to display. The AT89C52 is a low-power, high-performance
CMOS 8-bit microcomputer with 8K bytes of Flash programmable and erasable read
only memory (PEROM). The device is manufactured using Atmels high-density non-
volatile memory technology and is compatible with the industry-standard 80C51 and
80C52 instruction set and pin out.

The AT89C52 provides the following standard features:

1. 8 Kbytes of In-System Reprogrammable Flash Memory


2. Endurance: 1,000 Write/Erase Cycles
3. Fully Static Operation: 0 Hz to 24 MHz
4. Three-Level Program Memory Lock
5. 256 x 8-Bit Internal RAM
6. 32 Programmable I/O Lines
7. Three 16-Bit Timer/Counters
8. Eight Interrupt Sources
9. Programmable Serial Channel

The on-chip Flash allows the program memory to be reprogrammed in-system or


by a conventional non-volatile memory programmer which provides a highly-flexible
and cost-effective solution to many embedded control applications.

In addition, the AT89C52 is designed with static logic for operation down to zero
frequency and supports two software selectable power saving modes. The Idle Mode
stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt
system to continue functioning. The Power-down mode saves the RAM contents
but freezes the oscillator, disabling all other chip functions until the next hardware
reset.

3.1.2 GSM Mobile


A GSM mobile is used in our project to receive messages at receiving section. GSM
Mobile consists of GSM Modem. It is a wireless modem that works with a GSM
wireless network. It sends and receives data through radio waves.

In our case, we are using LG Handset GB210 as the mobile phone. It has 2G
GSM radio modems, which give compatible mobile devices wireless connectivity

13
using the GSM 900/1800 MHz cellular networks.It has internal antenna and dual
standby feature, alonwith this, it supports wireless bluetooth 2.0 with A2DP. A pic-
ture of handset is shown below: Its modem interfaces to the host via bluetooth.The

Figure 3.2: LG GB210 Mobile

modems are controlled by industry standard AT commands. The choice of handset


is dependent on the fact that it should store incoming messages directly into sim,
should have bluetooth connectivity feature, and it should work with all set SMS AT
commands while interfacing with PC. Both GSM modems and dial-up modems sup-
port a common set of standard AT commands. GSM modem can be used just like a
dial-up modem. In addition to the standard AT commands, GSM modems support
an extended set of AT commands. These extended AT commands are defined in
the GSM standards. With the extended AT commands, various things can be done:-

1. Reading, writing and deleting SMS messages.


2. Sending SMS messages.
3. Monitoring the signal strength.
4. Monitoring the charging status and charge level of the battery.
Some common examples of AT commands are:

Figure 3.3: Some common SMS AT Commands

14
3.1.3 Display unit
A liquid crystal display (LCD) is a thin, at display device made up of any number of
color or monochrome pixels arrayed in front of a light sourceor refector. 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. The liquid crystal twists the polarization of light entering one filter
to allow it to pass through the other.

Some of the most common LCDs connected to the 8052 are 16x2 and 20x4 dis-
plays. Here we have used 16x2 display that means 2 rows of 16 characters. It is a
Hitachi HD44780 compatible module To program the LCD module, first we have to
initialize the LCD by sending some control words. RS should be low and E should
be high when we send control. R/W pin 0 mean write data or control to LCD and
R/W pin 1 means read data from the LCD. To send a data to LCD, make RS high,
R/W low, place the data in pins 7 to 14 and make pin E high and low once.

Figure 3.4: Pin configuration of LCD

3.1.4 MAX 232 Level Converter


MAX232 is a dual driver/receiver that includes a capacitive voltage genera- tor to
supply EIA-232 voltage levels from a single 5-V supply. Each receiver converts EIA-
232 inputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of
1.3 V and a typical hysteresis of 0.5 V, and can accept 30-V inputs. Each driver
converts TTL/CMOS input levels into EIA-232 levels.The MAX220 MAX249 family
of line drivers/receivers is intended for all EIA/TIA-232E and V.28/V.24 communi-
cations interfaces, particularly applications where 12V is not available.These parts

15
are especially useful in battery-powered systems, since their low-power shutdown
mode reduces power dissipation to less than 5W.

The MAX232 is an integrated circuit that converts signals from an RS-232 serial port
to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is
a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals.

Figure 3.5: MAX 232 IC Pin Description

3.1.5 Power supply


Power Supply is an important part of a circuit. It provides required supply to dif-
ferent blocks of the circuit from input 230 VAC.

Figure 3.6: Power supply Block Diagram

Description of the individual blocks is explained one by one.

1. Transformer:
A transformer is an electro-magnetic static device, which transfers electrical energy
from one circuit to another, either at the same voltage or at different voltage but at
the same frequency.

16
2. Rectifier:
The function of the rectifier is to convert AC to DC cur- rent or voltage. Usually in
the rectifier circuit full wave bridge rectifier is used.

3. Filter:
The Filter is used to remove the pulsated AC. A filter circuit uses capacitor and
inductor. The function of the capacitor is to block the DC voltage and bypass the
AC voltage. The function of the inductor is to block the AC voltage and bypass the
DC voltage.

4. Voltage Regulator:
Voltage regulator is an indispensable part of the power supply section of any elec-
tronic systems. The main advantage of the regulator ICs is that it regulates or
maintains the output constant, in spite of the variation in the input supply.

The circuit is:

Figure 3.7: Power Supply Circuit

3.1.6 RS-232 Cable


RS-232 (Recommended Standard 232) is a standard for serial binary data signals
connecting between a DTE (Data terminal equipment) and a DCE (Data Circuit-
terminating Equipment). A RS-232 Cable has a Data Terminal Equipment (DTE)
and DataCommunication Equipment (DCE); this defines at each device which wires
will be sending and receiving each signal. In general and according to the stan-
dard, terminals and computers have male connectors with DTE pin functions, and

17
modems have female connectors with DCE pin functions. Other devices may have
any combination of connector gender and pin definitions.

Figure 3.8: RS-232 Cable

At one end of the cable, a male DB9 connector is used and at another, a female
DB9 connector is used. Both are of same pin out. Connection be- tween them is
shown in the figure below:

Figure 3.9: Connection Between terminals of RS-232 cable

3.2 Communication within Hardwares


In the previous section, we have described hardwares involved in the reciev- ing
section, This section explains the details of communication within the hardwares.
Two types of communication are used: Bluetooth and Serial Communication.

3.3 Bluetooth
Bluetooth is a wireless technology that allows computers, phones and other devices
to talk to each other over short distances (up to 100 metres). Blue- tooth uses radio
waves (in the 2.4 Gigahertz range), and is designed to be a secure and inexpensive
way of connecting and exchanging information between devices without wires. Uses

18
of Bluetooth include: sending photos from your mobile, exchanging business cards,
sending voice from a headset to a mobile phone, and real-time satellite navigation
using GPS.

To connect PC to Bluetooth, Go to Control Panel under the Start Menu and look
for Bluetooth devices as pictured in the screenshot in the
gure below. The window below should open. Click Add Wireless Device as seen in
the screenshot. Before scanning for devices turn on Bluetooth on your cell phone.The
exact location of the Bluetooth setting will differ depending on the model of the
phone however it will normally follow something along the lines of: Menu - Settings
- Connections - Bluetooth - Turn On.

Figure 3.10: Screnshot for adding Bluetooth Device

Now scan for devices on your computer. It should pick up your cell phone. If it
doesnt, make sure Bluetooth is turned on and ensure that your status is set to Visible
or Detectable. Your phone must also be within 7 meters of your PC to ensure a
connection can be established. Once you have done these checks, search again.

Figure 3.11: Screnshot for Add Bluetooth Device Wizard

When your device is detected, click on the phones icon to connect. You may be

19
asked to enter in a security pin. Enter something easy like 1234. You phone will
then ask you to enter in said pin. This is not a specific number but rather done
just for paring purposes. Once you have done this correctly the connection will be
established. In our project, we have to connect bluetooth to the PC as long as we
want our system to operate. Bluetooth can be disconnected if we want to disable
the system i.e when we don’t want any new message to be displayed on the notice
board.

3.3.1 Serial Port Communication


In telecommunication and computer science, serial communication is the process
of sending data one bit at a time, sequentially, over a communica- tion channel or
computer bus. This is in contrast to parallel communica- tion, where several bits
are sent as a whole, on a link with several parallel channels. Serial communication is
used for all long-haul communication and most computer networks, where the cost
of cable and synchronization difficulties make parallel communication impractical.

In telecommunications, RS-232 (Recommended Standard 232) is the tra- ditional


name for a series of standards for serial binary single-ended data and control signals
connecting between a DTE (Data Terminal Equipment) and a DCE (Data Circuit-
terminating Equipment). It is commonly used in computer serial ports.

Figure 3.12: Serial Port Communication

In RS-232, user data is sent as a time-series of bits. Both synchronous and asyn-

20
chronous transmissions are supported by the standard. In addition to the data
circuits, the standard defines a number of control circuits used to manage the con-
nection between the DTE and DCE.

In our project, serial port communication is performed by using VB and Embedded


C as softwares and RS232 cable as hardware interface.

21
Chapter 4

Software Description

4.1 Express PCB


4.1.1 Introduction
Express PCB is free PCB software and is a snap to learn and use. For the fi rst
time, designing circuit boards is simple for the beginner and ecient for the profes-
sional. The board manufacturing service makes top quality two and four layer PCBs.

There are two parts to ExpressPCB, CAD software and board manufac- turing ser-
vice.CAD software includes ExpressSCH for drawing schematics and Express PCB
for designing circuit boards.

Figure 4.1: Express SCH

22
We recommend that you begin by drawing a schematic using ExpressSCH. This
software helps us in drawing final circuit. It has wide variety of com- ponents in
its library to choose from.Screen shot of Express SCH starting window is shown in
figure 4.1

Next, we have to use the ExpressPCB program to lay out your PC board. If we
link our schematic to ExpressPCB using Link schematic to PCB command found
under the File menu , it will guide us through the wiring process.When our layout
is complete, we can even determine the exact cost to have boards made with the
Compute Board Cost command.To order the boards, enter your name, address and
billing information into ExpressPCB and press the Send button within the Order
Boards Via The Internet dialog box. ExpressPCB is a very easy to use Windows
application for laying out printed circuit boards. It is also available on internet for
free.Screenshot of Express SCH starting window is also shown in figure below:

Figure 4.2: Express PCB

4.2 Embedded C
Introduction Use of embedded processors in passenger cars, mobile phones, medical
equipment, aerospace systems and defense systems is widespread, and even everyday
domestic appliances such as dish washers, televisions, washing machines and video
recorders now include at least one such device.

There is a large - and growing international demand for programmers with ’embed-
ded’ skills, and many desktop developers are starting to move into this important

23
area. Because most embedded projects have severe cost constraints, they tend to
use low-cost processors like the 8051 family of devices considered in this project.

Now the question comes that why we do programming in C. The reasons are that it
is easier and less time consuming to write in C than Assembly, C is easier to modify
and update, We can use code available in function libraries, and C code is portable
to other microcontroller with little of no modification.

Compilers produce hex files that is downloaded to ROM of microcontroller. The


size of hex file is the main concern.

4.2.1 Sample Programming in Embedded C


PROGRAM 1:
First program is an 8051 C program to send values 00 FF to port P1.Hexadecimal
FF is 255 in binary.This a very simple program in which datatype unsigned char is
used as a datatype.

Figure 4.3: Program1

PROGRAM 2:
Second program is related to creating time delay.This is a program to toggle bits of
P1 continuously forever with some delay.

Figure 4.4: Program2

24
PROGRAM 3:
Third program deals with Input/Output Programming. In this program, The data
pins of an LCD are connected to P1. The information is latched into the LCD
whenever its Enable pin goes from high to low. Write an 8051 C program to send
The Earth is but One Country to this LCD.

Figure 4.5: Program3

4.3 Keil Compiler


Keil was founded in 1986 to market add-on products for the development tools
provided by many of the silicon vendors. Keil implemented the first C compiler
designed from the ground-up specifically for the 8051 microcontroller.Sreenshot of
starting window of Keil compiler is shown in figure 4.6.

Figure 4.6: Keil Compiler Window

Keil development tools for the 8051 Microcontroller Architecture support every level

25
of software developer from the professional applications engineer to the student just
learning about embedded software development.

4.3.1 Creating a Project


STEP1:
Starting a new project:

STEP2:
Selecting the target device from the list of microcontrollers.

STEP3:
Writing Code in Keil

STEP4:
Debugging the program.

STEP5:
Creating HEX File: Check the Create HEX File box under Options for Target
Output, and Vision will automatically create a HEX file during the build process.
Select the desired HEX format through the drop-down control to generate format-
ted HEX files.

4.4 Visual Basic


Visual Basic (VB) is an event driven programming language and associ- ated devel-
opment environment from Microsoft for its COM programming model.Visual Basic
was derived from BASIC and enables the rapid appli- cation development (RAD)
of graphical user interface (GUI) applications and creation of ActiveX controls and
objects.A programmer can put together an application using the components pro-
vided with Visual Basic itself.

In Visual Basic, forms are created using drag and drop techniques. A tool is used to
place controls (eg. text boxes, buttons etc) on the form win- dow.Then, individual
programming for individual windows is done. Steps in Building a VB Application
includes:

Step 1: Draw the interface,

26
Step 2: Set Properties,and

Step 3: Write the events code

EXAMPLE1: Calculate Volume of a cylinder. Form designed would be:

Figure 4.7: Form to calculate volume of cylinder

Coding behind OK button:

Private Sub OK Click( )


r = Val(radius.Text)
h = Val(height.Text)
pi = 22 / 7
v = pi * (r*r) X h
volume:T ext = Str(v)
End Sub

Procedure for clicking the OK button to calculate the volume of cylinder is-

-get the value of r from the radius text box


-get the value of h from the height text box
-assign a constant value 22/7 to pi
-calculate the volume using formula

27
-output the results to the Volume text box
-End of Procedure

This is all about Softwares used in this project.

28
Chapter 5

Interfacing

5.1 Microcontroller-LCD Interfacing:


Frequently, an 8051 program must interact with the outside world using input and
output devices that communicate directly with a human being. One of the most
common devices attached to an 8051 is an LCD display. Some of the most common
LCDs connected to the 8051 are 16x2 and 20x2 displays. This means 16 characters
per line by 2 lines and 20 characters per line by 2 lines, respectively.

Fortunately, a very popular standard exists which allows us to communicate with


the vast majority of LCDs regardless of their manufacturer. The standard is re-
ferred to as HD44780U, which refers to the controller chip which receives data from
an external source (in this case, the 8051) and communicates directly with the LCD.

5.1.1 Understanding LCD HD44780 pins:


Before going into the deep of interfacing, we need to understand the pinout of LCD.
The 44780 standard requires 3 control lines as well as either 4 or 33 I/O lines for
the data bus. 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 (3 control lines plus the 4 lines for the data bus). If an 8-bit data bus
is used the LCD will require a total of 11 data lines (3 control lines plus the 8 lines
for the data bus). The three control lines are referred to as EN, RS, and RW.

29
The EN line is called ”Enable.” This control line is used to tell the LCD that
you are sending it data. To send data to the LCD, your program should make sure
this line is low (0) and then set the other two control lines and/or put data on the
data bus. When the other lines are com- pletely ready, bring EN high (1) and wait
for the minimum amount of time required by the LCD datasheet (this varies from
LCD to LCD), and end by bringing it low (0) again.The RS line is the ”Register
Select” line. When RS is low (0), the data is to be treated as a command or special
instruction (such as clear screen, position cursor, etc.). When RS is high (1), the
data being sent is text data which sould be displayed on the screen.

5.1.2 Hardware Connections:

Figure 5.1: Microcontroller-LCD Interfacing

Here we have chosen port 1 to connect to data lines DB0-DB7 of LCD. Also we
have chosen to connect second pin of port 3(P3.2) to register select pin (RS), third
pin of port 3(P3.3) to read/write enable (R/W) and finally fourth pin of port 3(P3.4)
to enable pin (en). This hardware configuration is shown in figure 4.1

As we can see, we’ve established a 1-to-1 relation between a pin on the 8051 and a
line on the 44780 LCD. Thus as we write our assembly C pro- gram to access the
LCD, we are going to equate constants to the 8051 ports so that we can refer to
the lines by their 44780 name as opposed to P1.0, P1.1 etc. The sbit data type is
used to access to the single bits of special function registers, and thus utilized for
our purpose. Thus in embedded C:

30
As we can see, we’ve established a 1-to-1 relation between a pin on the 8051 and
a line on the 44780 LCD. Thus as we write our assembly C program to access the
LCD, we are going to equate constants to the 8051 ports so that we can refer to
the lines by their 44780 name as opposed to P1.0, P1.1 etc. The sbit data type is
used to access to the single bits of special function registers, and thus utilized for
our purpose. Thus in embedded C:

sbit begin=P0.0; /**1st data line of LCD connected to P0.0***/


sfr lcddata=0x90; /**p1 port is selected for sending data to lcd***/
sbit rs=P3.2; /**RS pin of LCD connected to P3.2**/
sbit rw=P3.3; /**RW pin of LCD connected to P3.3**/
sbit en=P3.4; /**enable pin of LCD connected to P3.4**/

5.1.3 Programming the LCD:


Programming the LCD includes following subroutines:
1. Delay
2. LCD Initialization
3. Sending data to LCD
4. Display Data

1. Delay:

LCD has a busy flag, when the busy flag is 1, the LCD is in the internal opera-
tion mode, and the next instruction will not be accepted. When RS = 0 and R/W
= 1 (see the table above), the busy flag is output to DB7 (MSB of LCD data bus).
The next instruction must be written after ensuring that the busy flag is 0. We
can use subroutine for checking busy flag but if LCD never come out from ”busy”
status because of some problems ,The program will ”hang,” waiting for DB7 to go
low. So in a real applications it would be wise to put some kind of time limit on the
delay. This would guarantee that even if the LCD hardware fails, the program would
not lock up. Thus a delay subroutine needs to be called writing commands for LCD.

2. LCD Initialization:

Before we may really use the LCD, we must initialize and configure it. This is
accomplished by sending a number of initialization instructions to the LCD. The

31
first instruction we send must tell the LCD whether we’ll be communicating with
it with an 8-bit or 4-bit data bus. We also select a 5x8 dot character font. These
two options are selected by sending the command 38h to the LCD as a command.
As we can recall from the last section, we mentioned that the RS line must be low
if we are sending a command to the LCD. Thus, to send this 38h command to the
LCD we must execute the following 8051 instructions in embedded C:

void command(unsigned char var)


{
lcddata = var;
rs = 0; //Selected command register
rw = 0; //We are writing in instruction register
en = 1; //Enable High to Low
en = 0;
delay(); //Wait for LCD to process the command
}
// Using the above function is really simple
// var will carry the command for LCD
// e.g. //
// command(0x38) will initialize LCD for 2 Line, 8-bit, 5x7 dots. Similarly other
commands can be sent through this function. Hexadecimal codes for various com-
mands can referred from datasheet.

3. Sending Data to LCD:

To send data we simply need to select the data register. Everything is same as
the command routine. Following are the steps:
= Move data to LCD port
= select data register
= select write operation
= send enable signal
= wait for LCD to process the data

Keeping these steps in mind we can write LCD command routine as:

void senddata(unsigned char word)


{

32
lcddata = word; //Function set: 2 Line, 8-bit, 5x7 dots
rs = 1; //Selected data register
rw = 0; //We are writing
en = 1; //Enable High to Low
en = 0;
delay(); //Wait for LCD to process the command
{
// Using the above function is really simple
// we will pass the character to display as argument to function
// e.g. //
// senddata(’A’);

4. Displaying Data:

Now to display data, a simple C program is written to take characters (word) one by
one and display it on LCD screen one by one. This is it, with LCD Interfacing. This
section described hardware as well as software concepts related to LCD interfacing
with microcontroller.

5.2 Microcontroller-PC Interfacing:


The text message separated from the original message is to be sent to microcon-
troller to display on LCD. This is done by connecting computer’s serial port to the
circuit. In PC, at RS-232 voltage levels, logic 1 varies from -3 to -15 volts and logic
0 from +3 to +15 volts. The microcontroller which works on TTL logic levels, logic
1 is +5 volts and logic 0 is 0 volts. Therefore to interface the two we use a MAX
232 driver IC.

8051 provides a transmit channel and a receive channel of serial communication.


The transmit data pin (TXD) is specified at P3.1, and the receive data pin (RXD)
is at P3.0. The serial signals provided on these pins are TTL signal levels and must
be boosted and inverted through a suitable converter(MAX232) to comply with
RS232 standard.

All modes are controlled through SCON, the Serial CONtrol register. The SCON
bits are defined as SM0, SM1, SM2, REN, TB8, RB8, TI, RI from MSB to LSB.
The timers are controlled using TMOD, the Timer MODe register, and TCON, the

33
Timer CONtrol register.Following figure shows this connection.

Figure 5.2: PC-Microcontroller Interfacing

5.2.1 RS-232 Level Converters:


The most commonly used RS-232 level converter is MAX232. Figure below shows
internal circuit of MAX232.

Figure 5.3: MAX 232 Internal Circuit

Usually all the digial ICs works on TTL or CMOS voltage levels which cannot
be used to communicate over RS-232 protocol. So a voltage or level converter is
needed which can convert TTL to RS232 and RS232 to TTL voltage levels. It must
be specified that here, in our case, MAX232 is a DCE (Data Circuit Terminating

34
Equipment). It is because data is to be sent finally to MAX232 only.

Now we come to Programming part:


An important parameter considered while interfacing serial port is the Baud rate
which is the speed at which data is transmitted serially. AT89C51 mi- crocontroller
can be set to transfer and receive serial data at different baud rates using software
instructions.

Timer1 is used to set the baud rate of serial communication for the microcontroller.
For this purpose, Timer1 is used in mode2 which is an 8-bit auto reload mode. To
get baud rates com- patible with the PC, TH1 should be loaded with the hexadeci-
mal values corresponding to particular baud rates. Figure below shows hexadecimal
codes for different baud rates:

Figure 5.4: HEX Codes for different Baud Rates

In this project baud rate 4800bps is used and thus FA hexadecimal code is used
while setting the baud rate.

5.2.2 Serial Communication at PC side


Serial Communication at PC side is done using VB. Visual Basic can be used to
access serial communication functions. Windows hides much of the complexity of
serial communications and automatically puts any received characters in a receive
buffer and characters sent into a transmission buffer. The receive buffer can be
read by the program whenever it has time and the transmit buffer is emptied when
it is free to send characters. The Comm component is added to a form whenever
serial communications are required. By default, the first created object is named
MSComm1 (the second is named MSComm2, and so on).

Visual Basic has number of functions for serial port control. Let us take an example
on how to send data to a microcontroller and make the microcontroller respond to
the data.

35
5.2.3 Serial Communication at microcontroller side
In Embedded C, Initializing USART in microcontroller 89c52 is done by using fol-
lowing code:
unsigned char a;
void main ()
{
TMOD = 0x21; /*enable timer1, mode 2 (auto reload mode)*/
SCON = 0x50; /**8 bit, 1 stop bit, REN enabled**/
TH1 = 0xFD; /**9600 Baud rate**/
TL1 = 0xFD;
TR1 = 1; /**start timer 1**/
while (1) /**continues loop**/
{
a= getchar () ;
while(a=offh) /**checks sync byte***/
P2.0=a; /**sends data to port p2.0***/
{
{

This is it with PC- microcontroller interfacing.

5.3 Mobile to PC Communication


This section can also be called as modem-PC communication as we are using mo-
biles modem for receiving messages. After receiving, we are sending it to PC via
Bluetooth. Mobiles GSM Modem is used to receive message from the authorized
user. This modem requires a SIM card from a wireless carrier in order to operate.
This SIM number is contact number of the receiving section.

First thing we need to do is to connect mobile to Bluetooth. This will work in


precisely the same was as a USB cable in terms of transferring data but it elimi-
nates the need for a cable (Im told many budget phones are being shipped without
USB cables).

We will need two things for this to work:


1. A Bluetooth-enabled computer. Most laptops now have Bluetooth and so do
some desktops. If yours doesnt, you can buy a USB Bluetooth adapter cheaply on

36
sites such as EBay.

2. A Bluetooth-enabled mobile phone.

As long as we want to keep the system working, we need to switch ON the Blue-
tooth of the mobile phone ON and connected to PCs Bluetooth. This phone can
be used by user for doing normal tasks as well. That means the phone needs not to
be dedicated for this specific purpose of sending received message to PC. Another
requirement for the cell phone is that it should store the incoming message directly
into SIM, which is available in most mobile phone sets.

5.3.1 AT Commands
AT Commands is a set of commands understood by modems. AT commands
are instructions used to control a modem. AT is the abbreviation of ATtention.
Every command line starts with ”AT” or ”at”. That’s why modem commands
are called AT commands. Common AT command set, GSM/GPRS modems and
mobile phones support an AT command set that is specific to the GSM technol-
ogy, which includes SMS-related commands like AT+CMGS (Send SMS message),
AT+CMSS (Send SMS message from storage), AT+CMGL (List SMS messages)
and AT+CMGR (Read SMS messages).

Mobiles GSM Modem is used to receive message from the authorized user. This
modem requires a SIM card from a wireless carrier in order to operate. This SIM
number is contact number of the receiving section.

PCs use AT commands to control modems. Although GSM modem is interfaced


with PC through Bluetooth using a VB program, a GSM modem can be tested
before actually implementing into the system. The MS HyperTerminal is a handy
tool when it comes to testing the GSM device. It can be found at Start - Programs
- Accessories - Communications - HyperTerminal. Various parameters like connec-
tion name, icon, comm port, and correct port settings are specified for our GSM
modem.Finally in the hyper terminal main window, AT commands are sent and
responds received from GSM modem can be seen. Screenshot of dialog box showing
sending and receiving of AT commands is shown in figure below (Here mobile phone
connection is the connection name)

AT and AT+CPIN are initiallising commands. All other SMS commands stated

37
earlier like AT+CMGR, AT+CMGS can be checked by using hyper terminal to test
mobiles modem. But, this only for the purpose of testing, in our project, we are
making the whole system automated. So, Visual Basic program uses AT commands
to interface mobile with PC. After extracting password from the received message
and authenticating the user, it will send the remaining part of the message to serial
port. By serial port communication, microcontroller receives the message and dis-
plays it on LCD Display.

38
5.4 Overall Functional Flowcahrt

39
Chapter 6

Final Circuit Schematic And PCB Layout

6.1 Schematic of final circuit


This schematic was drawn using Express SCH as explained in Software Description.

Figure 6.1: Schematic of Final circuit

40
6.2 PCB Layout-Main PCB

Figure 6.2: PCB Layout of Main PCB

41
6.3 PCB Layout-Side PCB having MAX232

Figure 6.3: PCB Layout of Side PCB having MAX232

42
Chapter 7

Conclusion

7.1 Conclusion
By introducing the concept of wireless technology in the field of communication we
can make our communication more efficient and faster, with greater efficiency we
can display the messages and with less errors and maintenance. This model can be
used very efficiently in establishments like chain restaurants wherein the order and
special discounts can be displayed at all branches simultaneously, in colleges wherein
students and staffs can be informed simultaneously in no time. It can be set up at
public transport places like railways, bus station, and airport and also at roadside
for traffic control and in emergency situations, it is cost efficient system and very
easy to handle, a single person can handle all the work with just a message. PC
with administrator can be used for ease of message sending and keeping record.

7.2 Applications:
1. Educational Institutions and Organizations: Currently we rely on putting up pa-
pers on notice boards to inform people of events. This method can be discarded by
using wireless notice boards to display information in real time.

2. Crime Prevention: Display boards put up on roads will display tips on public
security, accident prevention, information on criminals on the run. The board will
help flash messages such as vehicle thefts as and when they occur.

43
3. Managing Traffic: In metropolitan cities we frequently come across traffic jams.
One way to avoid this would be inform people beforehand to take alternate routes.
A wireless notice board serves well for this purpose.

4. Advertisement: In shopping malls we get to hear the offers on various prod-


ucts from time to time. Instead we continuously display the information regarding
the products and related offers on electronic display boards.

5. Railway Station: Instead of announcing the delay in arrival of trains we can


display the information.

7.3 Merits:
1. User friendly: Messages are only to be typed on a mobile or a computer, which
in turn are displayed wirelessly on the display unit.

2. Eliminates use of printers: Since we dont use papers to display information, print-
ers are also of no use in this system.

3. Faster means of transferring information: There is no delay in transmission of


information. Messages are displayed in a matter of seconds after typing.

4. Long Range: As long as we have the required network coverage we can send
messages from any part of the world.

7.4 Demerits:
1. Dependent on signal strength: Messages are not transmitted if there is weak net-
work coverage.

2. Volatile memory used for message storage: Messages last only as long as power
is ON.

7.5 Future enhancements:


1. Alphanumeric LCDs have a limitation on size as well as no of characters. These
can be replaced with large LED display boards which are not only eye catching but

44
display characters in a moving fashion one after the other.

2. In our project we are sending messages via GSM network and displaying on
a LCD by utilizing AT commands. The same principle can be applied to control
electrical appliances at a distant location.

3. Robots can be controlled in a similar fashion by sending the commands to the


robots. These commands are read by using AT commands and appropriate action is
taken. This can be used for spy robots at distant locations, utilized by the military
to monitor movement of enemy troops.

4. Currently farmers have to manually put on or off pumps, drippers etc by us-
ing electric switches. Using the principle of AT commands we can put on or off
these appliances remotely.

5. Temperature display during periods wherein no message buffers are empty is


one such theoretical improvement that is very possible.

6. Multilingual display can be another added variation of the project. The dis-
play boards 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
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.

45
References

List of references

[1] Mrs. S.P. Gaikwad, Mannikeshwari Shahdeo, Meghna Priya, Prashant Kr.
Raghav.Wireless Electronic Notice Board

[2] Fundamentals of Liquid Crystal Displays How They Work and What They Do
by FUJITSU MICROELECTRONICS AMERICA, INC.

[3] DESIGN AND DEVELOPMENT OF AN RS232-BASED ROV CONTROLLER


SYSTEM 1. Zainah Md. Zain, R. Badlishah Ahmad and Mohd. Rizal Arshad

Books or a report

[1] Janice Gillispie Mazidi, Rolin D. McKinlay,Muhammad Ali Mazid. The 8051
Microcontroller and System.

[2] Siegmund Redl, MatthiasWeber, MalcolmW. Oliphant. GSM and Personal Com-
munications Handbook, 2005.

Mannuals

[1] Philips semiconductors/80c51 8 bit microcontroller data sheets

[2] MATRIX SIMADO GDT11 GSM MODEM Manu

[3] MAX 232 data sheet from Texas Instruments

URL’S

[1] http://burnsidetelecom.com/whitepapers/gsm.pdf

46
[2] http://www.cisco.com

[3] http://www.alldatasheets.com

[4] http://www.atmel.com/dyn/resources/prodd ocuments/doc0265.pdf

[5]http : //www.robotroom.com/AlphanumericDisplay.html

[6]http : //pdf serv.maxim − ic.com/en/an/AN 83.pdf

47
Appendices

Appendix 1: Coding For Microcontroller(Embedded C)

Appendix 2: Coding For Visual Basic(Main Window)

Appendix 3: Coding For Visual Basic(Password Setting)

Appendix 4: Datasheet of AT89C52 Microcontroller

Appendix 5: Datasheet of LCD IC Hitachi HD44780

Appendix 6: Datasheet of MAX-232 Level Converter

48
Appendix 1: Coding For Microcontroller(Embedded C)

//————Controller AT89S52————-//

# include <reg52.h>
unsigned char m=0,y=0,Lcd Word;
sfr lcddata=0x90; //p1 port
sbit rs=P3ˆ 2;
sbit rw=P3ˆ 3;
sbit en=P3ˆ 4;
//———————–start of program functions———————–//
//————————-Delay subroutine——————————–//
void delay(unsigned char b)
{
unsigned char a;
for(b;b¿0;b–)
for (a=72;a¿0;a–);
}

//—————————LCD Routine————————————//
void command(unsigned char dost)
{
lcddata=dost;
en=1;
rs=0;
//initialise of the LCD
rw=0;
delay(5);
en=0;
}

void lcddisplaydata(unsigned char word)


{
lcddata=word;
en=1; //Data writing of the Lcd
rs=1;

49
rw=0;
delay(5);
en=0;
}
void displaydata(unsigned char *word)
{
int x;
for(x=0;word[x]!=0;x++) //Data writing of the LCD
{
lcddisplaydata(word[x]);
}
}

/——————————–serial transmit———————————————–/
void serial() interrupt 4
{
Lcd Word=SBUF;
if (Lcd Word==’L’)
{
command(0X01);
command(0X80);
goto next;
}
lcddisplaydata(Lcd Word); // putting read material to Buffer register
next:
RI=0;
}
/——————————————Main Program—————————————-/
void main()
{
TMOD=0X20;
SCON=0X50;
TH1=0XFD; //9600 baud rate
command(0X38);
delay(5);
command(0x0F);
delay(5);

50
command(0X83);
delay(2000);
displaydata(”Hi welcome GSM”);
command(0X80);
IE=0X90;
TR1=1;
while(1);
}

51
Appendix 2: Coding For Visual Basic(Main Window)

Option Explicit
Dim variable1 As String
Dim variable2 As String
Dim variable3 As String
Dim variable4 As String
Dim done message, l, z, variables As Integer
Dim str As String
Dim Data

Private Sub Command1 Click()


On Error Resume Next
Open App.Path & (” Data.txt”) For Input As # 1 Input # 1, variable1, variable2,
variable3 Form2.Text1.Text = variable1
Form2.Text2.Text = variable2
Form2.Text3.Text = variable3
Close # 1 Unload Me
Form2.Show
End Sub

Private Sub Command2 Click()


MSComm1.Output = ”AT+CMGF=1” & vbCrLf
Sleep (2000)
MSComm1.Output = ”AT+CMGS=” & Chr(34) & Text2.Text & Chr(34) & vbCrLf
Sleep (2000) MSComm1.Output = ”accepted message displayed” & Chr(26) Sleep
(1000) End Sub

Private Sub Command4 Click()


MSComm1.Output = ”AT+CMGR=” & Text5.Text & vbCrLf Sleep (2000)
done message = 1
End Sub

Private Sub Command5 Click()


Dim str As String
On Error Resume Next

52
MSComm1.CommPort = Text4.Text
MSComm1.RThreshold = 1
MSComm1.InputLen = 1
MSComm1.InBufferSize = 258
’ 9600 baud, no parity, 8 data bits, 1 stop bit
MSComm1.Settings = ”9600,N,8,1”

’ Disable DTR
MSComm1.DTREnable = False

’open the port


MSComm1.PortOpen = True
———————————–Circuit displaying Part—————————————— MSComm
=1
MSComm2.RThreshold = 1
MSComm2.InputLen = 1
MSComm2.InBufferSize = 258
’ 9600 baud, no parity, 8 data bits, 1 stop bit
MSComm2.Settings = ”9600,N,8,1”

’ Disable DTR
MSComm2.DTREnable = False

’open the port


MSComm2.PortOpen = True

Open App.Path & (” Data.txt”) For Input As # Input #, variable1, variable2,


variable3
Form2.Text1.Text = variable1
Form2.Text2.Text = variable2
Form2.Text3.Text = variable3
Close #

Command1.Enabled = False
Command6.Enabled = True
Command6.Visible = True
Command5.Enabled = False

53
Command5.Visible = False
Command2.Enabled = True
End Sub

Private Sub Command6Click()


Command1.Enabled = True
Command5.Enabled = True
Command5.Visible = True
Command6.Enabled = False
Command6.Visible = False
Command2.Enabled = False
End Sub

Private Sub Form Load()


done message = 2
End Sub

Private Sub MSComm1 OnComm()


Dim message As String
Dim variable12 As String
On Error Resume Next
’MSComm1.PortOpen = False
MSComm1.CommPort = Text4.Text
MSComm1.RThreshold = 1
MSComm1.InputLen = 25
’MSComm1.InBufferSize = 258
’ 9600 baud, no parity, 8 data bits, 1 stop bit
MSComm1.Settings = ”9600,N,8,1”
’ Disable DTR
MSComm1.DTREnable = False
’open the port
MSComm1.PortOpen = True

If MSComm1.CommEvent = comEvReceive Then

If (done message = 1) Then


Do

54
Data = Data & MSComm1.Input
Loop Until InStr(Data, ”OK”)
done message = 3
message = Data
Data = ””

variable12 = InStr(message, ”+91”)


Text6.Text = Mid$ (message, variable12, 13)

variable12 = InStr(message, ” ”) ’ THE PASSWORD STREAM


Text1.Text = Mid$ (message, variable12 + 2, 4)

variable12 = variable12 + 7
Text3.Text = Mid$ (message, variable12, ((Len(message) - 2) - (variable12 + 2)))
Teb

ElseIf done message = 2 Then

Do
Data = Data & MSComm1.Input
Loop Until InStr(Data, Text5.Text)

Sleep (100)
Data = ””
l=0
done message = 1
MSComm1.Output = ”AT+CMGR=” & Text5.Text & vbCrLf
Sleep (1000)
End If

End If

End Sub

Sub Teb()

55
On Error Resume Next
MSComm1.CommPort = Text4.Text
MSComm1.RThreshold = 1
MSComm1.InputLen = 231
MSComm1.InBufferSize = 258
’ 9600 baud, no parity, 8 data bits, 1 stop bit
MSComm1.Settings = ”9600,N,8,1”

’ Disable DTR
MSComm1.DTREnable = False

’open the port


MSComm1.PortOpen = True

str = Text1.Text

If (str = variable1) Or (str = variable2) Or (str = variable3) Then

MSComm1.Output = ”AT+CMGF=1” & vbCrLf


Sleep (1000)
MSComm1.Output = ”AT+CMGS=” & Chr(34) & Text6.Text & Chr(34) & vbCrLf
Sleep (2000)
MSComm1.Output = ”accepted message displayed” & Chr(26)
MSComm2.Output = ”L”
Sleep (1000)

variables = Len(Text3.Text)
MSComm2.Output = ”L”
Sleep (1000)

Do
Text3.Text = Right(Text3.Text, (Len(Text3.Text) - 1))
MSComm2.Output = Mid$ (Text3.Text, 1)
Sleep (700)
Loop Until (z < variables)
Else
MSComm1.Output = ”AT+CMGF=1” & vbCrLf

56
Sleep (1000) MSComm1.Output = ”AT+CMGS=” & Chr(34) & Text6.Text &
Chr(34) & vbCrLf Sleep (2000)
MSComm1.Output = ”access denied” & Chr(26)
Sleep (1000)
End If

MSComm1.Output = ”AT+CMGD=” & Text5.Text & vbCrLf


Sleep (1000)
Timer1.Enabled = True

End Sub

Private Sub Timer1 Timer()


If (l = 4) Then
donemessage = 2
l=0
Text1.Text = ””
Text6.Text = ””
Text3.Text = ””
Data = ””
Timer1.Enabled = False
Exit Sub
End If
l=l+1
End Sub

57
Appendix 3: Coding For Visual Basic(Password Setting)

Private Sub Command1 Click()


Open App.Path & (”.txt”) For Output As # 1
Write # 1, Text1.Text, Text2.Text, Text3.Text
Close# 1
Unload Me
Form1.Show
End Sub

58
Appendix 4: Datasheet of AT89C52 Microcontroller

59
Appendix 5: Datasheet of LCD IC Hitachi HD44780

60
Appendix 6: Datasheet of MAX-232 Level Converter

61

You might also like