element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
IoT on Wheels Design Challenge
  • Challenges & Projects
  • Design Challenges
  • IoT on Wheels Design Challenge
  • More
  • Cancel
IoT on Wheels Design Challenge
Blog Traffic Predictor #12 - Predicting the best route to avoid traffic [Part 2 of 2]
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dixonselvan
  • Date Created: 12 Nov 2017 3:01 PM Date Created
  • Views 557 views
  • Likes 1 like
  • Comments 2 comments
  • iot on wheels design challenge
  • iot on wheels
  • arduino_projects
  • trafficpredictor
Related
Recommended

Traffic Predictor #12 - Predicting the best route to avoid traffic [Part 2 of 2]

dixonselvan
dixonselvan
12 Nov 2017

Week 10 - Nov 6 - 12

 

     This will be last week in the design phase of the IoT on Wheels Design Challenge and for my trafficpredictor project. This blog will be a walkthrough of the completed module 1. Check out Part 1 of this blog - Traffic Predictor #8 - Predicting the best route to avoid traffic [Part 1 of 2] for a better understanding of the progress.

Module 1 - Traffic prediction with machine learning

To be covered in this blog,

image Completed App (Android)

image Functionality explained

image Database Schema

image Machine Learning model

 

Completed App (Android) & Functionality explained

     I have already given an insight of how the trafficpredictor mobile app looks like in

    • Traffic Predictor #7 - Into the traffic [Part 2 of 2]
    • The login and registration page in Traffic Predictor #8 - Predicting the best route to avoid traffic [Part 1 of 2]

     In this blog, I will explain the completed app in detail with the functionality of the traffic predictor project followed by. The various screens or activities (if I were to say the Android way) are categorized as follows:

 

  • Home

         This is the page where the user lands once the user successfully logs in. This page contains details about the user and the last trip user has taken to. It also has buttons to redirect a user to Maps and Auto Pilot Screens.

          image

  • Maps

        This is the main interaction screen related to the trafficpredictor project. The first screenshot in the gallery below is the main Maps screen. It has almost all GMaps Option using GMaps API.

      1. We can locate our current location using LOCATE ME button.
      2. We can Search addresses in both From and To text box. Also, we can mark the same on the MAP shown below all the buttons. This is used along with the PREDICT button. The From and To GPS latitude and longitude locations marked will be queried to the database. This will return a match from the list of available traffic free predicted data which is machine learned. [Refer the second screenshot in the gallery below, for an example of the predicted route marked in green].
      3. REGISTER button will provide the user's Journey ID using this API - https://traffic-predictor.000webhostapp.com/JourneyId.php. Hit this and you will receive a message like {"success":true,"journey_id":15} in JSON format.
      4. START and STOP buttons are used to mark the start and end of user's journey. The data (GPS latitude and longitude of current location) collected from when the user starts the journey will be stored along with the generated Journey ID. This is to keep the data as one set of entry.

 

{gallery} Maps Screen

image

Image: Maps Screen

image

Image: Predicted Map Route from my Journeys!

 

  • Auto Pilot

          For details on the Auto-Pilot functionality check out my blogs - Traffic Predictor #10 - Evading traffic like a Bat and Traffic Predictor #11 - Module 2 and 3 [Completed] . The GET SPEED button fetches the best speed for your current location. The GO LIVE displays your current speed and next to it a text (Move) which describes whether you have traffic or not from the Hardware communicating through Bluetooth. Also, we have a toast (below GO LIVE button) displaying the Bluetooth's MAC address.

image

  • About

          This screen displays what the application is all about. This gets data from the webpage - https://traffic-predictor.000webhostapp.com/About.

image

  • Connect Device

           This is used to connect the hardware through Bluetooth. We have buttons to turn ON and OFF the Bluetooth. Also, LOAD DEVICE LIST to display the list of paired devices.

image

 

Database Schema

      The database for the trafficpredictor project has the below tables

          1. User - To store the user profile data.

          2. gpsData - To store the GPS Co-ordinates when the user sets out for a journey.

          3. machineLearn - To store a formatted version of gpsData with one row for a full journey.

          4. predictedData - To store the best route with less traffic_count and less duration.

          5. predictedData_Arc - To act as a backup of predictedData storing the records whenever they are inserted, updated or deleted from predictedData.

image

 

Machine Learning model

     Below is the machine learning model for my trafficpredictor project, I managed to model my thoughts and give it below. It is self-explanatory, I believe. I designed the below on Gliffy.

     image

 

 

Progress made so far,

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||   90%

{tabbedtable} Tab LabelTab Content
Entry & Introduction

IoT on Wheels Design Challenge - Traffic predictor and auto pilot mode

Traffic Predictor #1 - The Official Announcement

PlanTraffic Predictor #3 - The Plan
Initial Setup

Traffic Predictor #2 - Quest for the Code Editor

Traffic Predictor #4 - Finally, the kit arrives

Module 1

Traffic Predictor #5 - Machine Learning and Building a case for the kit

Traffic Predictor #6 - Into the traffic [Part 1 of 2]

Traffic Predictor #7 - Into the traffic [Part 2 of 2]

Traffic Predictor #8 - Predicting the best route to avoid traffic [Part 1 of 2]

Module 2 & 3

Traffic Predictor #10 - Evading traffic like a Bat

Traffic Predictor #11 - Module 2 and 3 [Completed]

IntegrationYet to Begin
Revisions and Hardware, Software ListTraffic Predictor #9 - Revisions and Hardware, Software list

image

  • Sign in to reply

Top Comments

  • DAB
    DAB over 7 years ago +1
    Nice update. DAB
  • dixonselvan
    dixonselvan over 7 years ago in reply to DAB

    Thanks DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 7 years ago

    Nice update.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube