VEHICLE TRACKING WITH ACCIDENT DETECTION

Basically this is my final year project
REAL-TIME VEHICLE TRACKING WITH ACCIDENT DETECTION

COMPULSORY THINGS ARE

  • -I'll have to use arduino
  • -display the coordinates etc etc in an android app
  • -image capture

Components i'll be using:

  • arduino uno r3
  • gps module
  • gsm module
  • piezo sensor( to detect the impact during collision)
  • flame sensor
  • vga cam module or 1.3 megapixel cam module

The flame sensor idea is a bit gory, but in the name of science...

Assumption: picture capture is only necessary at collision instant.
Collect all of the data such as GPS info and forward it over GMS to some site such as sensorcloud.com and use your Android phone to log-in and monitor the status of the collected data in near-real time.
If an impact is detected, send the last frame taken by the camera (and I would go ahead and put the camera into video mode at that instant.)

The android app can "pull" the geo cordinates from the sensorcloud database and feed them to google maps to plot the location of the vehicle on a map.

The flame sensor can be used to spray water over the passengers under Arduino control.

Good luck,

Ray

PS: Added another sensor web-link: https://sensormonkey.eeng.nuim.ie/

Thinking about this, wouldn't a plain old smartphone be a better platform for this project? That would give you a GPS location, video and still capability, accelerometer, network connectivity, user-friendly development environment and much, much more runtime resources available to you.

mrburnette:

Basically this is my final year project
REAL-TIME VEHICLE TRACKING WITH ACCIDENT DETECTION

COMPULSORY THINGS ARE

  • -I'll have to use arduino
  • -display the coordinates etc etc in an android app
  • -image capture

Components i'll be using:

  • arduino uno r3
  • gps module
  • gsm module
  • piezo sensor( to detect the impact during collision)
  • flame sensor
  • vga cam module or 1.3 megapixel cam module

The flame sensor idea is a bit gory, but in the name of science...

Assumption: picture capture is only necessary at collision instant.
Collect all of the data such as GPS info and forward it over GMS to some site such as sensorcloud.com and use your Android phone to log-in and monitor the status of the collected data in near-real time.
If an impact is detected, send the last frame taken by the camera (and I would go ahead and put the camera into video mode at that instant.)

The android app can "pull" the geo cordinates from the sensorcloud database and feed them to google maps to plot the location of the vehicle on a map.

The flame sensor can be used to spray water over the passengers under Arduino control.

Good luck,

Ray

PS: Added another sensor web-link: https://sensormonkey.eeng.nuim.ie/

Thanks :slight_smile:

PeterH:
Thinking about this, wouldn't a plain old smartphone be a better platform for this project? That would give you a GPS location, video and still capability, accelerometer, network connectivity, user-friendly development environment and much, much more runtime resources available to you.

Ya that would be easier to do but for the sake of complexity.
8 people in the project group .Marks will be allotted based on how much work you do
So I'll have to use some complex device, Arduino platform in my case
and there will be enough work like interfacing the hardware,coding the hardware part , software part etc
for each member from the group
because in case of smartphone everything will be available readymade so the work divided will be very less for each group member

