You have now learned how to connect the sensor and the GPS to the microcontroller. If you started reading from this blog you can first refer to my blogs containing earlier parts at –
https://abishaisingh.wordpress.com/2012/06/17/vehicle-crash-monitoring-system-part-2/
and
https://abishaisingh.wordpress.com/2012/06/06/vehicle-crash-monitoring-systempart-1/
Now the last thing required in our project and that is the GSM modem. I had written about the GSM modem i.e SIM 300 in my earlier blogs which you can see at –
https://abishaisingh.wordpress.com/2012/06/03/gsm-modem-sim-300-sending-text-sms-arduino/
After doing these things, we can individually sense, find location and send SMS. But for my project it is essential to do all the 3 things simultaneously. So that whenever an accident is detected, it should find the location of the spot and send the location at the emergency number for calling for help.
So, the final setup which I made looked something like this –
I packed the three things in a box. The 2 modems and arduino is packed in a plastic box for protection. The adaptor ports of all the three boards are connected with a main port which is used to connect with a single 12 volt adaptor. The whole setup is shown below –
And the back view –
The above pictures were taken at the time of my project i.e when I was doing my engineering and working on this project.
Now after finishing the hardware, its time to write the arduino code. The code which I had written is shown below:-
//The code is written by Abishai.
#include <SoftwareSerial.h>
const int ledPin = 13;
const int crashSensor = A0;
const int threshold = 4;
int sensorReading = 0;
#define rxPin 9
#define txPin 8
SoftwareSerial gps = SoftwareSerial(rxPin, txPin);
byte byteGPS = 0;
int i = 0;
int h = 0;
char inBuffer[300] = “”;
char GPS_RMC[100]=””;
void setup(){
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
gps.begin(9600);
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
delay(1000);
}
void loop(){
delay(1000);
sensorReading = analogRead(crashSensor);
if (sensorReading >= threshold) {
digitalWrite(ledPin, HIGH);
Serial.println(“AT”);
delay(2000);
Serial.println(“AT+CMGF=1”);
delay(1500);
Serial.print(“AT+CMGS=”);
Serial.print(34,BYTE);
Serial.print(“+919685290322”);
Serial.println(34,BYTE);
byteGPS = 0;
byteGPS = gps.read();
while(byteGPS != ‘R’){
byteGPS = gps.read();
}
GPS_RMC[0]=’$’;
GPS_RMC[1]=’G’;
GPS_RMC[2]=’P’;
GPS_RMC[3]=’R’;
i = 4;
while(byteGPS != ‘*’){
byteGPS = gps.read();
inBuffer[i]=byteGPS;
GPS_RMC[i]=byteGPS;
i++;
}
Serial.print(“Location Is: “);
h = 0;
while(GPS_RMC[h] != 42){
Serial.print(GPS_RMC[h],BYTE);
h++;
}
delay(1500);
Serial.println(26,BYTE);
while(1);
delay (60000);
}
}
My project is working properly. There are many future expansion for my project which can make it best and most useful for the injured person.
You can watch working of my project on youtube from the link below :-
Please do comment.
thank u for this amazing arduino project
Thankyou….
hey dude ur awesome!!:)
nyc work
Nice project Mr Abishai…………. Thanks for sharing knowledge with us….
video itself is awesome superb like ….thanks for sharing this
Thanks Ramteja……..
Hi Abishai, Can I get in touch with you about a Project for Car Crash Monitoring? Please PM me over twitter. Thanks
Wonderful Project..!! I am working at this as a 6th Semester Mini Project ..!! But I am supposed to make use of ARM7 processor…!! i will be in a colossal owe to you if you guide me in coding this..!!
Hi, I tried using your codes for a similar project. But it gives an error-
‘BYTE’ keyword is no longer supported. Please use Serial.write() instead.
How do I correct this? I tried replacing byteGPS with Serial.write() but I’m not able to understand what all I should change.
Please help!
Brilliant work by the way!
I am using skg13c gps module. I am getting invalid, i came to know by V alphabet from RMS format. Locations are 0000.
How to solve this problem. Is their any setting we have to do.
and How?
Fantasic project….good work!. I am working on something similar but would like to use wifi to send email. Could you help please?
Thanks
Sure, discuss your idea.
Thanks very much for getting back to me. I’m somewhat new to this but not totally!
I have been ask to put a crash sensor on golf carts that are being used in warehouses where wifi is available 24 hours a day. If the golf cart crashes, hits a overhead rack or just any hard enough contact that would cause damage to the object and/or the golf cart that it would send an email by their wifi. I need to be able to adjust crash sensor for different values. What I need for this and the code I’m unsure of to make this work. Again thanks for your help and getting back to me!
No problem. You will have to use a WiFi shield with your arduino and write a program that will send email. For sensor you can use accelerometer and give user specific buttons for changing the sensitivity of the device.
Hi Abishai, Thanks so much! I will get what is needed on order and hope I can get the code written! I think the code is going to be the challenge for me. Hopefully I can get some example code to get me started. Thanks again!
Nyc work
How long did you take to make
And pls tell me the total cost as well as the individual cost of parts used to make the project we need to prepare this for an exhibition
Abishai,
What I need is a way to adjust sensitivity of the crash sensor externally and no gps or cellular. I need it to be wifi and sends an email instead of a sms. Is this possible?
Thanks,
Dale
Yes it is possible.
i need the circuit diagram