Top Banner
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.
70

2

Nov 26, 2014

Download

Documents

Ankita Dashora

multiuser gsm based wireless electronic notice board
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 2

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 EngineeringM. L. V. Textile & Engineering College.

Bhilwara 311001,INDIA.

Page 2: 2

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 EighthSemester of B.Tech (ECE) at the MLV Textile and Engineering College, Bhilwara. Itis an authentic record of my original work pursued under the guidance of Mrs.HareetaMalani, Assistant Professor, MLVTEC, Bhilwara. I have not submitted thematter embodied in this project for the award of any other degree.

Place: Bhilwara Submitted by:Date: 17-05-2011 Ankita Dashora

Swati DadhichAman JainYogesh Kumar Verma

i

Page 3: 2

BONAFIDE CERTIFICATE

This is to certify that the project work entitled“Multiuser GSM Based WirelessElectronic Notice Board” is carried out by

Ankita DashoraSwati DadhichAman JainYogesh Kumar Verma

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

Internal Guide:

Mrs. Hareeta MalaniAsst. Professor, ICT Department

Submitted for viva-voice examination held on Date

Internal Examiner: External Examiner:

i

Page 4: 2

Abstract

GSM based electronic notice display system is presented in this paper, this is themodel for displaying notices in college on electronic notice board by sending messagesin form of SMS through mobile. Message will be transmitted by user at transmittingsection. 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 willread the message and separates password and the text from the received message.After checking the password, user is authenticated and the remaining text messageswill 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 microcontrolleris interfaced with serial port via MAX232 level convertor. Microcontroller codingwill be done using Embedded C and Kiel. Multiple Users are authorized to updatenotices on the electronic notice board by providing them a password. Althoughthe system is automated, still a PC with an administrator can be kept for ease ofkeeping records monitoring the system.

ii

Page 5: 2

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 sourceof 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 belovedparents for their blessings, my friends/classmates for their help and wishes for thesuccessful completion of this project.

Submitted by:Ankita DashoraSwati DadhichAman JainYogesh Kumar Verma

iii

Page 6: 2

Contents

Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iCertificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iAbstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iiAcknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii

1 Introduction and Design Overview 11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Design Overview: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Transmitting Section 82.1 GSM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.2 Technical Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3 GSM Frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.4 Subscriber Identity Module (SIM) . . . . . . . . . . . . . . . . . . . . 102.5 GSM Network Structure . . . . . . . . . . . . . . . . . . . . . . . . . 102.6 GSM Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Receiving Section 123.1 Hardware Description . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.1.1 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . 123.1.2 GSM Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.1.3 Display unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.1.4 MAX 232 Level Converter . . . . . . . . . . . . . . . . . . . . 153.1.5 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.1.6 RS-232 Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.2 Communication within Hardwares . . . . . . . . . . . . . . . . . . . . 183.3 Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.3.1 Serial Port Communication . . . . . . . . . . . . . . . . . . . 20

4 Software Description 224.1 Express PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

iv

Page 7: 2

4.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2 Embedded C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4.2.1 Sample Programming in Embedded C . . . . . . . . . . . . . . 244.3 Keil Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

4.3.1 Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . 264.4 Visual Basic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5 Interfacing 295.1 Microcontroller-LCD Interfacing: . . . . . . . . . . . . . . . . . . . . 29

5.1.1 Understanding LCD HD44780 pins: . . . . . . . . . . . . . . . 295.1.2 Hardware Connections: . . . . . . . . . . . . . . . . . . . . . . 305.1.3 Programming the LCD: . . . . . . . . . . . . . . . . . . . . . 31

5.2 Microcontroller-PC Interfacing: . . . . . . . . . . . . . . . . . . . . . 335.2.1 RS-232 Level Converters: . . . . . . . . . . . . . . . . . . . . . 345.2.2 Serial Communication at PC side . . . . . . . . . . . . . . . . 355.2.3 Serial Communication at microcontroller side . . . . . . . . . 36

5.3 Mobile to PC Communication . . . . . . . . . . . . . . . . . . . . . . 365.3.1 AT Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.4 Overall Functional Flowcahrt . . . . . . . . . . . . . . . . . . . . . . 39

6 Final Circuit Schematic And PCB Layout 406.1 Schematic of final circuit . . . . . . . . . . . . . . . . . . . . . . . . . 406.2 PCB Layout-Main PCB . . . . . . . . . . . . . . . . . . . . . . . . . 416.3 PCB Layout-Side PCB having MAX232 . . . . . . . . . . . . . . . . 42

7 Conclusion 437.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437.2 Applications: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437.3 Merits: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447.4 Demerits: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447.5 Future enhancements: . . . . . . . . . . . . . . . . . . . . . . . . . . . 44References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

v

Page 8: 2

List of Figures

1.1 Block Diagram of the System . . . . . . . . . . . . . . . . . . . . . . 51.2 User Interface Window at PC . . . . . . . . . . . . . . . . . . . . . . 61.3 User Interface Window for password setting at PC . . . . . . . . . . . 7

2.1 GSM Bands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.2 Block Diagram of GSM Structure . . . . . . . . . . . . . . . . . . . . 11

3.1 IC Pin Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.2 LG GB210 Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.3 Some common SMS AT Commands . . . . . . . . . . . . . . . . . . 143.4 Pin configuration of LCD . . . . . . . . . . . . . . . . . . . . . . . . . 153.5 MAX 232 IC Pin Description . . . . . . . . . . . . . . . . . . . . . . 163.6 Power supply Block Diagram . . . . . . . . . . . . . . . . . . . . . . . 163.7 Power Supply Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.8 RS-232 Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.9 Connection Between terminals of RS-232 cable . . . . . . . . . . . . . 183.10 Screnshot for adding Bluetooth Device . . . . . . . . . . . . . . . . . 193.11 Screnshot for Add Bluetooth Device Wizard . . . . . . . . . . . . . . 193.12 Serial Port Communication . . . . . . . . . . . . . . . . . . . . . . . . 20

4.1 Express SCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224.2 Express PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.3 Program1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244.4 Program2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244.5 Program3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254.6 Keil Compiler Window . . . . . . . . . . . . . . . . . . . . . . . . . . 254.7 Form to calculate volume of cylinder . . . . . . . . . . . . . . . . . . 27

5.1 Microcontroller-LCD Interfacing . . . . . . . . . . . . . . . . . . . . . 305.2 PC-Microcontroller Interfacing . . . . . . . . . . . . . . . . . . . . . . 345.3 MAX 232 Internal Circuit . . . . . . . . . . . . . . . . . . . . . . . . 345.4 HEX Codes for different Baud Rates . . . . . . . . . . . . . . . . . . 35

vi

Page 9: 2

6.1 Schematic of Final circuit . . . . . . . . . . . . . . . . . . . . . . . . 406.2 PCB Layout of Main PCB . . . . . . . . . . . . . . . . . . . . . . . . 416.3 PCB Layout of Side PCB having MAX232 . . . . . . . . . . . . . . . 42

vii

Page 10: 2

Chapter 1

Introduction and Design Overview

1.1 Introduction

Wireless communication has announced its arrival on big stage and the world isgoing mobile. We want to control everything and without moving an inch. Thisremote control of appliances is possible through Embedded Systems. The use ofEmbedded 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 EmbeddedSystems have come very near to the common people. The number of people with cellphones is on the rise. A day will come, somewhere in the near future, when a mobilephone is referred to in the same class of Food, clothing and shelter”. Improvementsin the Networking technologies have fostered growth of very dense networks. Landline telephones have been becoming less and less popular and people now prefercommunicating 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 destructiveremotely ignitable bombs, from the pins to the planes, remote control is not onlyoccupying a omnipresence state, but is also enhancing its scope and domains.

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

1

Page 11: 2

home appliances to a mobile phone wirelessly. With this, people would be able toturn on and off, and to some extent, control the appliances at their home even froma distant place. One of the very basic examples of an utility of this is switching onthe air conditioner in the room just some time before reaching home, so that theroom 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 exchangedevery day is enormous. SMS messaging is now one of the most important revenuesources of wireless carriers. What is so special about SMS that makes it so popularworldwide? 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, youcan send and read SMS messages at any time, no matter you are in your office, ona bus or at home.

SMS Messages can be Sent to an Offline Mobile Phone: Unlike a phone call, you cansend 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 temporarilyunavailable. The SMS system of the mobile network operator will store the SMSmessage 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 phonecall, you do not need to read or reply an SMS message immediately. Besides, writingand reading SMS messages do not make any noise. While you have to run out of atheater or library to answer a phone call, you do not need to do so if SMS messagingis used.

SMS Messages are Supported by 100 percent GSM Mobile PhonesSMS 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

