Forums Wireless Communication GSM Modem how to interface GSM(SIM900A) with 8051

how to interface GSM(SIM900A) with 8051

Link to this post 12 Dec 12

hi, i have SIM900A GSM Modem and 8051 board but i need procedure for interfacing GSM modem with 8051. help me

Link to this post 19 Nov 13

1. First select the text mode for SMS by
sending the following AT Command to GSM
Modem : AT+CMGF = 1 . This command
configures the GSM modem in text mode.
2. Send the following AT Command for
sending SMS message in text mode along
with mobile number to the GSM Modem :
AT+CMGS =+923005281046 . This command
sends the mobile number of the recipient
mobile to the GSM modem.
3. Send the text message string (“hello!”) to the GSM Modem This is a testmessage from UART”
4. Send ASCII code for CTRL+Z i.e., 0x1A to GSM Modem to transmit the message to mobile phone.After message
string has been sent to the modem, send CTRL+Z to the micro-controller,which is equivalent to 0x1A (ASCII value)

Link to this post 19 Nov 13


Thanks for the information , could you please tell about hardware setup and initialize procedure ?.

Many Thanks,

Link to this post 23 Jan 14

I am beginner in PIC16F877..i wanna interface my pic with GSM to control home appliances like light, motor etc..i know UART programming..but don't know anything about GSM..kindly help me..

Link to this post 23 Jan 14

Dear Manikandan,

All you need to know is the AT Commands,

Home automation can be done by decoding a call(ring) or by decoding a SMS.

You can follow the steps below,

1. Write your own getstring and putstring function for uart without using interrupt. The getstring function should not send the character back.
2. Write a routine for uart receive using interrupt as well but dont turn on the interrupt.
2. Send the following commands to gsm modem using putstring function and wait for "OK" after each command via the getstring function and the string.h library routine "strstr". Do get some knowledge about "strstr".

const unsigned char GSM_Comnd_Echo[]	= "ATE0\r";
const unsigned char GSM_Comnd_ASCII[] = "AT+CMGF = 1\r";
const unsigned char GSM_Comnd_CNMI[] = "AT+CNMI=2,2,0,0,0\r";
const unsigned char GSM_Comnd_Dele[] = "AT+CMGD=1,4\r";
const unsigned char GSM_Comnd_Save[] = "AT&W\r";

3. Assume SMS to control a device should be *1,*2 to turn on and off respectively.
4. Turn ON uart interrupt and turn ON global interrupt as well.
5. Look for a "*" key on uart interrupt routine, if its received, turn off uart interrupt and look for the next character using the uart receive routine without interrupt. It should be '1' or '2'. If its '1' turn on the device by rising the port pin.If its '2' then turn off the device by sending low on a port pin.
6. We can control more devices by sending sms "*3", "*4"....etc.

Link to this post 09 Feb 15

i want to track the location of a vehicle using gps and send the latitude longitude as sms to my mobile. and i need to use 8051 microcontroller. can you help me with the source code please