Now that we know your objective..
You need to figure out several pieces of this puzzle .. each of which can be assigned to an individual in your group.

  1. Camera shutter control from Arduino
  2. Access to the SD card/image storage of the camera from Arduino
  3. Adruino to GSM communication
  4. Android app
  5. Handshaking between Android & Arduino with GSM as the underlying communication (I'm thinking that both sides may have to go via a "known" IP address as an intermediary)
    Once you figure out this flow for camera, adding other sensory modules like GPS, Impcact sensor, flame sensor etc also become individual topics but ride on the same communication mechanism as your camera image.

Each of these pieces is an individual problem that you could ask questions about separately (once you think about them), instead of bundling the whole problem into one big rolled up topic.

yeah, will do.

#include "SIM900.h"
#include <SoftwareSerial.h>
#include "inetGSM.h"
//#include "sms.h"
//#include "call.h"

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.

//Simple sketch to start a connection as client.

InetGSM inet;
//CallGSM call;
//SMSGSM sms;

char rst[50],msg[50],a=27,b=55,c=66,d=34;
int numdata;
char inSerial[50];
int i=0;
boolean started=false;

void setup() 
{
  //Serial connection.
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");
  //Start configuration of shield with baudrate.
  //For http uses is raccomanded to use 4800 or slower.
  if (gsm.begin(4800)){
    Serial.println("\nstatus=READY");
    started=true;  
    gsm.forceON();
  }
  else Serial.println("\nstatus=IDLE");
  if(started){
    //GPRS attach, put in order APN, username and password.
    //If no needed auth let them blank.
    if (inet.attachGPRS("internet.wind", "", ""))
      Serial.println("status=ATTACHED");
    else Serial.println("status=ERROR");
    delay(1000);
    //Read IP address.
    gsm.SimpleWriteln("AT+CIFSR");
    delay(5000);
    //Read until serial buffer is empty.
    gsm.WhileSimpleRead();
  
    //TCP Client GET, send a GET request to the server and
    //save the reply.
    numdata=inet.httpPOST("Vehicletracking.com.nu", 80, "/track.php", "vid=25&lat=54&lon=5&speed=55", rst, 50);
    //Print the results.
    Serial.println("\nNumber of data received:");
    Serial.println(numdata);  
    Serial.println("\nData received:"); 
    Serial.println(rst); 
     Serial.println("SIGNAL QUALITY");
      gsm.SimpleWriteln("AT+CSQ");
  }
};

void loop() 
{
  serialhwread();
  serialswread();
};

void serialhwread(){
  i=0;
  if (Serial.available() > 0){            
    while (Serial.available() > 0) {
      inSerial[i]=(Serial.read());
      delay(10);
      i++;      
    }
    
    inSerial[i]='\0';
    if(!strcmp(inSerial,"/END")){
      Serial.println("_");
      inSerial[0]=0x1a;
      inSerial[1]='\0';
      gsm.SimpleWriteln(inSerial);
    }
    //Send a saved AT command using serial port.
    if(!strcmp(inSerial,"TEST")){
      Serial.println("SIGNAL QUALITY");
      gsm.SimpleWriteln("AT+CSQ");
    }
    //Read last message saved.
    if(!strcmp(inSerial,"MSG")){
      Serial.println(msg);
    }
    else{
      Serial.println(inSerial);
      gsm.SimpleWriteln(inSerial);
    }    
    inSerial[0]='\0';
  }
}

void serialswread(){
  gsm.SimpleRead();
}

In the above code what we want to do is dynamically get the values like latitude,longitude,speed etc. from gps module and send to the server 'com.nu'
currently we are manually inserting the values as seen in the following code
what changes in the following line should we make to send the updated data without manually inserting individual values?

 numdata=inet.httpPOST("Vehicletracking.com.nu", 80, "/track.php", "vid=25&lat=54&lon=5&speed=55", rst, 50);

In the above code what we want to do is dynamically get the values like latitude,longitude,speed etc. from gps module and send to the server 'com.nu'

Take a look at an Arduino example in any GPS code and you'll see how the values are assigned... use an example for the GPS module you intend on using. Say, if using Adafruit's GPS, then her example is here:
https://github.com/adafruit/Adafruit-GPS-Library/blob/master/examples/parsing/parsing.pde

    Serial.print("\nTime: ");
    Serial.print(GPS.hour, DEC); Serial.print(':');
    Serial.print(GPS.minute, DEC); Serial.print(':');
    Serial.print(GPS.seconds, DEC); Serial.print('.');
    Serial.println(GPS.milliseconds);
    Serial.print("Date: ");
    Serial.print(GPS.day, DEC); Serial.print('/');
    Serial.print(GPS.month, DEC); Serial.print("/20");
    Serial.println(GPS.year, DEC);
    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    Serial.print(" quality: "); Serial.println((int)GPS.fixquality); 
    if (GPS.fix) {
      Serial.print("Location: ");
      Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
      Serial.print(", "); 
      Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);
      
      Serial.print("Speed (knots): "); Serial.println(GPS.speed);
      Serial.print("Angle: "); Serial.println(GPS.angle);
      Serial.print("Altitude: "); Serial.println(GPS.altitude);
      Serial.print("Satellites: "); Serial.println((int)GPS.satellites);

saurabh64:
what changes in the following line should we make to send the updated data without manually inserting individual values?

 numdata=inet.httpPOST("Vehicletracking.com.nu", 80, "/track.php", "vid=25&lat=54&lon=5&speed=55", rst, 50);

If the values you're referring to are 25, 54, 5, 55 then you can replace that string literal with a char array which contains the string you want to send. You can use snprintf() to format the message in the char array.

int vid, lat, lon, speed; // variables containing the values that you want to send

... assign the values to the variables here 

char params[40]; // make this big enough for your longest string, plus one for the null terminator
snprintf(params, sizeof(params), "vid=%d&lat=%d&lon=%d&speed=%d", vid, lat, lon, speed);
numdata=inet.httpPOST("Vehicletracking.com.nu", 80, "/track.php", params, rst, 50);

thnx .Finally got it to send the gps values and retrieve in android app.

I have integrated gsm module and gps receiver
Now I have to connect ov7670(FIFO) to arduino mega 2560

I have to do two things

i)Test the ov7670 to capture images ( dont have an LCD to view it!)
ii)Integrate it with gsm gps