Page 12: 2

other wireless carriers worldwide.

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

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 potentialuser base.

b. Secondly, SMS messages are capable of carrying binary data besides text. Theycan 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 downloadapplication that charges a fee from the user for each ringtone downloaded. One wayto accept payment is to use a reverse billing phone number obtained from a wirelesscarrier. To buy a ringtone, the user will write an ordinary SMS text message thatcontains 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 backone or more reverse billing SMS messages that carry the ringtone. The user willbe charged a fee for the reverse billing SMS messages he/she received. The fee willbe included in the user’s monthly mobile phone bill or be deducted from his/herprepaid card credits. Depending on the agreement between you and the wirelesscarrier, 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 istime consuming since we need time for preparing notices. Also there is wastage ofpaper. 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

Page 13: 2

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

Transmission techniques:

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

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

BLUETOOTH:Bluetooth is an open wireless protocol for exchanging data over short distances fromfixed and mobile devices, creating personal area networks (PANs). It was originallyconceived as a wireless alternative to RS232 data cables. It can connect severaldevices, 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 onelectronic notice board by sending messages in form of SMS through mobile; it is awireless transmission system which has very less errors and maintenance.

Message will be transmitted by user at transmitting section. This message willbe received by mobiles modem at the receiving section. PC connected to it viaBluetooth extracts the received message from its mobiles sim (subscriber identitymodule).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 checkingthe password, user is authenticated and the remaining text messages will then besent to microcontroller via serial port and then to display. A 16x2 Character LCDdisplay is attached to microcontroller for display. The microcontroller is interfacedwith serial port via MAX232 level convertor. Microcontroller coding will be done

4

Page 14: 2

using Embedded C and Kiel. Multiple Users are authorized to update notices onthe electronic notice board by providing them a password. Although the system isautomated, 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 basicallydivided 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 ownaccess password to send message to the receiving section. Authorised users sendthis password in a message. In the same message, after a single space, they have totype the text that they want to display on the notice board to the receiving sectionsmobile number and the message will be displayed only if the users have send thecorrect password. An acknowledgement message is also sent to the users if theirpassword 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 usedto 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 tomicrocontroller via PCs serial port and MAX232 driver IC. Microcontroller finallydisplays it on LCD display.

5

Page 15: 2

As previously mentioned, although the system is automated, still a PC with anadministrator 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 isdone using VB. Also, the password for individual users which can be changed onlyby the administrator is changed by typing the new password in the password settinguser 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 aGSM mobile phone. LCD IC HD44780 is used for LCD display. In the prototypemodel, LCD display is used for simulation purpose. While implementation this canbe replaced by actual display boards.

6

Page 16: 2

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

Figure 1.3: User Interface Window for password setting at PC

7

Page 17: 2

Chapter 2

Transmitting Section

2.1 GSM

Transmitting Section consists of just mobile which has inbuilt GSM modem forwireless data transfer through GSM. GSM (Global System for Mobile communica-tions: originally from Group Special Mobile) is the most popular standard for mobilephones 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 morethan 212 countries and territories. Its ubiquity makes international roaming verycommon between mobile phone operators, enabling subscribers to use their phonesin 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 GSMnetworkmacro, micro, pico, femto and umbrella cells. The coverage area of each cellvaries according to the implementation environment. Macro cells can be regardedas cells where the base station antenna is installed on a mast or a building aboveaverage roof top level. Micro cells are cells whose antenna height is under averageroof top level; they are typically used in urban areas. Picocells are small cells whosecoverage diameter is a few dozen meters; they are mainly used indoors. Femtocells

8

Page 18: 2

are cells designed for use in residential or small business environments and connectto the service providers network via a broadband internet connection. Umbrellacells are used to cover shadowed regions of smaller cells and fill in gaps in coveragebetween 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 extendedcell, where the cell radius could be double or even more, depending on the antennasystem, 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 antennasfed through power splitters, to deliver the radio signals from an antenna outdoorsto the separate indoor distributed antenna system. These are typically deployedwhen a lot of call capacity is needed indoors, for example in shopping centers orairports. However, this is not a prerequisite, since indoor coverage is also providedby in-building penetration of the radio signals from nearby cell.

