Giter Site home page Giter Site logo

hectorta1989 / aws-iot-vehicle-accident-alert-system Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 26 KB

Automatic Vehicle Accident Alert System using AWS IoT

License: GNU General Public License v3.0

JavaScript 30.68% C++ 69.32%
iot lambda-functions aws-lambda aws aws-iot vehicle cloud-computing cloud rapsberrypi

aws-iot-vehicle-accident-alert-system's Introduction

Automatic Vehicle Accident Alert System using AWS IoT

In vehicle accident, An alerting message which contains time and location automatically is sent to emergency agencies for relief the victim.

According to the Top 10 Causes of Death Report by CDC, Road Injuries hit in several country including Thailand that 4 percent of death is a result of the vehicle accident. Frequently, the serious accidents occur at nighttime; in that case, it might be not caught sight of other people then the victim who is unable to call some emergency services by himself don’t get help at the right time. With Automatic Vehicle Accident Alert System, an alerting message which contains accident’s time and location sent automatically by the particular device embedded in a vehicle to emergency and relief agencies. So, they can rush to the accident and help the victim in time.

      I use the amazing AWS IoT along with SNS, DynamoDB and Lambda for this project. AWS IoT enables communication between Internet-connected vehicle-embedded devices and the AWS cloud over MQTT. About alert services, AWS SNS is used for alerting an involved person via E-mail and Real-time Framework handle a real-time messaging task. DynomoDB is used for store accident information such as car number, time, latitude and longitude. Indispensably, AWS Lambda take a role of a manager who invokes the other services.

     Additionally, I would rather make a comparison about system developing using AWS IoT and vice versa. 3 years ago when I was a college student, I developed a simply home automation system using Arduino. It took a long time because I had to set up the Apache web server for communicating with devices via HTTP. Contrariwise, this project is more thoroughly and took a little time for developing. Thus, AWS IoT provide a great environment for “Internet of Things”.

Part 1: Setup Raspberry Pi 2 Step 1: Follow all steps in the following link to setup, connect and flash the image for Raspberry Pi 2.

https://www.raspberrypi.org/help/noobs-setup/

(Cr. Raspberrypi.org)

Step 2: Download and install WiringPi

http://wiringpi.com/download-and-install/

(Cr. WiringPi)

Step 3: Set up AWS IoT C SDK

http://docs.aws.amazon.com/iot/latest/developerguide/iot-device-sdk-c.html

(Cr. Amazon)

Part 2: Create AWS Environment Step 1: Setup the AWS IoT

Step 1.1: Login to the Amazon AWS Console. Then, select AWS IoT service. image

Step 1.2: Create a thing. Type a thing name and its attributes. image

Step 1.3: Create a certificate. Then, download all the key & certificate files. image

Step 1.4: Create a policy. Type a policy name and add a policy statement. image

Step 1.5: Activate a certificate. Then, attach a policy and a thing to the certificate. image

Step 1.6: Create a rule. (After Complete Step 5) image

Step 2: Setup the AWS DynamoDB

Step 2.1: Login to the Amazon AWS Console. Then, select AWS DynamoDB service. image

Step 2.2: Select Create table. Type Table name and Primary key. image

Step 2.3: Select Manage Stream. Choose New and old images Type. image

Step 3: Setup the AWS SNS

Step 3.1: Login to the Amazon AWS Console. Then, select AWS SNS service. image

Step 3.2: Select Create Topic. Type Topic name and Display name. image

Step 3.3: Create a topic’s subscription. Then, confirm it by follow the link in your E-mail. image

Step 4: Setup IAM Roles

Step 4.1: Login to the Amazon AWS Console. Then, select AWS IAM service. image

Step 4.2: Create New Users. Enter a user name. Download Credentials. image

Step 4.3: Select Permission. Attach Policy. image

Step 5: Create the Lambda Function

Step 5.1: Login to the Amazon AWS Console. Then, select AWS Lambda service.

image

Step 5.2: Select create a Lambda function. Then, configure function. (Source file’s in the code section) image

Step 5.3: Add Event source. image

Step 5.4: Configure following Input test event. Test Lambda function. image

Step 5.5: It is work fine.

image

image

Now, AWS environment is completely ready for the system. Next, we will set up Real-time Framework.

Part 3: Setup Real-time Framework Step 1: Register the Real-time Framework account from URL: https://realtime.co/ by using Facebook or Google Plus account. image

Step 2: Add Subscription. Select Realtime Cloud Messaging. Type Subscription name. image

Step 3: Note Application Key and Private Key (Replace it instead of my keys in Lambda Code) image

Step 4: Open Real-time console. Connect and Subscribe to “aws-iot” channel. Then test again from Lambda function. image

Part 4: Build and run the Thing’s Agent Step 1: Download source file and make it on Raspberry Pi 2 (Source file’s in the code section)

Step 2: View the output on the Monitor image

Step 3: Verify that car number change from aa000 to wc4444 image

Overall back-end system is now completely created. Then, we will go into assembling the prototype car.

Part 5: Assemble the prototype car

Step 1: Collecting the right components image

Step 2: Connect all of the components image

Part 6: Test System After I rush the prototype car with the wall, I have received following Alerting E-mail. image

Part 7: The Improvement for real vehicle In order to assembly with real vehicle, this system need connecting with some crash sensors like front impact sensors and receiving a crashing signal from the sensors before invoke overall system function. image

Schematics

image

Hardware Schematic

image

aws-iot-vehicle-accident-alert-system's People

Contributors

hectorta1989 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.