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 / sms tranmission through GSM MODEM 8051

sms tranmission through GSM MODEM 8051

|

Microcontroller › 8051 › sms tranmission through GSM MODEM 8051

  • This topic has 9 replies, 9 voices, and was last updated 10 years, 1 month ago by Ashutosh Bhatt.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • September 26, 2012 at 12:24 pm #1969
    Surya Gupta
    Participant

    i need help. i have run the below code sucessfully in proteus ….but stuck in my matrix circuit ….can any1 give any details why the msg is not transmitting . can any1 give simple msg sending code or edit the below code.

     

     

     

     

                                                              // Program to interface GSM Module with 8051 microcontroller (AT89C51) using PC and LCD
    #include<reg51.h>
    #define port P2
    #define dataport P0            // Data port for LCD
    sbit rs = port^5;
    sbit rw = port^6;
    sbit en = port^7;
    //sbit pi= port^3;
    int count=0,i,j=0,k=0;                   
    //unsigned char check,str_cz[2]={0x1A,’’};
    unsigned char str[15],str_index[10];

    //bit check_space ;

    void init_serial()            // Initialize serial port
    {    TMOD=0x20;    
        TL1=0xfd;        // Mode=2    
        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(unsigned char *str)
    {
        
         int i=0;    
        while(str
    !=’’)    
        {    
            EA=0;
            SBUF = str
    ;
             while(TI!=1);
             delay(1);
             i++;
             EA=1;
             }
    }

    void transmit1(unsigned char str)
    {
        SBUF=str;
        while(TI!=1);
        TI=0;
    }
    void receive_data()  interrupt 4          // Function to recieve data serialy from RS232 into microcontroller
    {    

    if(RI==1)
    {
        str[++count]=SBUF;         //Read SBUF    
        if(str[count-1]==’,’|| (k=1) )
        {
            str_index[j]=str[count];
            j++;
            k=1;
        }    
            RI=0;
    //        k=1;

         }
    }  
                                              /*
    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 0x1;        
                break ;        
                }
                   
            default:
           
            return 0x02 ;        // Return 0x02 for characters except new line and carriage return
                }
                }                                */
               
    void main()
    {     
    //unsigned char cz;
        lcd();                        // Initialize LCD
        init_serial();
        delay(400);                    // Initialize serial port
        lcd_data_string(“sending msz”);
        delay(100);
        //lcd_data(‘a’);
        //delay(10);
        //lcd_cmd(0xc0);
        count=(-1);
        //lcd_data_string(“Ready…123”);
        //delay(10);                            
        lcd_cmd(0xc0);        
            IE=0x94;    
    //    cz=0x1A;
        
    //transmit(“ATrAT+CMGF=1rAT+CMGS=”+9779841540672″rTest Message 123”);
    //transmit(str_cz);

    //delay(40);
    ES=0;
    transmit(“AT+CMGF=1r”);
    delay(1000);
    //transmit(“AT+CSCS=”GSM”r”);
    //delay(400);
    //transmit(“AT+CSCA=”+97798……..”,145r”); //service center no
    //delay(400);
    //transmit(“AT+CSMP=17,167,0,240r”);    //text mode format
    //delay(400);
    transmit(“AT+CMGS=”+97798……….”r”);//my mob number here
    //delay(400);
    transmit(“Test Message 123”);
    //delay(400);
    transmit(0x1A);
    lcd_data_string(“msz sent”);
    delay(1000);
    ES=1;
    //pi=0;

    }

    September 26, 2012 at 6:51 pm #8619
    AJISH ALFRED
    Participant

    Hi Surya,

    Make sure that you explain a bit more detailed about your projet allabouts, and then the problem which you are facing. A block diagram or schematic diagram will be more useful. Then only someone can go through your code and analyze. Also make sure that you’ve commented the code properly.

    March 14, 2013 at 2:27 pm #9318
    ankit mishra
    Participant

    can any one tell me the coding in bascom language to interface the gsm module with atmel8051 microcontroller ,

    March 26, 2013 at 5:25 am #9373
    sra1
    Participant

    thanks dude……………..

    September 8, 2013 at 7:04 pm #10427
    pardeep
    Participant

    hello sir i m working on gsm based security sysem   . i m using phillips mcu 89v51rd2. gsm modem sim300. will u please send me some details for interfacing and programing in c.

    September 10, 2013 at 4:43 am #10429
    AJISH ALFRED
    Participant

    Hi all,

    Please refer the following link;

    http://www.engineersgarage.com/microcontroller/8051projects/gsm-interface-8051-microcontroller-circuit-code

    February 4, 2014 at 11:34 am #10931
    25
    Participant

    Excellent description of code and circuit

    February 1, 2015 at 5:31 pm #12554
    M.ilyas
    Participant

    hi surya .hope u will b fine .dear i need ur help .i m making the same project as u made before .plz dear send me complete tutorial from strt to end if u can..i will b very thanfull to u for this act ..

                       thanks 

     

    April 3, 2015 at 8:14 am #12746
    Subin G
    Participant

    Hello, can youp please give the c program for interfacing gsm module with 8051 without using pc…also am not using any LCDs..Please help

    April 3, 2015 at 7:02 pm #12748
    Ashutosh Bhatt
    Participant

    you just read the theory of how to interface GSM with 8051. u will get full idea that how to send AT commands to GSM modem using 8051

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

RSS Recent Posts

  • how to work on pcbs that are thick May 18, 2025
  • Actin group needed for effective PCB software tutorials May 18, 2025
  • Kawai KDP 80 Electronic Piano Dead May 18, 2025
  • Doing consultancy work and the Tax situation? May 18, 2025
  • How to repair this plug in connector where wires came loose May 17, 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