The modulation used in GSM is Gaussian minimum-shift keying (GMSK), a kind ofcontinuous-phase frequency shift keying. In GMSK, the signal to be modulated ontothe carrier is first smoothed with a Gaussian low-pass filter prior to being fed to afrequency 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 intoGSM frequency ranges for 2G and UMTS frequency bands for 3G). Most 2G GSMnetworks 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 bandsbecause the 900 and 1800 MHz frequency bands were already allocated. Most 3GGSM 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

Page 19: 2

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 knownas a SIM card. The SIM is a detachable smart card containing the user’s subscriptioninformation and phone book. This allows the user to retain his or her informationafter switching handsets. Alternatively, the user can also change operators whileretaining the handset simply by changing the SIM. Some operators will block thisby allowing the phone to use only a single SIM, or only a SIM issued by them; thispractice 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 inorder to provide all of the services which are required. It is divided into a numberof 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 toa fixed network). This is sometimes also just called the core network.3. The GPRS Core Network (the optional part which allows packet based Internetconnections).

10

Page 20: 2

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 toauthenticate the subscriber using a pre-shared key and challenge-response. Com-munications between the subscriber and the base station can be encrypted. Thedevelopment of UMTS introduces an optional USIM, that uses a longer authenti-cation key to give greater security, as well as mutually authenticating the networkand the user - whereas GSM only authenticates the user to the network (and notvice versa). The security model therefore offers confidentiality and authentication,but limited authorization capabilities, and no non-repudiation. GSM uses severalcryptographic algorithms for security. The A5/1 and A5/2 stream ciphers are usedfor ensuring over-the-air voice privacy. A5/1 was developed first and is a strongeralgorithm used within Europe and the United States; A5/2 is weaker and used inother countries.

11

Page 21: 2

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 usingAT89C52 microcontroller IC. Pin Description is shown below:

Figure 3.1: IC Pin Description

12

Page 22: 2

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

The AT89C52 provides the following standard features:

1. 8 Kbytes of In-System Reprogrammable Flash Memory2. Endurance: 1,000 Write/Erase Cycles3. Fully Static Operation: 0 Hz to 24 MHz4. Three-Level Program Memory Lock5. 256 x 8-Bit Internal RAM6. 32 Programmable I/O Lines7. Three 16-Bit Timer/Counters8. Eight Interrupt Sources9. Programmable Serial Channel

The on-chip Flash allows the program memory to be reprogrammed in-system orby a conventional non-volatile memory programmer which provides a highly-flexibleand cost-effective solution to many embedded control applications.

In addition, the AT89C52 is designed with static logic for operation down to zerofrequency and supports two software selectable power saving modes. The Idle Modestops the CPU while allowing the RAM, timer/counters, serial port, and interruptsystem to continue functioning. The Power-down mode saves the RAM contentsbut freezes the oscillator, disabling all other chip functions until the next hardwarereset.

3.1.2 GSM Mobile

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

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

13

Page 23: 2

using the GSM 900/1800 MHz cellular networks.It has internal antenna and dualstandby 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 handsetis 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 ATcommands 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 adial-up modem. In addition to the standard AT commands, GSM modems supportan extended set of AT commands. These extended AT commands are defined inthe 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

Page 24: 2

3.1.3 Display unit

A liquid crystal display (LCD) is a thin, at display device made up of any number ofcolor or monochrome pixels arrayed in front of a light sourceor refector. Each pixelconsists of a column of liquid crystal molecules suspended between two transparentelectrodes, and two polarizing filters, the axes of polarity of which are perpendicularto each other. The liquid crystal twists the polarization of light entering one filterto 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 aHitachi HD44780 compatible module To program the LCD module, first we have toinitialize the LCD by sending some control words. RS should be low and E shouldbe high when we send control. R/W pin 0 mean write data or control to LCD andR/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 tosupply 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 of1.3 V and a typical hysteresis of 0.5 V, and can accept 30-V inputs. Each driverconverts TTL/CMOS input levels into EIA-232 levels.The MAX220 MAX249 familyof 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

Page 25: 2

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

The MAX232 is an integrated circuit that converts signals from an RS-232 serial portto signals suitable for use in TTL compatible digital logic circuits. The MAX232 isa 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 energyfrom one circuit to another, either at the same voltage or at different voltage but atthe same frequency.

16

Page 26: 2

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

3. Filter:The Filter is used to remove the pulsated AC. A filter circuit uses capacitor andinductor. The function of the capacitor is to block the DC voltage and bypass theAC voltage. The function of the inductor is to block the AC voltage and bypass theDC 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 ormaintains 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 signalsconnecting 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 wireswill 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

