Go Down

Topic: help coming through with arduno (Read 408 times) previous topic - next topic

yazar

hello all, i am a new user to arduino and i need help with a current priject i am working on.
i need the codes to send the gps co-ordinates thats being obtained from a gps(GY-NEO6MV2 Ublox Flight Controller)  module to a registered number via a gsm sm900 module.
kindly treat as urgent.
i also need links to where i ca get materials i can read to understand arduino better.
Thanks!!!

Grumpy_Mike

#1
Oct 09, 2017, 05:42 am Last Edit: Oct 09, 2017, 05:44 am by Grumpy_Mike
Not sure you get what we do here. We help you understand, write and debug your hardware and software. We do not write code to order.

If you want some one to write code for you, post in the gigs and collaboration section and say how much you are willing to pay.

See what happens here when you don't want to learn.
https://forum.arduino.cc/index.php?topic=504391.0

Robin2

.
kindly treat as urgent.
Does that mean you think you should get help before everyone else who is before you in the queue?

That's not nice.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

spycatcher2k

Quote
kindly treat as urgent.
Hi - just as a note to anyone who reads this - when you put this type of note, I stop reading and close the post. To try and jump the queue is both rude, and inconsiderate ! OK to do this in the GIGs section as this may affect the availability of someone to take on the job, but in a forum where people give up their free time to provide free help!
-=-
http://www.uk-pcb.co.uk - UK Based PCB Fab & Assembly Company
Design & Assembly work undertaken - Arduino repairs & testing - PM for details. Arduino & C# PC programming.

lastchancename

ok, to get you running, though i completely agree with the previous comments.
I don't think you had bad intention - just that how you ask the question is often as important as the question itself!

You already have the GPS strings from the flight controller.
The next step isn't as daunting as you think.
Search for 'sending SMSwith Arduino'.
Virtually all modem chipsets operate with SMS the same way... the SIM900 is well represented in these pages.
Q: How many searches did you make before posting this question?      A: none
At the very least, take a guess at the solution, then we can help move forward from what you know already.

gdsports

Quote
i also need links to where i ca get materials i can read to understand arduino better.
Go to the top of this page and click on the Learning tab.

lastchancename

