SafetyFirst

by Guy14 in Circuits > Arduino

299 Views, 1 Favorites, 0 Comments

SafetyFirst

4.jpg

Introduction

This project was made by two students of The Interdisciplinary Center in Herzliya, Israel, as a final IoT course project.

The project is designed for people who share their car with a new driver, and afraid for the car's safety (and for the person driving it - OBVIOUSLY ;) ), very much like myself - I share my car with my younger brother).

This is a step by step guide to building the ultimate safety system and protecting your loved ones. At the end of this guide you'll have a system that:

1. Makes sure the driver didn't consume alcohol before driving.

2. Makes sure that the level of noise in the car (either music or by people) is at a safe height.

3. Alerts if the driver is having an emergency.

- If either 1 or 2 isn't met, or the driver clicks on the "panic button" (3), an email with the car's location is sent to the contact chosen.

We connected our project to the USB port of my car - as a power source. If you don't have a USB port in your car, sell your car and buy a new one (or connect the project to a power-bank).

The safety features of the project are just the tip of the iceberg. You are more than welcome (and even highly encouraged), to be super creative and add new features to your own project.

Supplies

1 x ESP8266 Board (we used Lolin Wemos D1 mini)

1 x Micro-USB Cable

1 x "Push Button"

1 x Resistor

1 x Breadboard

1 x MQ-3 Sensor

1 x CZN-15E sensor

12 x Jumper Cables (we recommend to use as many male to female cables as possible, connected to each other in order create extensions)

Software

image-blog-future-software-development.png

Arduino:

Install Arduino IDE here

Install the following Driver here

Adafruit IO:

Sign up to Adafruit IO here

Blynk:

Download the blynk app to your smartphone and create your account in it

Adafruit IO

WhatsApp Image 2020-05-04 at 21.09.24.jpeg

Setting up - Adafruit IO

  1. In the Adafruit IO website, go to "Feeds" tab and create 2 new feeds - "emergency" & "location".
  2. Go to the "Dashboards" -> open the "Actions" menu -> create a new dashboard.
  3. Name the new dashboard, adding a description is optional.
  4. Select "Create" -> click the new link.
  5. Notice in your newly created dashboard the 7 small square buttons.
  6. Press the yellow key button.
  7. A pop-up window will open.
  8. Save the string you see in the "Active Key" - we'll need it.
  9. Select the "+" button.
  10. Add an "Indicator" block.
  11. Select the "emergency" feed.
  12. Continue.
  13. Type in a title.
  14. In the "Conditions" menu choose "=".
  15. Set the value below it to "1".
  16. Select "Create Block".
  17. Click the blue "+" button.
  18. Add a "Map" block.
  19. Choose the "location" feed.
  20. Continue.
  21. Type in a Title.
  22. Choose 24 hours.
  23. Set type of map to "Satellite Imagery".
  24. Select "Create Block".
  25. Select the green gear button.
  26. Click "Save"

Blynk

WhatsApp Image 2020-05-04 at 21.10.00.jpeg

Setting up - Blynk

  1. Go to the Blynk app.
  2. Create a new project.
  3. Save the authentication key that is sent to your email.
  4. Click the small (+) button.
  5. Add the following widgets: Email widget & GPS Stream.
  6. Set the GPS Stream to virtual pin V0.
  7. Make sure that the email address in the Email widget is correct.
  8. Change the "Content Type" field to "text/plain".

The Circuit

WhatsApp Image 2020-05-04 at 20.02.04.jpeg
WhatsApp Image 2020-04-30 at 18.14.08.jpeg

Lets connect (!) :

ESP8266:

  • 5V -> +
  • G -> -

MQ-3 (Alcohol censor)

  • A0 -> A0 (of the ESP)
  • GND -> -
  • VCC -> +

CZN-15E

  • G -> -
  • + -> + (of the breadboard)
  • D0 -> D3 (of the ESP)

"Push Button"

  • First Leg -> D4
  • Second Leg -> -

CODE

software.jpg

The necessary code is attached :)

1. Open the code in Arduino IDE.

2. Check your board configuration - make sure you're on the right one.

3. Complete the missing variables in the code:

  • #define EMAIL "your email"
  • char ssid[] = "your Wifi network name"
  • char pass[] = "your Wifi network password"
  • char auth[] = "your Blynk authorization code"
  • #define AIO_USERNAME "AdafruitIO username"
  • #define AIO_KEY "AdafruitIO key"

Downloads

Car Setup

WhatsApp Image 2020-05-04 at 20.59.57 (1).jpeg
WhatsApp Image 2020-05-04 at 20.59.57.jpeg
WhatsApp Image 2020-05-04 at 20.59.55.jpeg

Setting the system up in your car

Our setup recommendation:

  • Place the alcohol censor close to the steering wheel so it can cense alcohol levels from the hand (It often stays on the drinker's hands)
  • Place the microphone near the car's speakers (high level of noise is probably caused by loud music)
  • Place the breadboard and the click button close to the driver - at a reachable position (in case of an emergency the driver should press the button easily)

DRIVE SAFELY