Page 27: 2

modems have female connectors with DCE pin functions. Other devices may haveany 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 femaleDB9 connector is used. Both are of same pin out. Connection be- tween them isshown 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- ingsection, 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 devicesto talk to each other over short distances (up to 100 metres). Blue- tooth uses radiowaves (in the 2.4 Gigahertz range), and is designed to be a secure and inexpensiveway of connecting and exchanging information between devices without wires. Uses

18

Page 28: 2

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

To connect PC to Bluetooth, Go to Control Panel under the Start Menu and lookfor Bluetooth devices as pictured in the screenshot in the

gure below. The window below should open. Click Add Wireless Device as seen inthe screenshot. Before scanning for devices turn on Bluetooth on your cell phone.Theexact location of the Bluetooth setting will differ depending on the model of thephone 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 itdoesnt, make sure Bluetooth is turned on and ensure that your status is set to Visibleor Detectable. Your phone must also be within 7 meters of your PC to ensure aconnection 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

Page 29: 2

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

3.3.1 Serial Port Communication

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

In telecommunications, RS-232 (Recommended Standard 232) is the tra- ditionalname for a series of standards for serial binary single-ended data and control signalsconnecting 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

Page 30: 2

chronous transmissions are supported by the standard. In addition to the datacircuits, 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 EmbeddedC as softwares and RS232 cable as hardware interface.

21

Page 31: 2

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 rsttime, 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 PCBfor designing circuit boards.

Figure 4.1: Express SCH

22

Page 32: 2

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

Next, we have to use the ExpressPCB program to lay out your PC board. If welink our schematic to ExpressPCB using Link schematic to PCB command foundunder the File menu , it will guide us through the wiring process.When our layoutis complete, we can even determine the exact cost to have boards made with theCompute Board Cost command.To order the boards, enter your name, address andbilling information into ExpressPCB and press the Send button within the OrderBoards Via The Internet dialog box. ExpressPCB is a very easy to use Windowsapplication for laying out printed circuit boards. It is also available on internet forfree.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, medicalequipment, aerospace systems and defense systems is widespread, and even everydaydomestic appliances such as dish washers, televisions, washing machines and videorecorders 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

Page 33: 2

area. Because most embedded projects have severe cost constraints, they tend touse 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 itis easier and less time consuming to write in C than Assembly, C is easier to modifyand update, We can use code available in function libraries, and C code is portableto other microcontroller with little of no modification.

Compilers produce hex files that is downloaded to ROM of microcontroller. Thesize 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.HexadecimalFF is 255 in binary.This a very simple program in which datatype unsigned char isused as a datatype.

Figure 4.3: Program1

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

Figure 4.4: Program2

24

Page 34: 2

PROGRAM 3:Third program deals with Input/Output Programming. In this program, The datapins of an LCD are connected to P1. The information is latched into the LCDwhenever its Enable pin goes from high to low. Write an 8051 C program to sendThe 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 toolsprovided by many of the silicon vendors. Keil implemented the first C compilerdesigned from the ground-up specifically for the 8051 microcontroller.Sreenshot ofstarting 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

Page 35: 2

of software developer from the professional applications engineer to the student justlearning 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 TargetOutput, 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 Basicwas derived from BASIC and enables the rapid appli- cation development (RAD)of graphical user interface (GUI) applications and creation of ActiveX controls andobjects.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 toplace controls (eg. text boxes, buttons etc) on the form win- dow.Then, individualprogramming for individual windows is done. Steps in Building a VB Applicationincludes:

Step 1: Draw the interface,

26

Page 36: 2

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 / 7v = pi * (r*r) X hvolume: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

Page 37: 2

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

This is all about Softwares used in this project.

28

Page 38: 2

Chapter 5

Interfacing

5.1 Microcontroller-LCD Interfacing:

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

Fortunately, a very popular standard exists which allows us to communicate withthe 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 froman 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 forthe data bus. The user may select whether the LCD is to operate with a 4-bit databus or an 8-bit data bus. If a 4-bit data bus is used the LCD will require a total of7 data lines (3 control lines plus the 4 lines for the data bus). If an 8-bit data busis used the LCD will require a total of 11 data lines (3 control lines plus the 8 linesfor the data bus). The three control lines are referred to as EN, RS, and RW.

29

Page 39: 2

The EN line is called ”Enable.” This control line is used to tell the LCD thatyou are sending it data. To send data to the LCD, your program should make surethis line is low (0) and then set the other two control lines and/or put data on thedata bus. When the other lines are com- pletely ready, bring EN high (1) and waitfor the minimum amount of time required by the LCD datasheet (this varies fromLCD to LCD), and end by bringing it low (0) again.The RS line is the ”RegisterSelect” line. When RS is low (0), the data is to be treated as a command or specialinstruction (such as clear screen, position cursor, etc.). When RS is high (1), thedata 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 wehave chosen to connect second pin of port 3(P3.2) to register select pin (RS), thirdpin 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 aline on the 44780 LCD. Thus as we write our assembly C pro- gram to access theLCD, we are going to equate constants to the 8051 ports so that we can refer tothe lines by their 44780 name as opposed to P1.0, P1.1 etc. The sbit data type isused to access to the single bits of special function registers, and thus utilized forour purpose. Thus in embedded C:

30

Page 40: 2

As we can see, we’ve established a 1-to-1 relation between a pin on the 8051 anda line on the 44780 LCD. Thus as we write our assembly C program to access theLCD, we are going to equate constants to the 8051 ports so that we can refer tothe lines by their 44780 name as opposed to P1.0, P1.1 etc. The sbit data type isused to access to the single bits of special function registers, and thus utilized forour 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. Delay2. LCD Initialization3. Sending data to LCD4. 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. Wecan 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 golow. So in a real applications it would be wise to put some kind of time limit on thedelay. This would guarantee that even if the LCD hardware fails, the program wouldnot 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 isaccomplished by sending a number of initialization instructions to the LCD. The

31

Page 41: 2

first instruction we send must tell the LCD whether we’ll be communicating withit with an 8-bit or 4-bit data bus. We also select a 5x8 dot character font. Thesetwo 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 lowif we are sending a command to the LCD. Thus, to send this 38h command to theLCD we must execute the following 8051 instructions in embedded C:

void command(unsigned char var){lcddata = var;rs = 0; //Selected command registerrw = 0; //We are writing in instruction registeren = 1; //Enable High to Lowen = 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 othercommands 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 asthe 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

Page 42: 2

lcddata = word; //Function set: 2 Line, 8-bit, 5x7 dotsrs = 1; //Selected data registerrw = 0; //We are writingen = 1; //Enable High to Lowen = 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 byone and display it on LCD screen one by one. This is it, with LCD Interfacing. Thissection described hardware as well as software concepts related to LCD interfacingwith 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 thecircuit. In PC, at RS-232 voltage levels, logic 1 varies from -3 to -15 volts and logic0 from +3 to +15 volts. The microcontroller which works on TTL logic levels, logic1 is +5 volts and logic 0 is 0 volts. Therefore to interface the two we use a MAX232 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 mustbe boosted and inverted through a suitable converter(MAX232) to comply withRS232 standard.

All modes are controlled through SCON, the Serial CONtrol register. The SCONbits 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

Page 43: 2

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 showsinternal circuit of MAX232.

Figure 5.3: MAX 232 Internal Circuit

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

34

Page 44: 2

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 ratewhich is the speed at which data is transmitted serially. AT89C51 mi- crocontrollercan be set to transfer and receive serial data at different baud rates using softwareinstructions.

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. Toget baud rates com- patible with the PC, TH1 should be loaded with the hexadeci-mal values corresponding to particular baud rates. Figure below shows hexadecimalcodes 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 usedwhile 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 toaccess serial communication functions. Windows hides much of the complexity ofserial communications and automatically puts any received characters in a receivebuffer and characters sent into a transmission buffer. The receive buffer can beread by the program whenever it has time and the transmit buffer is emptied whenit is free to send characters. The Comm component is added to a form wheneverserial communications are required. By default, the first created object is namedMSComm1 (the second is named MSComm2, and so on).

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

35

Page 45: 2

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 viaBluetooth. Mobiles GSM Modem is used to receive message from the authorizeduser. 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 inprecisely 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 withoutUSB cables).

We will need two things for this to work:1. A Bluetooth-enabled computer. Most laptops now have Bluetooth and so dosome desktops. If yours doesnt, you can buy a USB Bluetooth adapter cheaply on

36

