Background and Introduction
Losses due to drinking and driving is one of the bad problem the society have been facing. Also if a person got drunk he/she can't promise for staying away from driving.
I have built a system which aims to monitor and thereby to control the "Drinking and Driving" cases which is being commonly encountered in many traffics these days. The system mainly consists of LinkIt ONE from media tech, an alcohol sensor and a relay for discontinuing vehicle's ignition wire.
Whenever a drunk driver enters into the vehicle, ignition of engine is disabled and a beeper starts beeping so as to alert the passengers, the surroundings and even the traffic police nearby.
The monitoring is even more tightened when the instantaneous time and location of the place is sent to the traffic police station as soon as this case is confronted.
System Flow
Initially the GPS will be initialized, and then GPS and sensor's reading will be updated in each loop.
There are many options for setting up sensor in the vehicle. It can be kept on drier's side of dash board or on the steering wheel where driver seats face-to-face so that the contamination of air can be directed towards the senor with minimum loss.
Use of sensor. Why and How ?
When a drunk person enters into vehicle, air inside the vehicle gets mixed up with alcohol content coming out from driver's mouth. Since sensor is facing main source of alcohol content, alcohol level proportional voltage, raises at the sensor's output which is being continuously monitored. There will be change in the sensor reading with different blood alcohol level (BAL), which makes ease in finding approximate amount of alcohol the driver has consumed. In the project, though BAL is not calculated and modeled but the drunker is categorized with level as : little drunk, drunk or severely drunk according to sensor's reading.
Taking action
When the sensor value goes higher than threshold. the ignition wire will immediately be discontinued and beeper will be triggered. Watch the video once again for clear understanding. You can see both the LEDs started glowing indicating that Ignition is disabled and beeper started. Mean while GPRS will be initialized. HTTP request will be made to the googlemaps API with the latest updated GPS latitude and longitude readings.
In return we get a large JSON giving complete information of the given GPS location. Which will be parsed using ArduinoJson to get the formatted address.
We already have sensor reading indicating alcohol level and now we've obtained address of the vehicle where it is located. All the information is now collected. An SMS content will be created with these information and will be sent to the number which is defined in the code. Oh yes, the number can be some one's wife/husband's number or it can be number of police station. This way an automobile safety is maintained and the instantaneous accumulated data will be sent to the police for rapid response to drink and drive issues. This way the project implies human welfare with smart activities which can be a part of a smart city.
GPS, GPRS and reverse geo-coding. Why and How ?
Use of GPS is made for obtaining the exact geographic location and the time. The obtained location will be inserted with google API link for querying address like Hospital Rd, Patan, Nepal, from the geographic location like latitude: 27.668453 and longitude: 85.320082. Reverse geo-coding is done for obtaining human understandable address. To access the Google Maps Geocoding API over HTTP, google have provided an URL as :
http://maps.googleapis.com/maps/api/geocode/output?parameters
This is just a test format URL and accepts certain limited requests only, it is recommended to grant a key for using it.
Where outputs may either of the following values:
json
(recommended) indicates output in JavaScript Object Notation (JSON)
xml
indicates output as XML
For reverse Geocoding output?parameters
is replaced with GPS locations and the URL is formed as:
http://maps.googleapis.com/maps/api/geocode/json?latlng=27.668453,85.320082
An HTTP request is made using GPRS data service. For making the request and separating body from other response text arduino HTTP client library is used. The JSON output is temporarily stored in a String and later parsed using ArduinoJson.
SMS and Contents
With all collected information, a message content is created and sent to a number included in the code.
Comments