Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sending sms through gsm900 using 8051

Status
Not open for further replies.

Veeramani.T

New Member
hi ,
i am using 8051 for sending sms through gsm900.
i got the AT commands correctly in hyper terminal.
the problem is ......
manually i send the AT commands from hyperterminal to gsm900, the module is sending the sms to my mobile correctly.
but, gsm module is connected to MC , i could not get the sms.
and my hardware connections are correct- MC - Max232- Gsm900 ( checked it)

i dont know what is happening?
my code is ...

#include<reg51.h>

void serial_int()
{
TMOD=0x20;
TH1=0xfd;
SCON=0x50;
TR1=1;
}

void delay (unsigned int x)
{
unsigned int i,j;
for(i=0;i<x;i++)
{
for(j=0;j<1275;j++);
}
}

void serial (unsigned char s)
{
SBUF=s;
while (TI==0);
TI=0;
}

void send (char *z)
{
unsigned int k;
for(k=0;z[k]!=0;k++)
{
serial (z[k]);
}
}

void main()
{
serial_int();
send ("AT\r\n");
delay(200);
send ("AT+CMGF=1\r\n");
delay(200);
send ("AT+CMGS=\"+91xxxxxxxx;\"\r\n");
delay(200);
send ("This is my message");
serial (0x1a);
while (1);
}


pls help me !!!!....
 
Last edited:
I bet one hundred million dollars that this is a baudrate mismatch..
 
You could connect the PC and hyperterm in place of the modem to verify what's being sent. This would verify the baud rate and the MAX232 circuit.

Also, there may be issues with <CRLF> (carriage return / line feed) message terminators.
 
thanks for ur comments bros...
i sent the AT commands from MC to hyperterm, I got the AT commands correctly.
if baud rate is mismatched means how can i get the AT commands in hyperterm ....
sorry sir i could not understand, how to modify my code and match baudrate ....
pls help ..
modify my posted code in #1 for getting sms from gsm module.
i trying this for long time ....

help help ......
 
Maybe you need to send "\r\n" after send ("This is my message");
 
What chipset in your GSM900, a SIM900?
Some require you send characters such as CTRL+Z, or double "\r\n" to show the message is terminated.

Read the AT command guide for your module it should give a clear example.
 
My gsm module is
GSM900A-R3
i am trying, but i could not get the output...
i am using four 0.1uf for max232, is it OK...
but i am getting the output in hyperterm.....
any one send me the working code for me....
 
hmm,
Not familiar with the GSM900A, can you post a link or pic of it? I am suspecting a SIM900.

MAX232 some i've had to use 1uF, think its voltage dependant, also you need to make sure the chip is wired correctly, do you have a schematic?
 
thanks to jonsea, mister and wilksey for supporting me.
i got the output after some corrections in my ckt and program as you suggested.
thanks a lot...
 
hi veeramani sir, i too have an error on interface GSM sim 900 module, sms was not sending..what is the problem,
 
hi veeramani sir, i too have an error on interface GSM sim 900 module, sms was not sending..what is the problem,
veeramani hasn't been seen here since.... I doubt you'll get a reply.... That's the problem when resurrecting older threads ....
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top