VEHICLE TRACKING WITH ACCIDENT DETECTION

so in my project i have to interface a camera module to the arduino gsm/gps tracker and click pictures according to user's wish and send it to the android app where the picture will be displayed
so how you can send the command from the android app to the arduino to click the picture and receive it in the android app??

so how you can send the command from the android app to the arduino to click the picture

What is the command? How are the android and Arduino communicating?

and receive it in the android app??

Vvvveeeerrrryyyy sssslllloooowwwwllllyyyy.

basically the android app will get the data that will be sent to the TCP/IP server by arduino(Is it feasible?) but how to send the command to click an image from the android app??

saurabh64:
interface a camera module to the arduino gsm/gps tracker

That interface strikes me as problematic.

It isn't quite clear what you want to achieve (for example, are these still pictures, or videos?) but if you want to have something that works like a digital camera and have the pictures uploaded to somewhere that is accessible to your Android device, you might find that a conventional digital camera with a wireless SD card can do what you need. Alternatively, I remember reading about a GSM modem with an integral camera which could be commanded (by an Arduino) to capture an image and send it over a GSM network. If you could arrange for the captured image to be uploaded to some internet-based file sharing system, the Android device could presumably access it from there. The key thing about both options is that the Arduino never has to deal with the actual image data.

I'll give my 2 cents from basic network programming perspective.

Assuming that you are using some ethernet shield with a TCP/IP stack...you are communicating at very high speed. This is not the same as your Serial communication speed.
So if you have TCP/IP stack then any kind of inter-computer communication is theoretically possible. You are only limited to what libraries you can find.

Using the TCP/IP stack library you can open up a "socket" on a port to listen to on the arduino. Anybody software program (including an Android App) who knows the Adruino IP address could open up the connection to that socket eg. 192.168.1.75:5 (for IP address of 75 and port 5 for example) to send/receive any kind of bytes. You can create your own proprietary protocol to communicate over this socket and interprete the bytes the way you want to. eg. First byte "P" means that you want to take a Picture etc.

If you want to go more standardized approach then you can use the ftp server stack (will depende on the library available with your ethernet shield) will be better. Even better would be to run a mini web server (HTTP) that responds to your commands based on the URL eg. http://192.168.1.1:5/SendPic.html

My quick websearch revealed this link http://subethasoftware.com/2013/04/09/arduino-ethernet-and-multiple-socket-server-connections/
for doing something like this. But once you know exactly your usage scenario then you can figure out how extensible of a protocol you want to use and search for examples of those.

BTW, you are assuming that your other side of the problem is how to communicate with your camera from Adruino to click its shutter and how to access the storage of that camera (sd card?).

PeterH:

saurabh64:
interface a camera module to the arduino gsm/gps tracker

That interface strikes me as problematic.

It isn't quite clear what you want to achieve (for example, are these still pictures, or videos?) but if you want to have something that works like a digital camera and have the pictures uploaded to somewhere that is accessible to your Android device, you might find that a conventional digital camera with a wireless SD card can do what you need. Alternatively, I remember reading about a GSM modem with an integral camera which could be commanded (by an Arduino) to capture an image and send it over a GSM network. If you could arrange for the captured image to be uploaded to some internet-based file sharing system, the Android device could presumably access it from there. The key thing about both options is that the Arduino never has to deal with the actual image data.

yep! storing the captured image on sd card and then sending it over the internet via gprs module to the android device

tttt:
I'll give my 2 cents from basic network programming perspective.

Assuming that you are using some ethernet shield with a TCP/IP stack...you are communicating at very high speed. This is not the same as your Serial communication speed.
So if you have TCP/IP stack then any kind of inter-computer communication is theoretically possible. You are only limited to what libraries you can find.

Using the TCP/IP stack library you can open up a "socket" on a port to listen to on the arduino. Anybody software program (including an Android App) who knows the Adruino IP address could open up the connection to that socket eg. 192.168.1.75:5 (for IP address of 75 and port 5 for example) to send/receive any kind of bytes. You can create your own proprietary protocol to communicate over this socket and interprete the bytes the way you want to. eg. First byte "P" means that you want to take a Picture etc.