How am i supposed to connect it to mega?

https://www.google.com/search?q=arduino+ov7670

tylernt:
arduino ov7670 - Google Search

Some helpful info please .
Ive done google search , this website is my last resort :~ :frowning:

saurabh64:
Some helpful info please .

What, specifically, have you tried, and in what manner did it fail?

saurabh64:

tylernt:
arduino ov7670 - Google Search

Some helpful info please .
Ive done google search , this website is my last resort :~ :frowning:

That's curious, because the link above returned a load of relevant articles for me. If all that information isn't enough to answer your question, perhaps you ought to be more explicit about what your problem is. If the question is just "How do I ...?" then that search answers it.

PeterH:

saurabh64:

tylernt:
arduino ov7670 - Google Search

Some helpful info please .
Ive done google search , this website is my last resort :~ :frowning:

That's curious, because the link above returned a load of relevant articles for me. If all that information isn't enough to answer your question, perhaps you ought to be more explicit about what your problem is. If the question is just "How do I ...?" then that search answers it.

how do you connect ov7670(FIFO) to arduino mega 2560
the pins on ov7670 I mean.
there are 22 pins on ov7670
i wanted to know which pins are connected to what pin on mega 2560 for OV7670 FIFO version, capture the image and
and store that image in SD card

and i just want for image capture

https://www.google.com/search?q=arduino+ov7670+schematic&tbm=isch

how to receive values from php server to arduino using HTTP POST?
we have saved the audio files on sd card
and the user will send a token value from android app that we have designed and that should be played on arduino
on a speaker

we are using gsm shield and not ethernet shield

arduino code:

numdata=inet.httpPOST("Vehicletracking.com.nu", 80, "/voicem.php", shortbuf, rst, 50);

and here is the php code

<?php 
if($_POST)
{
error_reporting(E_ALL);
$server="localhost";
$user="";
$pass="";
$database="";
$connection=mysql_connect($server,$user,$pass);
if(!$connection)
{
die('could not connect:'.mysql_error());
}
mysql_select_db($database,$connection);

$sqlString = "SELECT arg FROM message WHERE srno=(SELECT MAX(srno) FROM `message`);";
$result=mysql_query($sqlString,$connection);
$ARG=$result;

$sqlString1 = "DELETE * FROM message;";
$result1=mysql_query($sqlString1,$connection);
$val=$result;
echo $val;
if($result)
{
echo $ARG;
}
else
{
echo "error in inserting data:".mysql_error();
}
mysql_close($connection);
}
?>