Know the Procedure of GSM Modem Interfacing With 8051

7
Know the Procedure of GSM Modem Interfacing with 8051 The acronym of the GSM modem is Global System for Mobile Communications, it is a wireless communication module, used to make a computer or any processor to communicate over a network. This modem uses a variation of TDMA(Time Division Multiple Access) and is the most commonly used of the digital wireless telephony technologies like TDMA, GSM and CDMA.A GSM modem needs a SIM card to operate through a n/w range subscribed by the network operator. This modem can be connected to a computer via a serial, Bluetooth or USB connection. A GSM modem is also a standard GSM mobile phone with a suitable cable and software driver to connect to a USB port on your PC. Generally, this modem is preferred instead of a GSM mobile phone. This article describes how GSM modem interfacing with 8051 microcontroller.

description

procedure of how to interface gsm with microcontroller

Transcript of Know the Procedure of GSM Modem Interfacing With 8051

Page 1: Know the Procedure of GSM Modem Interfacing With 8051

Know the Procedure of GSM Modem Interfacing with 8051

The acronym of the GSM modem is Global System for Mobile Communications, it is

a wireless communication module, used to  make a computer or any processor to

communicate over a network. This modem uses a variation of TDMA(Time Division

Multiple Access) and is the most commonly used of the digital wireless telephony

technologies like TDMA, GSM and CDMA.A GSM modem needs a SIM card to operate

through a n/w range subscribed by the network operator. This modem can be

connected to a computer via a serial, Bluetooth or USB connection. A GSM modem is

also a standard GSM mobile phone with a suitable cable and software driver to connect

to a USB port on your PC. Generally, this modem is preferred instead of a GSM mobile

phone. This article describes how GSM modem interfacing with 8051 microcontroller.

Page 2: Know the Procedure of GSM Modem Interfacing With 8051

GSM Modem Interfacing with 8051 Microcontroller

Nowadays, many projects like  car security system, home automation, remote

controlled industrial machines are controlled by an SMS using GSM modem. This

modem uses a SIM card and operates through a subscription with the mobile operator.

Many people they don’t know how GSM moduleinterfacing with 8051 microcontroller.

Therefore, the following steps explain the basics of how GSM modem interfacing with

8051 microcontroller.

Steps to Interfacing a GSM Modem to the Microcontroller

Step1: Arranging the GSM Modem

The GSM modem is a one type of modem, which uses the SIM card for communication.

First, insert a SIM card into the modem which uses the same number/ account as the

caller phone. It supports AT commands for handling the messages. These commands

are programmed into the microcontroller ensures ending or receiving of the SMS from

the modem.

For instance: Initializing commands for several types of modem are shown below

Siemens: AT+CNMI=1,1,0,2,1

WaveCom: AT+CNMI=2,1,0,1,1

SonyEricsson: AT+CNMI=3,1,0,1,0

Motorola USB modem: AT+CNMI=3, 1,0,0,0

The modem is arranged to send notifications to the microcontroller upon receiving a new

text.

Arrange the modem port speed as a rule such as 9600 or 19200 bps baud rates.

Step2: GSM Modem Testing

The GSM modem comprises of two light emitting diodes like green and red LEDs, which

are used for the network connection indication. If there is no network is available, then

the red LED glows, and if a network is available, then the green LED glows so that one

can observe the working of GSM modem. Connect a power supply to a GSM modem

which contains a SIM card and wait till it registers in the GSM network. For the testing of

Page 3: Know the Procedure of GSM Modem Interfacing With 8051

the modem, you can send an SMS to the modem. If it receives the message from the

mobile, it is working properly, or else it is damaged.

Step3: GSM Modem Interfacing with 8051 Microcontroller

GSM modem works with 12V DC and the microcontroller works with 5V. So, interfacing

of this modem with microcontroller directly is not possible due to mismatch of voltage

levels. GSM modem is interfaced with 8051 microcontroller through MAX232 with the

help of RS232 cable for serial communication. MAX232 device is used to convert TTL

logic level to RS232 level during serial communication of microcontroller to the GSM

modem. The RS232 device is an interface between data terminal equipment and data

communication equipment using serial binary data exchange. The RS232 cable is

commonly available with the 9 or 25 pin wiring and has jumpers to provide handshaking

pins for those devices that require it.

GSM Modem Interfacing with 8051 Microcontroller

Step4: Microcontroller Programming

Transmitting single character

Transmitting word

Receiving char

#include<reg51.h>

voidinit_RS 232();

voidTx_Char(unsigned char ch);

voidTx_String(unsigned char *str);

Page 4: Know the Procedure of GSM Modem Interfacing With 8051

voidRx_Char();

voidinit_RS 232()

{

TMOD|=0×20;    //Timer 1 in mode 2 ( Auto Reload mode)

TH1=0XFD;        //0xFD for 9600bps

SCON=0×50;        //Enable TI and RI pins using Serial control Register

TR1=1;        //Start Timer 1;

}

voidTx_Char(unsigned char ch)

{

SBUF=ch;        // Load the character into SBUF register to transmit.

while(!TI);        //wait for TI flag to raise high

TI=0;            //clear TI for further transmission.

}

voidTx_String(unsigned char *str)

{

while(*str)

Tx_Char(str++);

}

voidRx_Char()

{

while(RI==1);    //wait for RI flag to receive any character

Ch=SBUF;        // capture the character from SBUF into Ch variable

RI=0;            //clear RI flag for further reception

}

In addition to the above program,if an operator wants to make an SMS to any other

persons mobile via  microcontroller upon interrupt either from internal or external device,

the operator can follow the below program.

Page 5: Know the Procedure of GSM Modem Interfacing With 8051

Serial Interrupt Programming

Serial Interrupt Programming

Hardware Interrupt Program

Step5: Circuit Connections

This circuit gets power supply when the power supply is given to the 40th pin of the

microcontroller. The GSM modem is interfaced to the 10&11 pins of the microcontroller

using the MAX232 device for transmitting and receiving of the information serially. The

LCD display is connected to the  port0 of the microcontroller for displaying the

information. A crystal oscillator is connected to the 18th and 19th pins of the

microcontroller to generate clock pulses.The RESET button is connected to the 9th pin

of the microcontroller for rebooting the controller when it is not working correctly.

Page 6: Know the Procedure of GSM Modem Interfacing With 8051

Circuit Diagram of GSM Module with the Microcontroller

The Working Procedure of a GSM Modem

When the GSM modem is connected to the microcontroller, then it communicates with a

mobile via a UART protocol and requires three basic signals such as TXD, RXD and

GND.The GSm modem is connected to the microcontroller, it controls the industrial

appliances through an SMS. As each load is assigned with a unique identifier number

like load1 is assigned with 1111, load2 is 0000 is the program in the microcontroller.

This modem always monitors the signals from the i/p. When the modem receives the

SMS from an operational phone, serially that data is sent to the microcontroller. This

microcontroller compares this data with the stored data. If the compared data match

with the stored data, then the microcontroller generates corresponding signals to control

the load.

Applications of GSM Modem

The applications of GSM modem mainly involve supply chain management, weather

stations, security applications and GPRS mode remote data logging and GSM based

projects