If you want to go more standardized approach then you can use the ftp server stack (will depende on the library available with your ethernet shield) will be better. Even better would be to run a mini web server (HTTP) that responds to your commands based on the URL eg. http://192.168.1.1:5/SendPic.html

My quick websearch revealed this link http://subethasoftware.com/2013/04/09/arduino-ethernet-and-multiple-socket-server-connections/
for doing something like this. But once you know exactly your usage scenario then you can figure out how extensible of a protocol you want to use and search for examples of those.

BTW, you are assuming that your other side of the problem is how to communicate with your camera from Adruino to click its shutter and how to access the storage of that camera (sd card?).

issuing a command to capture a image from the android app to the arduino and storing the image on the sd card which will be then sent via gprs back to the arduino this my basic purpose

If you are using this GSM/GPRS shield:

Then communication between the Arduino and GPRS is with SoftwareSerial, which has a maximum Arduino -> Shield baud rate of 115.2Kbps (you may need to lower that to 57.6Kbps for reliability, particularly for Shield -> Arduino). To transfer a 3 megapixel JPEG of about 500KB at 115.2Kbps, it would take 35 seconds (and of course at 57.6Kbps, over a minute). It may take a bit longer when you factor in reading the data off the SD card. Is that kind of delay acceptable for your application?

tylernt:
If you are using this GSM/GPRS shield:

http://arduino.cc/en/Guide/ArduinoGSMShield

Then communication between the Arduino and GPRS is with SoftwareSerial, which has a maximum Arduino -> Shield baud rate of 115.2Kbps (you may need to lower that to 57.6Kbps for reliability, particularly for Shield -> Arduino). To transfer a 3 megapixel JPEG of about 500KB at 115.2Kbps, it would take 35 seconds (and of course at 57.6Kbps, over a minute). It may take a bit longer when you factor in reading the data off the SD card. Is that kind of delay acceptable for your application?

Yes . But I'll be using different gsm shield

saurabh64:

tylernt:
Is that kind of delay acceptable for your application?

Yes

Ok. So I'm a little fuzzy on your application. Do I have this right:

Arduino+Camera+SD Card+GPRS <-> Internet <-> Android device

So, you want to open the web browser on the Android device to a web page served up by the Arduino. This web page has a button to "take picture". When clicked, the Arduino then signals the camera to take a picture, which is stored on the SD card, and then this image is read from the SD card and sent over GPRS and the internet back to the Android device.

Is that correct?

My question exactly!
Your objective is not exactly clear. Also, overall purpose is unclear as well.

Seems to me like this is an academic exercise instead of just trying to solve a real problem.
I mean, if you really want to take pictures remotely then you don't even need Arduino in the picture (lol)! Any modern phone has all your components (Camera, GPS, gprs and a software platform) built in. Just write two apps that talk to each other on two different phones. One to send the request and other one to listen to requests, take picture and send it back along with any extra data like GPS coords that you need.

If you must use Arduino, is this meant to be a mobile device or stationary? If mobile, you'll have to worry about an enclosure and power for the Arduino on top of all the individual pieces of this project that you need to figure out.


ok this image will give you'll the idea of what i want to do

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

this is because last year somebody had done same project using PIC microcontroller

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

google maps will be used to view the coordinates

Is server required to store the data sent from the gsm module as an interface between the CELL TOWER(INTERNET) and the ANDROID DEVICE?

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

Well, why didn't you just say so from the beginning?

tylernt:

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

Well, why didn't you just say so from the beginning?

Hmm sorry about that .But I need help as I am new to arduino

The approach that seems best to me would be to set up a local area network in the vehicle with a GPRS interface to the public internet. Then you can use plain old IP cameras for the video elements, which avoids a lot of problems which would be very difficult to solve with an Arduino. You can get dedicated 3G/Ethernet routers for under twenty quid, for example many MiFi routers provide a local Ethernet port, and Ethernet hubs cost peanuts. Add in an Arduino with an Ethernet interface and an IP camera with an Ethernet interface, and you have the basis of a working solution. There are other approaches that would be viable - many domestic ADSL routers provide a USB host socket and can be configured to fall back to a 3G connection via a USB-connected 3G modem if the DSL fails, but I think that using a self-contained 3G router would be less technically challenging.

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.