Sign In

Problem In Message Sending And Receiving And Also Displaying On LCD Via GSM

Nabeel Idrees and Irfan B Nabeel.idrees17@yahoo.com Pakistan

Hardware: Arduino Mega 2560 , GSM Modem Sim900D , LCD Software: Programming Language C , Compiler Arduino 1.6.7

Dear Sir i am making a project (Message display on LCD GSM based) and i am facing a problem in coding. when i burn a code in Arduino of Hello Word it print on LCD but When i attach a GSM modem and then i burn code of (message receiving from cell phone and print out on LCD ) there problem is occur because message not print on LCD.

Images

problem in message sending and receiving and also displaying on LCD via GSM

Program

#include <SoftwareSerial.h>

String pilih;

SoftwareSerial mySerial(17, 16);

void setup()

{

mySerial.begin(9600); // Setting the baud rate of GSM Module

Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)

RecieveMessage();

delay(100);

}

void loop()

{

if (Serial.available()>0)

switch(Serial.read())

{

case 's':

SendMessage();

break;

case 'r':

RecieveMessage();

break;

}

if (mySerial.available()>0)

{ Serial.write(mySerial.read());

pilih = mySerial.read();}

}

void SendMessage()

{

mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode

delay(1000); // Delay of 1000 milli seconds or 1 second

mySerial.println("AT+CMGS="+62xxxxxxxxx"r"); // Replace x with mobile number

delay(1000);

mySerial.println("Message Send :)");// The SMS text you want to send

mySerial.println(pilih);

delay(100);

mySerial.println((char)26);// ASCII code of CTRL+Z

delay(1000);

}

void RecieveMessage()

{

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

delay(1000);

//There are different AT commands for different tasks. If you want to read

//all SMS’s stored in your SIM card, send the following AT Command

//to gsm module – “AT+CMGL=”ALL”r”

}

Replies

R Avinash
2016-05-09 16:58:02
In the code which you have provided their is no reference code relating to LCD. I mean no command is sent to LCD for any kind of display.
0
R Nabeel Idrees and Irfan B
2016-05-14 07:10:01
can you provide the source code which help us for making this project. i also upload an other code please provide the code which run with arduino mega2560 easily i really need your help.
0

Post a reply to Nabeel Idrees and Irfan B

Think you can help Nabeel Idrees and Irfan B ? Then post your thoughts that might help Nabeel Idrees and Irfan B. You will earn a lot of reputation in the technical community.

If your program is in multiple files, then ZIP the entire folder and attach below

Images and Screenshots

These helps other better understand your suggestion.