#6
Oct 11, 2017, 09:17 am Last Edit: Oct 11, 2017, 09:26 am by lastchancename
(For those following at home... the OP sent a PM with code which should be posted here (in tags).  I hope he does, so that others can see he's trying, and will get more help.)

ok, a few comments.

Where possible, get rid of delay() calls.  They simply make the world turn slower, and later on, you'll want your code to do other things instead of twiddling it's thumbs.  Look at millis()

In the SMS send section, you need to wait for the > prompt after sending the recipient number.
Also, need to terminate the message with CTRL-Z to initiate the send... and wait for OK

Within messages, while println will work, you may get better results with just an LF character, rather than a CR or CR/LF combination.  And it saves a couple of characters if your messages start getting near the size limit!

Finally, when you feel like it's all making sense, break some of the obvious blocks of code into functions().  It will become more readable, and easier to expand & debug.

P.S. PLEASE post your code as it progresses in <code> tags whenever possible, or attach the ino file.
Q: How many searches did you make before posting this question?      A: none
At the very least, take a guess at the solution, then we can help move forward from what you know already.

yazar

Code: [Select]

#include<liquidcrystal.h>
liquidcrystal lcd (2,3,4,5,6,7)

#define vibrate_sense 9

char str[70];
char *test="$GPGGA";     
char logitude[10];
char latitude[10];

int i,j,k;
int temp;
int fire=A1; //connect fire sensor to A1
int pressure = 11//connect pressure sensor to digital pin 11

void setup ()
{
lcd.begin(16,2);
serial.begin(4800);
lcd.setcusor(0,0);
lcd.print("VEHICLE ACCIDENT");
lcd.setcusor(0,1);
lcd.print("DETECTION USING ");
delay(5000);
lcd.clear();
lcd.setcusor(0,0);
lcd.print("GPS,GSM,PRESSURE");
lcd.setcusor(0,1);
lcd.print("FIRE,VIBRATION");
delay(5000);
lcd.clear();
}

void loop()
{
if (digitalRead(vibrate_sense)==0)
  {
    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
    {
      logitude[k]=str[i];
      k++;
    }
   
    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(logitude);
    delay(100);
    Serial.begin(9600);
    Serial.println("AT+CMGF=1");    //select text mode
    delay(10);
    Serial.println("AT+CMGS=\"9610126059\"");  // enter receipent number
    Serial.println("Vehicle Accident Happend at Place:");
    Serial.print("Latitude(N): ");             //enter latitude in msg
    Serial.println(latitude);                  //enter latitude value in msg
    Serial.print("Longitude(E): ");            //enter Longitude in Msg
    Serial.println(logitude);                  //enter longitude value in msg
    Serial.print("Help Please");
    temp=0;
    i=0;
    j=0;
    k=0;
    delay(20000);                        // next reading within 20 seconds
    Serial.begin(4800);
}

 if (digitalRead(pressure)==0)
  {
    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
    {
      logitude[k]=str[i];
      k++;
    }
   
    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(logitude);
    delay(100);
    Serial.begin(9600);
    Serial.println("AT+CMGF=1");    //select text mode
    delay(10);
    Serial.println("AT+CMGS=\"9610126059\"");  // enter receipent number
    Serial.println("Vehicle Accident Happend at Place:");
    Serial.print("Latitude(N): ");             //enter latitude in msg
    Serial.println(latitude);                  //enter latitude value in msg
    Serial.print("Longitude(E): ");            //enter Longitude in Msg
    Serial.println(logitude);                  //enter longitude value in msg
    Serial.print("Help Please");
    temp=0;
    i=0;
    j=0;
    k=0;
    pressure=0;
    delay(20000);                        // next reading within 20 seconds
    Serial.begin(4800);
}

    if (fire >60)
    {
    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
    {
      logitude[k]=str[i];
      k++;
    }
   
    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(logitude);
    delay(100);
    Serial.begin(9600);
    Serial.println("AT+CMGF=1");    //select text mode
    delay(10);
    Serial.println("AT+CMGS=\"9610126059\"");  // enter receipent number
    Serial.println("Vehicle Accident Happend at Place:");
    Serial.print("Latitude(N): ");             //enter latitude in msg
    Serial.println(latitude);                  //enter latitude value in msg
    Serial.print("Longitude(E): ");            //enter Longitude in Msg
    Serial.println(logitude);                  //enter longitude value in msg
    Serial.print("Help Please");
    temp=0;
    i=0;
    j=0;
    k=0;
    fire=0;
    delay(20000);                        // next reading within 20 seconds
    Serial.begin(4800);
}
}




Delta_G

Asks for urgent replies.   Then takes two days to get back. 
If at first you don't succeed, up - home - sudo - enter.

wvmarle

Urgent probably has different meaning in different parts of the world, or he was caught in the new user post delay...

No idea what that code is supposed to do.
It's terribly formatted (do a CTRL-T in the IDE to fix that) and almost completely lacks comments, other than the lines that are dead obvious, making it very hard to read in the first place.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

AWOL

Code: [Select]
char logitude[10];Natural, or base 10?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

lastchancename

I'm not sure what post #7 is meant to demonstrate - other than OP hasn't understood the other replies.

Some expianation to accompany the post would have been nice.
Q: How many searches did you make before posting this question?      A: none
At the very least, take a guess at the solution, then we can help move forward from what you know already.

AWOL

I'm not sure what post #7 is meant to demonstrate - other than OP hasn't understood the other replies.
Or anything very much.
Code: [Select]
serial.begin(4800);
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

yazar

I'm not sure what post #7 is meant to demonstrate - other than OP hasn't understood the other replies.

Some expianation to accompany the post would have been nice.
#7 is the code I need help with
its a report system and has three sensors, when either of the three sensors go off, the gps string of the location will be sent via a text message to a registered number

yazar

I Will Work On The Noted Changes And Give feedback.
I'm sorry for the late replies, there is very bad network reception in the part ofy country.

Cheers

Go Up