EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / To interface GSM SIM900 with 8051

To interface GSM SIM900 with 8051

|

Microcontroller › 8051 › To interface GSM SIM900 with 8051

  • This topic has 13 replies, 10 voices, and was last updated 9 years, 3 months ago by umesh mehtre.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • July 22, 2012 at 5:31 pm #1888
    prajwal
    Participant

    hello, Im a newbee to this site. But im really happy for being a member now. i learnt lots of things after coming here. the tutorial section is simply best!!! i saw the GSM interface with 8051 tutorial. but now i want to send and recieve sms using the modem. can anybody help me out??? pls im a beginner in programming n have interest in doing projects but i dint had proper source. pls do respond to my kind request. Thanks in advance….

    July 23, 2012 at 3:43 pm #8308
    Amrith
    Participant

    Hi Prajwal,

    Good !!!

    We are here to help you. Please start the project & post your difficulties.

    July 24, 2012 at 2:57 pm #8324
    Anonymous
    Guest

    Thank u so much for responding to my request. Sir i hav a GSM modem named “WISMO” can this be used for interfacing or should i buy a new one??? pls suggest.. This modem has no changes compared to other. Same AT commands…

     

    July 25, 2012 at 12:42 pm #8328
    Amrith
    Participant

    Hi,

    You can start using the modem you got. AT commands are independent of any GSM modem. 

    All the best & post your doubts & difficulties

    July 26, 2012 at 3:08 pm #8333
    prajwal
    Participant

    Thank u sir. I am starting with the project from tomorrow… I have developed the code for sending the message. If it dont work out il post it… on the other way even if it works out i will post it :-)

    July 27, 2012 at 12:19 pm #8340
    Amrith
    Participant

    Good prajwal..

    Appreciate your effforts. if you find any difficulties post your doubts.

    All the best !!!!

    July 28, 2012 at 6:15 am #8346
    gouday
    Participant

    i am doing project on gsm modem to send sms.i ve connected sim 900 modem through 8051 with max232.i ve the code as follows…………………………which was there in this website only,i ve just editted and added.i ve given the o/p to lcd.i am not getting a correct response……………please help me out……….

     

     

    #include<reg51.h>
    #define port P1
    #define dataport P2 // Data port for LCD
    sbit rs = port^0;
    sbit rw = port^1;
    sbit en = port^2;
    int count,i;
    unsigned char check,str[50];
    bit check_space;
     
    void init_serial() // Initialize serial port
    {
    TMOD=0x20; // Mode2
    TH1=0xfd; // 9600 baud
    SCON=0x50; // Serial mode=1 ,8-Bit data,1 Stop bit ,1 Start bit, Receiving on
    TR1=1; // Start timer
    }
    void delay(unsigned int msec) // Function for delay
    {
    int i,j;
    for(i=0;i<msec;i++)
       for(j=0; j<1275; j++);
    }
     
    void lcd_cmd(unsigned char item) // Function to send command on LCD
    {
    dataport = item;
    rs= 0;
    rw=0;
    en=1;
    delay(1);
    en=0;
    return;
    } 
     
    void lcd_data(unsigned char item) // Function to display character on LCD
    {
    dataport = item;
    rs= 1;
    rw=0;
    en=1;
    delay(1);
    en=0;
    return;
    }
     
    void lcd_data_string(unsigned char *str) // Function to display string on LCD
    {
    int i=0;
    while(str!=’’)
    {
       lcd_data(str);
       i++;
       delay(10);  
        }
    return; 
    }
    void lcd()
    {
    lcd_cmd(0x38);   // For using 8-bit 2 row LCD 
    delay(5);  
    lcd_cmd(0x0F);         // For display on cursor blinking
    delay(5);
    lcd_cmd(0x80);   // Set the cursor on first position of LCD 
    delay(5);  
    }
     
    void transmit_data(unsigned char str) // Function to transmit data through serial port
    {
    SBUF=str;   //Store data in SBUF
    while(TI==0); //Wait till data transmits
    TI=0;
    }
     
     void receive_data()  interrupt 4 // Function to recieve data serialy from RS232 into microcontroller
     {
    RI=0;
    str[++count]=SBUF; //Read SBUF
     
     }
      
    unsigned char byte_check() // Function to check carraige return and new line character
    {
    switch(str[0])
    {
    case 0x0a:
    { // Return 0x00 for new line
    return 0x00;
    break ;
    }
    case 0x0d:
    { // Return 0x01 for carriage return
    return 0x01;
    break ;
    }
    default :return 0x02 ; // Return 0x02 for characters except new line and carriage return
    }
    }
     
    void main()
    { 
    lcd(); // Initialize LCD
    init_serial(); // Initialize serial port
    count=(-1);
    delay(500);
    lcd_data_string(“Ready”);
    delay(10);
    lcd_cmd(0x01);
     
    IE=0x90;
    transmit_data(‘a’);  
    delay(1);
    transmit_data(‘t’);
    delay(1);
    transmit_data(0x0d);   // Transmit carriage return to serial port
    delay(500); 
    transmit_data(‘a’);  
    delay(1);
    transmit_data(‘t’);
    delay(1);
    transmit_data(‘+’);  
    delay(1);
    transmit_data(‘c’);
    delay(1);
    transmit_data(‘m’);  
    delay(1);
    transmit_data(‘g’);  
    delay(1);
    transmit_data(‘f’);  
    delay(1);
    transmit_data(‘=’);
    delay(1);
    transmit_data(‘1’);
    delay(1);
    transmit_data(0x0d);   // Transmit carriage return to serial port
    delay(500);
     
    transmit_data(‘a’);  
    delay(1);
    transmit_data(‘t’);
    delay(1);
    transmit_data(‘+’);  
    delay(1);
    transmit_data(‘c’);
    delay(1);
    transmit_data(‘m’);  
    delay(1);
    transmit_data(‘g’);
    delay(1);
    transmit_data(‘s’);  
    delay(1);
    transmit_data(‘=’);
    delay(1);
    transmit_data(‘ ” ‘); //    added mobile  number here
    delay(1);
    transmit_data( );  
    delay(1);
    transmit_data( );           
    delay(1);
    transmit_data( );  
    delay(1);
    transmit_data( );
    delay(1);
    transmit_data( );  
    delay(1);
    transmit_data( );
    delay(1);
      transmit_data( );  
    delay(1);
    transmit_data( );
    delay(1);
    transmit_data( );  
    delay(1);
    transmit_data( );
    delay(1);
    transmit_data(‘ ” ‘);
    delay(1);
    transmit_data(0x0d);   // Transmit carriage return to serial port
    delay(500);
    transmit_data(‘h’);
    delay(1);
    transmit_data(‘e’);  
    delay(1);
    transmit_data(‘l’);
    delay(1);
    transmit_data(‘l’);
    delay(1);
    transmit_data(0x1a);
    delay(500);
     
     
    while(1)
    {
       lcd_cmd(0x80);
    if(count>=0)
    {
    check=byte_check(); // Check the character
    if(check!=0x00)
    {
    if(check==0x01)
    {
    if(check_space==1) // Check previous character
    {
    lcd_data(0x20);
    check_space=0;
    delay(1000);
    }
    }
    else
    {
    lcd_data(str[0]);
    delay(1000);
    check_space=1;
    }
    }
    count–;   
    for(i=0;i<count;i++)   // Shift the whole array to one left
    {
    str=str[i+1];
    }
    }
    }
    }
     

     

    September 16, 2012 at 4:09 pm #8587
    Omer Fayyaz
    Participant

    hye…. bro there is no need to use max232 because both 8051 and SIM900 have TTL/Cmos level… 

    best of luck

     

    January 14, 2013 at 12:24 pm #8951
    nidhin.k
    Participant

    hai PRAJWAL………………

     

     

     

    for sending and receiving sms you must initialaze ur gsm modem.

     

    initialization commands are (steps)

     

    AT                               /*you will get a reply “OK ” ,if the modem is working*/

    AT+CMGF=1             /* convert to text mode  */

    AT+CNMI=2,2,0,0,0    /*receive msg , after reading it will automatically deleted  */

     

     

    for sending

     

    AT+CMGS=”mobile number”<press enter key>

    <type msg>

    <press control key+Z>

     

     

    for calling….

     

     

    ATD<mobile number>; <press enter key>

     

     

     

     

     

    December 10, 2013 at 11:11 am #10716
    rathang
    Participant

    Can someone say  how to interfacing sim900 to 89v51rd2? kell coading only AT will be display and ok will be showing 

     

     

     

    February 18, 2014 at 8:08 am #11047
    ligeesh
    Participant

    sir,

    my project is gsm based electronics notice board.here we are using gsm modem sim 900a model.i want the program for this project.pls help me.

    March 8, 2016 at 5:25 pm #13765
    monica
    Participant

    Hii!!! Can anyone post the code for sending data through gsm (sim 900) with 8051 microcontroller and lcd using AT commands ?? plz..

    March 15, 2016 at 3:26 pm #13786
    umesh mehtre
    Participant

    can i get gsm(sim900) program..

     

    March 15, 2016 at 3:29 pm #13787
    umesh mehtre
    Participant

    plzz help…

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Fun with AI and swordfish basic June 22, 2025
  • Microinverters and storeage batteries? June 22, 2025
  • FFC connector white June 22, 2025
  • Is AI making embedded software developers more productive? June 22, 2025
  • Can I make two inputs from one?? June 22, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise