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 / GSM Display system using arduino

GSM Display system using arduino

|

Microcontroller › Arduino › GSM Display system using arduino

  • This topic has 1 reply, 2 voices, and was last updated 6 years, 8 months ago by Hari Prasaath K.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • February 18, 2016 at 9:34 am #4302
    Sachin
    Participant

    Dear sir,

    I have modified the code attached because initially it wasn’t working.

    Still it is not working i.e. the message send through gsm module is not displaying on LCD but it showing on the serial monitor.

    Is there any problem in reading data serially and displaying??

    According to your code the string is in # and *???

    Please help me out….

    Resolve the issue.

     

     

     

    Thanks and Regards

    Sachin Telgote

     

     

    code as

    #include <SoftwareSerial.h>

    #include <LiquidCrystal.h>

    LiquidCrystal lcd(12,11,5,4,3,2);

    SoftwareSerial mySerial(7,8);

    int led=13;

    int temp=0,i=0,x=0,k=0;

    char str[100],msg[32];

    void setup()

    {

      lcd.begin(16,2);

      Serial.begin(9600);

      mySerial.begin(9600);

      pinMode(led, OUTPUT);

      digitalWrite(led, HIGH);

      lcd.setCursor(0,0);

      lcd.print("GSM Initilizing…");

      gsm_init();

     

      lcd.print("Wireless Notice");

      lcd.setCursor(0,1);

      lcd.print("    Board      ");

      delay(2000);

      lcd.clear();

      lcd.print("Forklift");

      delay(1000);

      lcd.setCursor(0,1);

      lcd.print("Communication");

      mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to recieve a live SMS

      delay(1000);

     

      mySerial.println("AT+CMGF=1"); // AT Command to recieve a live SMS

      delay(1000);

     

     mySerial.println("AT+CPMS='SM' "); // AT Command to recieve a live SMS

      delay(1000);

     

     mySerial.println("AT+CMGL= 'ALL' "); // AT Command to recieve a live SMS

      delay(1000);

     

     mySerial.println("AT+CMGR=2"); // AT Command to recieve a live SMS

      delay(1000);

     

     mySerial.println("AT+CMGD=2"); // AT Command to recieve a live SMS

      delay(1000);

      

      digitalWrite(led, LOW);

    }

    void loop()   

    {

      for(unsigned int t=0;t<10000;t++)

      {

        serialEvent();

      if(temp==1)

      {

        x=0,k=0,temp=0;

        while(x<i)

        {

          while(str[x]=='#')

          {

            x++;

            while(str[x]!='*')

            {

              msg[k++]=str[x++];

              Serial.print( msg[k++]);

            }

          }

          x++; 

       

        msg[k]='';

        }

        lcd.clear();

        lcd.print(msg[k++]);

        delay(1000);

        temp=0;

        i=0;

        x=0;

        k=0;

      }

      }

     

     

          if (mySerial.available())

        Serial.write(mySerial.read());

     

      lcd.scrollDisplayLeft();

    }

    void serialEvent()

    {

      while(Serial.available())

      {

        char ch=(char)Serial.read();

        str[i++]=ch;

        if(ch == '*')

        {

          temp=1;

          lcd.clear();

          lcd.print("Message Received");

          delay(1000);

        }

         }

     

              if (mySerial.available())

            Serial.write(mySerial.read());

    }

    void gsm_init()

    {

      lcd.clear();

      lcd.print("Finding Module..");

      boolean at_flag=1;

      if (mySerial.available())

          Serial.write(mySerial.read());

             mySerial.println("AT");

     

        delay(1000);

     

      lcd.clear();

      lcd.print("Module Connected..");

      delay(1000);

      lcd.clear();

      lcd.print("Disabling ECHO");

      boolean echo_flag=1;

     

         if (mySerial.available())

            Serial.write(mySerial.read());

     

       mySerial.println("ATE0");

        delay(1000);

     

      lcd.clear();

      lcd.print("Echo OFF");

      delay(1000);

      lcd.clear();

      lcd.print("Finding Network..");

      boolean net_flag=1;

     

         if (mySerial.available())

            Serial.write(mySerial.read());

     

            mySerial.println("AT+CPIN?");

       

               delay(1000);

     

      lcd.clear();

      lcd.print("Network Found..");

      delay(1000);

      lcd.clear();

    }

     

     

     

     

     

     

     

     

     

     

     

    September 5, 2018 at 5:30 pm #14902
    Hari Prasaath K
    Participant

    Check with your hardware interface connection between arduiono and LCD and refer the below code how the LCD code functions

    https://www.engineersgarage.com/embedded/arduino/how-to-interface-4-bit-lcd-with-arduino

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

RSS Recent Posts

  • parallel-to-serial problem May 23, 2025
  • STM32 checking self-written delay function May 23, 2025
  • Behringer MX 1602 mixer - reading block diagram May 23, 2025
  • Reclaiming missing motherboard header May 23, 2025
  • 12v battery, 18v magic May 23, 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