Page 46: 2

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 canbe used by user for doing normal tasks as well. That means the phone needs not tobe dedicated for this specific purpose of sending received message to PC. Anotherrequirement for the cell phone is that it should store the incoming message directlyinto 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 commandsare instructions used to control a modem. AT is the abbreviation of ATtention.Every command line starts with ”AT” or ”at”. That’s why modem commandsare called AT commands. Common AT command set, GSM/GPRS modems andmobile 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. Thismodem requires a SIM card from a wireless carrier in order to operate. This SIMnumber is contact number of the receiving section.

PCs use AT commands to control modems. Although GSM modem is interfacedwith PC through Bluetooth using a VB program, a GSM modem can be testedbefore actually implementing into the system. The MS HyperTerminal is a handytool 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 GSMmodem.Finally in the hyper terminal main window, AT commands are sent andresponds received from GSM modem can be seen. Screenshot of dialog box showingsending and receiving of AT commands is shown in figure below (Here mobile phoneconnection is the connection name)

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

37

Page 47: 2

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

38

Page 48: 2

5.4 Overall Functional Flowcahrt

39

Page 49: 2

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

Page 50: 2

6.2 PCB Layout-Main PCB

Figure 6.2: PCB Layout of Main PCB

41

Page 51: 2

6.3 PCB Layout-Side PCB having MAX232

Figure 6.3: PCB Layout of Side PCB having MAX232

42

Page 52: 2

Chapter 7

Conclusion

7.1 Conclusion

By introducing the concept of wireless technology in the field of communication wecan make our communication more efficient and faster, with greater efficiency wecan display the messages and with less errors and maintenance. This model can beused very efficiently in establishments like chain restaurants wherein the order andspecial discounts can be displayed at all branches simultaneously, in colleges whereinstudents and staffs can be informed simultaneously in no time. It can be set up atpublic transport places like railways, bus station, and airport and also at roadsidefor traffic control and in emergency situations, it is cost efficient system and veryeasy to handle, a single person can handle all the work with just a message. PCwith 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 byusing wireless notice boards to display information in real time.

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

43

Page 53: 2

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 regardingthe products and related offers on electronic display boards.

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

7.3 Merits:

1. User friendly: Messages are only to be typed on a mobile or a computer, whichin 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 ofinformation. Messages are displayed in a matter of seconds after typing.

4. Long Range: As long as we have the required network coverage we can sendmessages 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 poweris ON.

7.5 Future enhancements:

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

44

Page 54: 2

display characters in a moving fashion one after the other.

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

3. Robots can be controlled in a similar fashion by sending the commands to therobots. These commands are read by using AT commands and appropriate action istaken. This can be used for spy robots at distant locations, utilized by the militaryto 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 offthese appliances remotely.

5. Temperature display during periods wherein no message buffers are empty isone 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 tothe maximum number of end users. This feature can be added by programming themicrocontroller to use different encoding decoding schemes in different areas as perthe 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 targetable output. MMS technology along with relatively high end microcontrollers tocarry on the tasks of graphics encoding and decoding along with a more expansivebank of usable memory can make this task a walk in the park.

45

Page 55: 2

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 Doby FUJITSU MICROELECTRONICS AMERICA, INC.

[3] DESIGN AND DEVELOPMENT OF AN RS232-BASED ROV CONTROLLERSYSTEM 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 8051Microcontroller 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

Page 56: 2

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

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

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

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

[6]http : //pdfserv.maxim− ic.com/en/an/AN83.pdf

47

Page 57: 2

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

Page 58: 2

Appendix 1: Coding For Microcontroller(Embedded C)

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

# include <reg52.h>unsigned char m=0,y=0,Lcd Word;sfr lcddata=0x90; //p1 portsbit 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 LCDrw=0;delay(5);en=0;}

void lcddisplaydata(unsigned char word){lcddata=word;en=1; //Data writing of the Lcdrs=1;

49

Page 59: 2

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 registernext:RI=0;}/——————————————Main Program—————————————-/void main(){TMOD=0X20;SCON=0X50;TH1=0XFD; //9600 baud ratecommand(0X38);delay(5);command(0x0F);delay(5);

50

Page 60: 2

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

51

Page 61: 2

Appendix 2: Coding For Visual Basic(Main Window)

Option ExplicitDim variable1 As StringDim variable2 As StringDim variable3 As StringDim variable4 As StringDim done message, l, z, variables As IntegerDim str As StringDim Data

Private Sub Command1 Click()On Error Resume NextOpen App.Path & (” Data.txt”) For Input As # 1 Input # 1, variable1, variable2,variable3 Form2.Text1.Text = variable1Form2.Text2.Text = variable2Form2.Text3.Text = variable3Close # 1 Unload MeForm2.ShowEnd Sub

Private Sub Command2 Click()MSComm1.Output = ”AT+CMGF=1” & vbCrLfSleep (2000)MSComm1.Output = ”AT+CMGS=” & Chr(34) & Text2.Text & Chr(34) & vbCrLfSleep (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 = 1End Sub

Private Sub Command5 Click()Dim str As StringOn Error Resume Next

52

Page 62: 2

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

’ Disable DTRMSComm1.DTREnable = False

’open the portMSComm1.PortOpen = True———————————–Circuit displaying Part—————————————— MSComm2.CommPort= 1MSComm2.RThreshold = 1MSComm2.InputLen = 1MSComm2.InBufferSize = 258’ 9600 baud, no parity, 8 data bits, 1 stop bitMSComm2.Settings = ”9600,N,8,1”

’ Disable DTRMSComm2.DTREnable = False

’open the portMSComm2.PortOpen = True

Open App.Path & (” Data.txt”) For Input As # Input #, variable1, variable2,variable3Form2.Text1.Text = variable1Form2.Text2.Text = variable2Form2.Text3.Text = variable3Close #

Command1.Enabled = FalseCommand6.Enabled = TrueCommand6.Visible = TrueCommand5.Enabled = False

53

Page 63: 2

Command5.Visible = FalseCommand2.Enabled = TrueEnd Sub

Private Sub Command6Click()Command1.Enabled = TrueCommand5.Enabled = TrueCommand5.Visible = TrueCommand6.Enabled = FalseCommand6.Visible = FalseCommand2.Enabled = FalseEnd Sub

Private Sub Form Load()done message = 2End Sub

Private Sub MSComm1 OnComm()Dim message As StringDim variable12 As StringOn Error Resume Next’MSComm1.PortOpen = FalseMSComm1.CommPort = Text4.TextMSComm1.RThreshold = 1MSComm1.InputLen = 25’MSComm1.InBufferSize = 258’ 9600 baud, no parity, 8 data bits, 1 stop bitMSComm1.Settings = ”9600,N,8,1”’ Disable DTRMSComm1.DTREnable = False’open the portMSComm1.PortOpen = True

If MSComm1.CommEvent = comEvReceive Then

If (done message = 1) ThenDo

54

Page 64: 2

Data = Data & MSComm1.InputLoop Until InStr(Data, ”OK”)done message = 3message = DataData = ””

variable12 = InStr(message, ”+91”)Text6.Text = Mid$ (message, variable12, 13)

variable12 = InStr(message, ” ”) ’ THE PASSWORD STREAMText1.Text = Mid$ (message, variable12 + 2, 4)

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

ElseIf done message = 2 Then

DoData = Data & MSComm1.InputLoop Until InStr(Data, Text5.Text)

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

End If

End Sub

Sub Teb()

55

Page 65: 2

On Error Resume NextMSComm1.CommPort = Text4.TextMSComm1.RThreshold = 1MSComm1.InputLen = 231MSComm1.InBufferSize = 258’ 9600 baud, no parity, 8 data bits, 1 stop bitMSComm1.Settings = ”9600,N,8,1”

’ Disable DTRMSComm1.DTREnable = False

’open the portMSComm1.PortOpen = True

str = Text1.Text

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

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

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

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

56

Page 66: 2

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 & vbCrLfSleep (1000)Timer1.Enabled = True

End Sub

Private Sub Timer1 Timer()If (l = 4) Thendonemessage = 2l = 0Text1.Text = ””Text6.Text = ””Text3.Text = ””Data = ””Timer1.Enabled = FalseExit SubEnd Ifl = l + 1End Sub

57

Page 67: 2

Appendix 3: Coding For Visual Basic(Password Setting)

Private Sub Command1 Click()Open App.Path & (”.txt”) For Output As # 1Write # 1, Text1.Text, Text2.Text, Text3.TextClose# 1Unload MeForm1.ShowEnd Sub

58

Page 68: 2

Appendix 4: Datasheet of AT89C52 Microcontroller

59

Page 69: 2

Appendix 5: Datasheet of LCD IC Hitachi HD44780

60

Page 70: 2

Appendix 6: Datasheet of MAX-232 Level Converter

61