Train Accident Prevention with GPS







A Brief Description

Required Equipments

How it works?

Block Diagram

Algorithm

Detailed Pin Diagram

Problems Faced

Group Members Information

Course Teacher






A Brief Description


The aim of the project was to prevent the sporadic train accidents happening due to the lack of consciousness of the victims. The pedestrians are subject to very tragic accidents at the rail crossing. Most of the reports of such mishap had one alarming pre-eminence - the victims were preoccupied hearing musics in their smartphones. So we thought of taking this vulnerability of smartphone usage to our advantage. What if we could alert all those pedestrians closer to the rail-crossing of the forthcoming trains! No wonder their lifes could have been saved. The idea was to design an embedded system which would -

  1. Keep Track of the trains

  2. Centrally Gather the geo-location of the trains

  3. Send alert to smartphone users about nearby trains

So we have approached in following manner :
  1. Placing a computational unit to get the geo-location of trains

  2. Uploading geo-data from trains to a central server

  3. Creating an application program for mobile platform so that users can track the trains with the data received from the server



The trains will have the integrated Arduino-Pi-GPS module and it will send its Co ordinates- Latitudes and Logitudes, Speed, Bearing to a central server . The server would then broadcast information about all the trains in a vicinity to an user.

We have estimated a linear distance of 250 to be the tolerance. The user will be alerted about each train having less than the threshhold distance from his location.


Required Equipments







How it works?


In this project Arduino development board is used for interfacing to various hardware peripherals. The current design has to get the geo location of a train. For doing so a Raspberry Pi3 is interfaced to a Sim 808 GSM/GPS(GLONASS)Module .

SIM808 module is a complete Quad-Band GSM/GPRS module which combines GPS technology for satellite navigation. Featuring a GPS function, it allows variable assets to be tracked seamlessly at any location and anytime with signal coverage.

Pi3 has a built-in 802.11n WiFi, which can be made active from any WiFi Router or even smartphone hotspot. It is used to send the position of the train from tracks to the server. A python scripts runs on the Pi. It uses the Serial communication mechanism of Arduino by importing the libarary "serial". It then parses the GPS sensor output and sends a 'get' request to the dedicated server by incorporationg the sensor values in its payload .

the Pi3 sends data to the server. The GPS modem gives many parameters as the output.Such as : The latitue,longitude,date,timeStamp,speed(in Km/h),bearing(in radian). All this information is sent to the server in an interval of 15 seconds.

The Client application programme, connects to the server and get the information of the trains. The location of the client is read using the location services provided by Android. Afterwards, he is notified if any train is closer than 250m from him. The phone starts vibrating and vibrates till he is out of the hazardous radius of 250m. The application runs in background once started.






Block Diagram




                                                                       pin diagram

                                                                                                                                               fig.1 Block Diagram






Algorithm

HW logic

H/W part

PHP code to receive the data sent from pi works with following logic -

S/W part1

PHP code to show the stored in database works with following logic -

S/W part1

Android code to show the train locations and alerting works with following logic -

S/W part1




Detailed Pin Diagram




                                                                       pin diagram

                                                                                                                             fig.2 Pin Diagram(sim 808 GSM GPS)





                                                                       pin diagram

                                                                                                                           fig.3 Pin Diagram for Arduino Mega






Problems Faced


  1. The most difficult problem we had to solve is to parse the data received through the GPS module. At first the latitude and longitude readings consisted of 2 decimal points. For example : the latitude of ECE building was given as 23.72 by Pi. The actual latitude is 23.725183. As we only got data upto 2 decimal places, the 4 more digits were padded by 0 to give it a location far away from actual location. The problem was solved by changing the default precision from 2 to 15 decimal places. The sensor value readings were accurate afterwards.

  2. The Pi module was getting very warm. Because it was sensing GPS data and using WiFi module to upload that data to the server in a loop. This overheating problem was solved by placing the pi over a heat sink.

  3. Power source management was a problem as there was a thread in Pi that would upload the data to server each 15 seconds after getting updated geo data. We needed a huge amount of power. If we had used adapter for power source, it would not be beneficial. So we used powerbank of 20000mAh.

  4. The GPS sensor value would not give appropriate readings unless kept under the sky. It would give default 200.1 both for latitude and longitude. An extension wire of length 10 feet was used to make sure the sim808 was placed under sky.

  5. Android client program had to get user's current location. It also had to update user's current location each 10 seconds. We used Fused Location Provider API to get updates about a device location. It gives the most accurate location.We Intially chose one of the location providers (network or GPS) and request location updates or set up proximity alert. But there were two main challenges we : 1. In case we need to define precise location, we had to switch between network and GPS location providers (as GPS doesn’t work indoors) 2. Proximity alerts were used to notify a user about proximity to a location, and this took its toll on the battery life.

  6. We intially used ACCESS_COARSE_LOCATION permission in AndroidManifest because it gives permission for using NETWORK_PROVIDER only for determining the position. But The Coarse location provides less accurate locations. So, we switched to ACCESS_FINE_LOCATION permission. The Fine location provides better and accurate locations. It is robust as it gives permission for using both GPS_PROVIDER and NETWORK_PROVIDER or GPS_PROVIDER only for determining the position.

  7. We faced problems with the Server. We registering domain at openshift.redhat.com. To our utter surprise the domain became idle after 7 days. By that time we already configured our databases and started developing the client programme. We then registered a new domain in cpanel.com.






Group Members Information


Section B1: Group 6






Course Teachers


  1. Md. Shariful Islam Bhuyan

  2. Md. Iftekharul Islam Sakib

  3. Ishtiyaque Ahmed





Back to top