This Instructable shows how to build a car safety system which restrains people from drunk driving and immediately requests an Uber by providing them your accurate GPS location. This project was a part of a workshop conducted by BOLT IoT at IIT Guwahati sponsored by Techniche.
In this guide the objective is to achieve an epitome of IoT inspired setup; that is to connect your car itself to the internet to check if the driver is drunk by using an Alcohol Detector and if found positive the system first stops the car engine and uses internet to find your GPS location and requests for a cab to any preferred cab service with your exact GPS location.
Step 1: Things You'll Need.
1. BOLT Platform Unit (WiFi Enabled)
2. Alcohol Detector
3. A mobile for WiFi hotspot with Internet Data
4. Some Wires, Leds
The necessary building blocks/modules of this setup is broken down into the following:
1. Connecting the BOLT unit to your Mobile WiFi Hotspot using a memory card in which the WiFi Username and its Password is stored.
2. Finding your BOLT Unit's IP Address using any IP scanner application.
3. Connecting the Alcohol Detector to your BOLT Unit.
4. Programming the BOLT Unit using HTML.
5. Using IFTTT to send an Email on trigger.
Step 2: Connecting the BOLT Unit to Your Mobile WiFi Hotspot
* There are many ways to do this. The following method is how we approached.
1. Connect your Bolt's Micro SD card to your computer. In the setting file, set the ssid to your mobile hotspot name and also set the password field to your hotspots password.
2. Re insert the micro sd card in the bolt unit.
3. Switch on your mobile hotspot enabling mobile data. Wait for the bolt unit to connect to your hotspot. It is indicated by a constant blue led.
Step 3: Finding Your BOLT Unit's IP Address Using Any IP Scanner Application
1. Download any Ipscanner application. We used Advanced IP Scanner.
2. First press the IP button on the top.
3. Now press the scan button.
4. In the search results, look for the ip address of your bolt unit.
5. You may copy it somewhere for future use.
6. Enter your bolt unit's ip address on your web browser.
7. If everything is in working order, the default index page should show.
Step 4: Connecting the Alcohol Detector to Your BOLT Unit.
1) Connect the ground pin of the MQ-3 sensor to the ground of bolt unit.
2) Connect the Vcc pin of MQ-3 sensor to 5v pin on bolt unit.
3)Connect the output pin of MQ-3 sensor to the pin where the input is desired.Keep in mind that the pin must be capable of taking analog input E.g. pin A0.
4) You may write a simple code to make sure your sensor is working properly. At normal conditions, the sensor should read value around 30ppm.
Step 5: Programming the BOLT Unit Using HTML.
The HTML code we used for our project has been attached.
Step 6: Using IFTTT to Send an Email on Trigger.
Go to home page of IFTTT site and click on channels.
Now search for maker in search box. And after getting search results Click on Maker .
After clicking on maker you will redirected to maker channel page. Click on triggers as incircled in image below.
Now click on Create a new Receipe for making a receipe.
Click on this for choosing input for the recipe.
Now search for maker and after getting search results click on Maker icon.
Click on connect button as incircled in image.
After that click on Continue to next step.
Here you will click on Choose a trigger.
Now here we will enter a event name and note down this event name.
After typing event name click on Create Trigger Now, your own trigger event is created.
The next step is choose action to be performed.
Click on that Search for gmail. We chose gmail.
You can choose any event like twitter,slack,youtube etc.
Now click on connect and give them authorization to access your gmail account.
Here you choose a action After choosing action click on Create Action.
Click on Create Recipe . Now you recipe is ready. Now you will be redirected to this Recipe page.
Now again click on channel and search for maker channel.
Click on maker icon .
The next step is to click on "How to Trigger Events" .
Now you can see the key for your trigger event.
Now type your event name and copy that whole line and save it somewhere.
Now click on Test it as I encircled in image .
Now you trigger is ready. Your code must contain the functionality of triggering this event and also to send the geo-location via the mail.
* Image Courtesy: BOLT IoT Workshop