Lost, help me ,iam not getting sms from gsm module

i have big problem with these i gsm module is not sending the location of the vehicle

iam using

1.arduino uno board
2.16*2 lcd display for cross checking my location
3.gsm module sim900A
4.gps module royaltek ReB 4612
5.vibration sensor for detecting the vibrations
6.buzzer for sounding when even their is an accident
here is my code plz let me know faults in my code

#include <SoftwareSerial.h>
#include<LiquidCrystal.h>
#define buzzer 8
#define E 9  //vibration sensor
LiquidCrystal lcd(7,6,5,4,3,2);
SoftwareSerial mySerial(9, 10);

char str[60];
char *test="$GPGGA";      
char longitude[9];
char latitude[10];

int i,j,k;
int temp;
int led=13;

void setup()
{
  lcd.begin(16,2);
  mySerial.begin(9600);
  Serial.begin(4800);
  pinMode(buzzer,OUTPUT);
  pinMode(E, INPUT);
  pinMode(led, OUTPUT);
  lcd.setCursor(0,0);
  lcd.print("GPS Based Vehicle ");
  lcd.setCursor(0,1);
  lcd.print("Tracking System");
delay(3000);
  lcd.clear();
}

void loop()
{
  if (digitalRead(E)== 1)
  {digitalWrite(buzzer, HIGH);
{
    for(i=18;i<27;i++)          //extract latitude from string
    {
      latitude[j]=str[i];
      j++;
    }
   
    for(i=30;i<40;i++)          //extract longitude from string
    {
      longitude[k]=str[i];
      k++;
    }
    lcd.clear();
    lcd.setCursor(0,0);        //display latitude and longitude on 16X2 lcd display 
    lcd.print("Lat(N)");
    lcd.print(latitude);
    lcd.setCursor(0,1);
    lcd.print("Lon(E)");
    lcd.print(longitude);
    delay(100);
    mySerial.begin(9600);
    mySerial.println("AT+CMGF=1");    //select text mode
    delay(10);
    mySerial.println("AT+CMGS=\"+918885751592\"\r");  // enter receipent number
    mySerial.println("Vehicle Accident Happend at Place:");
    mySerial.print("Latitude(N): ");             //enter latitude in msg
    mySerial.println(latitude);                  //enter latitude value in msg
    mySerial.print("Longitude(E): ");            //enter Longitude in Msg
    mySerial.println(longitude);                  //enter longitude value in msg
    mySerial.print("Help Please");
    mySerial.write((char)26);                      //send msg  Ctrl+z=26
    temp=0;
    i=0;
    j=0;
    k=0;
    delay(20000);                        // next reading within 20 seconds
    Serial.begin(4800);
    mySerial.begin(9600); 
}
}

else{
    for(i=18;i<27;i++)          //extract latitude from string
    {
      latitude[j]=str[i];
      j++;
    }
   
    for(i=30;i<40;i++)          //extract longitude from string
    {
      longitude[k]=str[i];
      k++;
    }
    lcd.clear();
    lcd.setCursor(0,0);        //display latitude and longitude on 16X2 lcd display 
    lcd.print("Lat(N)");
    lcd.print(latitude);
    lcd.setCursor(0,1);
    lcd.print("Lon(E)");
    lcd.print(longitude);
    delay(100);
    mySerial.begin(9600);
    mySerial.println("AT+CMGF=1");    //select text mode
    delay(10);
    mySerial.println("AT+CMGS=\"+918885751592\"\r");  // enter receipent number
    mySerial.println("Vehicle located at :");
    mySerial.print("Latitude(N): ");             //enter latitude in msg
    mySerial.println(latitude);                  //enter latitude value in msg
    mySerial.print("Longitude(E): ");            //enter Longitude in Msg
    mySerial.println(longitude);                  //enter longitude value in msg
    mySerial.write((char)26);                      //send msg  Ctrl+z=26
    temp=0;
    i=0;
    j=0;
    k=0;
    delay(20000);                        // next reading within 20 seconds
    Serial.begin(4800);
    mySerial.begin(9600);
}
}
void serialEvent()
{
  while (Serial.available())            //Serial incomming data from GPS
  {
    char inChar = (char)Serial.read();
     str[i]= inChar;                    //store incomming data from GPS to temparary string str[]
     i++;
     if (i < 7)                      
     {
      if(str[i-1] != test[i-1])         //check for right string
      {
        i=0;
      }
     }
    if(i >=60)
    {
     break;
    }
  }
}

