Professional Documents
Culture Documents
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
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.
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
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.
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.
Submitted by:
Ankita Dashora
Swati Dadhich
Aman Jain
Yogesh Kumar Verma
iii
Contents
Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii
Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii
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
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
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
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.
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.
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.
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.
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.
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:
6
User Interface window for password setting is shown in following figure:
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.
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.
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.
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
11
Chapter 3
Receiving Section
1. Hardware Description
2. Communication within Hardwares
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:
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.
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.
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
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.
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.
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.
17
modems have female connectors with DCE pin functions. Other devices may have
any combination of connector gender and pin definitions.
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:
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.
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.
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.
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.
21
Chapter 4
Software Description
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.
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:
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.
PROGRAM 2:
Second program is related to creating time delay.This is a program to toggle bits of
P1 continuously forever with some delay.
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.
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.
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.
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:
26
Step 2: Set Properties,and
Procedure for clicking the OK button to calculate the volume of cylinder is-
27
-output the results to the Volume text box
-End of Procedure
28
Chapter 5
Interfacing
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.
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:
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:
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:
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.
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.
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.
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:
In this project baud rate 4800bps is used and thus FA hexadecimal code is used
while setting the baud rate.
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***/
{
{
36
sites such as EBay.
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.
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
40
6.2 PCB Layout-Main PCB
41
6.3 PCB Layout-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.
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.
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.
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.
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.
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.
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
URL’S
[1] http://burnsidetelecom.com/whitepapers/gsm.pdf
46
[2] http://www.cisco.com
[3] http://www.alldatasheets.com
[5]http : //www.robotroom.com/AlphanumericDisplay.html
47
Appendices
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;
}
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
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
’ Disable DTR
MSComm2.DTREnable = False
Command1.Enabled = False
Command6.Enabled = True
Command6.Visible = True
Command5.Enabled = False
53
Command5.Visible = False
Command2.Enabled = True
End Sub
54
Data = Data & MSComm1.Input
Loop Until InStr(Data, ”OK”)
done message = 3
message = Data
Data = ””
variable12 = variable12 + 7
Text3.Text = Mid$ (message, variable12, ((Len(message) - 2) - (variable12 + 2)))
Teb
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
str = Text1.Text
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
End Sub
57
Appendix 3: Coding For Visual Basic(Password Setting)
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