my problem sms is not coming from gsm module please verify it and let me know.
iam new to these arduino i have programmed above program by seeing so many videos
please try to help me
Thanking you
yours faithfully
Rupa Velamuri

For goodness sake read this before posting a programming question and note what it says about using code tags. Unless, of course, half of your code should be in italics.

. . . and whilst you're reading the posting guidelines, check what it says about duplicate posts.

(In case you're wondering, I deleted the duplicate)

for(i=18;i<27;i++)          //extract latitude from string

It is incorrect to ASSume that the latitude data will always be in those positions.

for(i=30;i<40;i++)          //extract longitude from string

It is incorrect to ASSume that the longitude data will always be in those positions.

It is stupid to ASSume that there IS GPS data to extract location information from.

It is silly to post here saying "this doesn't work" without saying what it does and how that differs from what you want.

sorry iam new to this site (AWOL) i dont know how to send now only iam getting this how to send

Well, do any of the basic examples for the GSM module work?

You did put an active/paid-for SIM card into it didn't you?

i tried basic command on gsm which will send sms but in this program it is sending sms but lat and longitude
r not coming i have seen in the serial monitor that i havnt found latitdue and longitude values
please help me out of these

OK, so forget the GSM and concentrate on the GPS.

Does it have a clear view of the sky?

i have placed in a lab and performing the task

when i have tested the GPS module individually i got lat and longitude values
after grouping 2 time i have found some unidentified lat and long which dont have any direction north and east direction it havnt showed me the lat and long values on lcd display 16*2

when i have tested the GPS module individually i got lat and longitude values

Got them where?

after grouping 2 time i have found some unidentified lat and long which dont have any direction north and east direction it havnt showed me the lat and long values on lcd display 16*2

Punctuation, capitalization, and proofreading would help this collection of words a lot.

when i have tested the GPS module individually i got lat and longitude values

i have seen them on serial monitor

later after adding all the module iam missing with gps values with some wrong location sometime it will not display anything

when i have tested the GPS module individually i got lat and longitude values

Using some code that you have not shared. So, I'll guess that it printed data only when it had data to print, while the code you did post prints data regardless of whether there is data to use, or not.

It's up to you to prove me wrong.

hey pauls bro i will show u what i am getting but idont know where i can add the image

Why do you need to upload an image? You can add e.g. text from serial monitor using the code tags.

blob:https%3A//mail.google.com/8d5fef30-8ec4-482c-be40-f6f32ed476eb

this is the image link iam getting the gps lat and lon but it is not acting according to the code it send act when vibration sensor read value
and iam not getting sms

rupavelamuri:
blob:https%3A//mail.google.com/8d5fef30-8ec4-482c-be40-f6f32ed476eb

this is the image link iam getting the gps lat and lon but it is not acting according to the code it send act when vibration sensor read value
and iam not getting sms

Your link is broken. Please follow the instructions in reply #13.

i have updated the code and the result can any one help me out with getting sms

You should not update code in an existing post but create a new post with the updated code. Anything anybody commented on your original code now probably no longer makes sense. Don't do it, please.

Maybe start with a simple example trying to send an SMS in the setup() function. Once you got that working, you can concentrate on the other parts and integrate the GSM code in it.

Never used a GSM shield so can't be of much help.

sterretje it may look like same but my output is different i have uploaded the photo after changing my code
i have worked with the GSM module it worked perfectly

i have uploaded the result in a image plz see it and let me know where it went wrong please
i have 4 day in my hand guys please help me

i have uploaded the image of my output after small change in the code
it working but i cant get sms plz try to help me
thanking you
your faithfully,

rupa velamuri

note: i dont have time to play with you guys i know time is very important and i dont post anything which is invalid
sorry if any one hurts