Professional Documents
Culture Documents
2018 Spring 195B Group 1 Project Report UniRide
2018 Spring 195B Group 1 Project Report UniRide
A Project Report
Presented To
The Faculty of the Computer Engineering Department
by
Timothy Davis
Marta Malapitan
Akshat Sharma
Maninderjit Singh
May 2017
1
Copyright © 2018
Timothy Davis
Marta Malapitan
Akshat Sharma
Maninderjit Singh
ALL RIGHTS RESERVED
2
______________________________________________
Kaikai Liu, Project Advisor
______________________________________________
Professor Rod Fatoohi, Instructor
______________________________________________
Dr. Xiao Su, Computer Engineering Department Chair
3
Abstract
UniRide Carpool Application and Parking System
By Timothy Davis, Marta Malapitan, Akshat Sharma, Maninderjit Singh
As a university in an urban downtown area, San Jose State University faces a seemingly
unsolvable issue of traffic congested streets nearby and within the campus parking lots. The
University’s website states there is an estimated number of 40,000 students, faculty, and staff
members; however, there are a total of only 6,543 parking spaces in the University’s parking
garages to accommodate everyone.
Acknowledgements
We would like to thank our Senior Project Advisor for providing us with direction and technical
support, and San Jose State University for giving us the opportunity to develop a system that can
make a difference.
5
Table of Contents
Chapter 1. Introduction
1.1 Project Goals and Objectives
1.2 Problem and Motivation
1.3 Project Application and Impact
1.4 Project Results and Deliverables
1.5 Project Report Structure
List of Figures
Figure Title Page(s)
List of Tables
Table Title Page(s)
Chapter 1. Introduction
1.1 P
roject Goals and Objectives
by Marta Malapitan
The primary goal of this project was to create a system that makes carpooling more
convenient, secure, and cost-efficient for university students. We also wanted to create such a
system that provides incentives to those who carpool. Because limited parking spaces are part of
the fundamental problem, we decided to focus our incentive plan on providing dedicated parking
spaces in campus or organization-owned garages that could be reserved by participating in a
carpool. To achieve these goals, we created two separate components that together creates our
system known as “UniRide.”
The two components of UniRide are an Android mobile application and a sensor-based
parking system. We developed a mobile application that allows users to easily create and join
carpools with their peers. It is user-friendly, has automatic matching abilities, and transparent
location reporting. In addition to the mobile application, we created a parking system that is fully
integrated with our application. This parking system is sensor-based and is installed in the
University’s parking garage to monitor and verify carpools. It utilizes IoT technologies and
sensors to detect if a car is parked in a specific space. It will then communicate with the UniRide
application to verify if the parked car belongs to a valid UniRide carpooler.
1.2 P
roblem and Motivation
by Akshat Sharma
Traffic and air pollution are a couple major concerns in populated urban areas. San Jose
is no exception in this matter especially since the city has a State University in the very heart of
its downtown. 32,773 students are currently enrolled in San Jose State University. Out of which,
36.11% drive alone to school. This brings a swarm of approximately 11,000 vehicles in and out
of the city. Such a vast number of vehicles can result in major traffic problems.
Apart from traffic, parking is another issue. San Jose State’s parking structures hold
about 4,000 parking spots which are not nearly enough for a weekday traffic. In such conditions,
an apt solution would be to reduce the number of cars on the road which can be effectively
12
achieved by an efficient carpooling system. Those who commute alone in separate cars can
travel together in fewer cars, and can decrease the traffic exponentially in an idle scenario. Doing
this will not only decrease traffic congestion and parking issues, but will also act as a significant
step towards an environmental-friendly society.
1.3 P
roject Application and Impact
by Marta Malapitan
With our system, we strived to get the support and attention of areas that lack alternative
transportation solutions, and universities that have an exceedingly high amount of traffic-related
issues around their campus. We believe to have the ability to impact the following areas:
Society Impact:
Our project encourages unification within college communities as they participate in a safe and
convenient carpool system. Participating students also take part in maintaining the environment.
By choosing to carpool together, rather than taking their own cars to the same destination,
students are reducing their carbon dioxide emissions.
Academic Impact:
The mobile application component of our project utilizes a combination of existing APIs, and
research findings to build an optimized carpool application. Meanwhile, the parking system
component uses state-of-the-art IoT technologies that will contribute to the few existing parking
solutions. Every aspect of our work has been documented for academic purposes.
Industry Impact:
The future success of UniRide will have a major impact in the transportation industry. It has the
capabilities to compete with other transportation applications like Uber and Lyft, and because it’s
designed to service a specific group of commuters in need, other transportation solutions will be
highly affected–reducing the amount of their users.
1.4 P
roject Results and Deliverables
As a whole, our project result includes a fully-functional Android mobile application that
is integrated with an accurate real-time sensing parking system.
13
Besides the convenience it brings, our mobile application has the following features:
● Point system for ride-and-drive rotation
● Automated matchmaking for our carpool service
● Transparent location reporting
● Integration with University’s system to monitor carpool spaces
Additionally, our application has the ability to service a minimum of 5,000 participants as
we strive to continuously increase our user count. UniRide’s parking system utilizes IoT
technologies and sensors for parking validation and carpool verification. All data collected by the
sensors are visible through the correlating application component of our project.
Application Deliverables:
The user interfaces displayed in Figure 1 were our initial desired designs. We wanted to
ensure they are extremely user-friendly— appealing and easy to use.
send the data to UniRide to allow that information to be visible to UniRide users. Additionally,
the parking system has another purpose: carpool verification. When a vehicle arrives at a parking
space, the parking system is able to detect that movement and will communicate with the
UniRide application. The UniRide application will then interact with the user to verify the
vehicle that has arrived at the space is in fact a UniRide carpool and not an unauthorized
commuter.
In this document, we will be discussing every aspect of our project. This includes
chapters about information obtained from research done, project requirements, system design,
and system implementation. The following list includes a number of details that will be
discussed in each chapter of this document.
I. Chapter 2 discusses background knowledge and technologies, and related work done for
the project. It will discuss the purpose of the components that were used to create our
system. This includes the following components: MVC, Java, XML, Android Studio,
Google Firebase, Google Maps API, Ultrasonic Sensors, Arduino UNO, Raspberry Pi 3,
Avnet Cellular Shield, Amazon AWS. It will also include our Literature Search in which
we describe the traffic and parking issues we are trying to solve, and the solution we
developed to solve those issues. Lastly, a state-of-the-art technologies summary discusses
the existing transportation solutions we have considered, as well as the the smart-parking
system that helped us improve our system design. This section includes information
about 511’s ridematch service, Scoop, UberPOOL, Lyft Line, Westfield Valley Fair Mall
smart-parking system
II. Chapter 3 consists of details of our project requirements. Here, we have diagrams and
tables that describe domain and business requirements, system functional and
nonfunctional requirements, context and interface requirements, and technology and
resource requirements.
III. Chapter 4 documents our entire UniRide system design. It contains architecture designs
of our mobile application as well as the parking system. It also provides extensive detail
of our interface design, logic design, database design, and parking system design. In
addition, the final section discusses our design constraints, problems, trade-offs and
solutions.
15
IV. Chapter 5 explains our system implementation. The sections includes an overview of our
implementation, and what techniques and methods we used to implement our developed
solution to traffic and parking issues. It also describes the challenges we had during our
project and the learning outcome from this project.
16
To meet our primary goal of developing a carpooling system that is secure, convenient,
and cost-efficient for students, we designed it with inexpensive technologies that integrate
harmoniously together. We were able to learn more about technologies that we learned about in
previous courses as well as recent ones that improved our design.
Our Android mobile application was developed with a number of technologies that each
member of this project is now fairly familiar with. The application was created with Android
Studio, and was designed with Android’s programming architecture that is similar to a
Model-View-Controller architecture. It was also created with Java, therefore, a strong knowledge
in Java programming structures like anonymous inner class, various design patterns like Adapter,
and object-oriented design concepts were required to develop a proper Android application.
The back-end of the software uses Google’s Firebase Realtime Database. It uses a
semi-structured, non-relational database design, and requires no SQL code. In addition, Google
provides an online console for Firebase that allows developers to view and control their stored
data. The database stores all core model components of the system such as user information,
drive offer and ride request posts, and carpool data. Additionally, the front-end of the application
uses Android layouts with XML to design and organize the view components. It was essential for
each member to understand Android’s material design and design standards to create a
professional and easy-to-learn user interface. Furthermore, we have incorporated a few APIs for
Google Maps and Android Firebase.
In addition, our parking system component uses affordable hardware materials that
enables smooth communication and interaction with our application. The parking system uses an
ultrasonic sensor, Arduino, Raspberry Pi, Avnet Cellular Shield and Amazon AWS. Knowledge
in how each can be used and integrated together is significant to create the parking system.
Monitoring a parking space is achieved by using the ultrasonic sensor. We used an Arduino Uno
and Raspberry Pi 3 Model B together for data logic and analysis. The Avnet Cellular Shield
serves as our gateway to the internet, and Amazon AWS connects to the Raspberry Pi to store
and send data to our application.
17
With the help of recent courses we have taken in our college years, we learned the fundamentals
of a few core technologies used in our system. A number of our undergraduate courses such as
Introduction to Java Programming, Data Structures and Object-Oriented Design allowed us to gain more
skills and knowledge in Java that are required to develop our Android application. We also become
familiar with Android mobile development after taking Wireless Mobile Development, and learned how
to effectively work with groups from Software Engineering courses. Furthermore, the most recent course
we have taken to strengthen our project idea was a course on IoT. In this course, we learned about
smart-parking, sensors, and Amazon AWS that are used for our parking system component.
The United States is the 4th largest country in the world (List of Countries by Area), and
along with that the country ranks at 176th position in population density, with 32.45 people per
square kilometer (Population Density - Country Comparison). Such a low average population
density over such a vast area brings an essential market for cars. 83 million cars were sold in
2013, which included 15.6 million in the U.S alone (Global New Car Sales in 2013 Top 83
Million). That means on an average, 42,740 cars were sold in a day in the country. The
commercialization of personal vehicles is so extensive that they have become a significant part
of an average American’s life. So much so that on an average, each one of us spends 42 hours in
traffic in a year (INRIX Global Traffic Scorecard). Things get worse if we focus on the West
Coast, specifically California. Los Angeles has the most congested traffic in the world, where
according to research each driver spends an average of 104.1 hours in traffic annually, with
number four being San Francisco, another Californian city (INRIX Global Traffic Scorecard).
Vehicular usage of such scale brings vast amount of environmental problems with it. In 2016,
30.27 million short tons of carbon monoxide were emitted by the on-road vehicles of the country
alone (Estimated National Emission of Carbon Monoxide). This emission has catastrophic effects
since on an average, carbon monoxide causes 430 deaths per year (Average Annual Number of
Deaths and Death Rates from Unintentional, Non-Fire Related Carbon Monoxide Poisoning).
Apart from that, vehicles also emit other harmful gases such as nitrogen oxide. Over six million
short tons of nitrogen oxide were produced by vehicles in America in 2016 (Estimated National
Emissions of Nitrogen Oxides). Such a vast amount of nitrogen oxide leads to major
environmental concerns regarding climate change that will eventually lead to grave issues such
as rising in sea levels, which has already increased by 860% since 2005 (Climate Change:
Global Sea Level).
18
In addition to traffic and pollution, parking is another major issue as it’s also another
cause of traffic and falls under an environmental concern. According to SanJoseCa.gov, the total
number of cars that go through the streets of Downtown San Jose is close to 10,000 a day.
Downtown San Jose “operates and maintains eight parking garages and nine surface lots with a
combined total of approximately 7,500 public parking spaces” (Parking Garages & Lots). There
are also about 50 private parking lots accommodating thousands of employees who are employed
at downtown businesses, adding another few thousands to existing parking spaces in the area
(Lots and Garages). To acquire as much parking as possible, garages are built floors beneath
skyscrapers and other buildings. However, there are also dedicated buildings for garages only, as
well as surface lots. The space that these garages and surface occupy can be used for much better
entities that serves the community, such as public parks and organic gardens.
Understanding the causes of these effects of traffic and parking problems leads us to the
root of the problem we focus on solving: excessive vehicles on the road. There have been
alternative transportation solutions that were put into effect, such as public transportation options
and ride-sharing applications, all of which aim to reduce the number of cars on the street. Each
alternative, however, has flaws of its own that defeats its initial purpose. Public transportation
options lack reliability as their arrival can be delayed. They can also be seen as a bit inconvenient
in terms of time and location of the stations. Safety is usually the biggest concern commuters
have as they ride with strangers on public transportations, as well as the costs for ride-sharing
services.
One of the most effective solutions to solve crowded cities is carpooling. It reduces
traffic and parking issues, as well as help our environment. As people carpool, they are cutting
down the fuel usage from two cars to one. In the article “Estimating the Energy Consumption
Impact of Casual Carpooling,” Paul Minett and John Pearce estimate that “casual carpooling in
San Francisco is conserving in the order of 1.7 to 3.5 million liters of gasoline per year, or
200-400 liters for each participant, much of which comes from the impact on the rest of the
traffic.” With this transportation technique, San Francisco saves over thirty million dollars per
year. Minett and Pearce declared that if it wasn’t for “casual carpooling,” the speed at which cars
arrived at the
Bay Bridge Toll Plaza would reduce from almost 40 km/hr to 27 km/hr. According to Figure 2
and Figure 3 from the article, this would in turn cause the traffic to consume more energy by
thirty-five percent and fifteen percent according Figure 3.
Figure 2: Fuel Consumption vs Speed Figure 3: Energy Consumption vs Speed
smoothly. The students of San Jose State will have to spent less time driving around looking for
parking, thus consuming less energy and producing less waste.
Knowing that the solution is carpooling has still not encouraged a huge increase in
carpooling, so focusing on finding new forms of encouraging more carpooling is also important.
By utilizing smart phone technology, mobile software applications that provide carpooling
solutions can reach an incredibly wide audience. Studies have shown that the more convenient
the carpool solution is for the user, the more likely they will use it (Ridesharing to work: an
attitudinal analysis). This also means that having a convenient user interface is also important.
Knowing the target audience is an important characteristic of a successful carpool
solution as well. Starting with the focus on university students may help to build the user base as
younger people are on average more likely to try carpooling (Household choices of car-use
reduction measures). Using application to manage the setup and suggest carpool matches
between students can increase the success of the program as a compilation of studies have shown
that the “implementation of a partner matching program, such as a searchable database of
potential carpoolers, was found to be effective in promoting carpooling” (What encourages
people to carpool? An evaluation of factors with meta-analysis). Studies have also shown that
carpooling systems implemented within organizations are more likely to succeed (Evaluating
ride-sharing programs). Therefore focusing on organization and university-specific grouping
may lead to a more successful carpool solution.
Today, there are a number of existing carpool solutions and a single successful smart
parking system. Each carpool solution has different yet similar approaches for carpooling.
Majority of these current carpool solutions are applications, but San Jose State University has
also introduced a new transportation solution that participates in carpooling. Additionally, the
smart parking system has been integrated in a highly crowded shopping mall in San Jose, and
works extremely well as a solution to parking issues. This section will briefly discuss the carpool
and parking solutions that we have considered during the phase of designing UniRide.
Many successful carpool solutions are in the form of mobile applications for portability
and mobility among their users. A number of popular mobile applications that specialize in
carpooling are Scoop, UberPOOL, and Lyft Line. These applications have similar features like
matching users with their neighboring coworkers, providing directions to destinations, handling
payment transactions, providing ability for users to choose who they want to ride with, allowing
users to schedule an upcoming trip hours ahead and other useful features like reminder
21
notifications. However, while UberPOOL and Lyft Line is for any commuter, Scoop is currently
only used by large companies which are offering carpool services for their employees. Pricing is
unknown for Scoop as it is not open for the public, but UberPOOL and Lyft does their best to
provide a fixed low-cost price for carpooling. With UberPOOL and Lyft Line, passengers who
are located and have a destination that is near another passenger’s destination will automatically
be assigned to drivers. They also allow passengers and drivers to rate one another, as well as
leave reviews. UberPOOL can be used everywhere, meanwhile, Lyft Line is only available in
certain cities. Scoop, UberPOOL and Lyft Line all share common interest in keeping their users
safe, therefore, it is required for drivers to undergo background checks before being granted the
position. These applications are efficient solutions for commuters who are always on the go,
therefore, we have designed our system to be just as portable and easy to use.
There are other forms of carpool solutions that do not require installing applications into
one’s mobile. One was provided by the transportation and traffic information telephone hotline,
511. They released a free ridematch service for commuters in the Bay Area. Commuters will fill
out an online form with their schedule and the service will match them with other compatible
commuters. The user must then contact the other commuter directly via phone or email and set
up a carpool, discussing payment options and carpool details. Though the process may seem
tedious, it provides incentives for those participate. This service offers a tracking feature that can
be used to redeem various incentives and rewards, such as gift cards or specific employee
rewards. 511’s carpool solution provided us the idea of incentives that allows carpooling to be
more appealing to the community.
In addition to the listed carpool solutions, we have also considered Westfield Valley Fair
Mall’s smart-parking system to develop a stronger design for UniRide. Valley Fair Mall had
recently integrated a smart parking system in their newly constructed parking garages that
utilizes state-of-the-art LED lights, motion sensors and photo-sensors. The LED lights are
installed above each parking space, and turns green if the motion sensor identifies the space as
available or red when it’s taken by a vehicle. Also, the photo sensors assist returning shoppers
with finding their car. The sensors can identify where exactly a shopper’s car is based on the
license plate number they enter into the location kiosk. Inspired by such an innovative system to
tackle parking issues, we decided to incorporate such a system with our carpool service.
22
The process summary diagram in Figure 4 illustrates the process of when our system is
being used by a carpooler. Assuming that the user has already been registered, the user will
interact with the entire system to accomplish arriving safely to their destination while carpooling
with peers, as well as utilizing the parking feature incorporated with our application.
The process diagram of our parking system above displays a breakdown of how it
functions when the system returns an output to our UniRide application that identifies which
parking spaces are available among those that are being monitored by our sensors. It describes
which components within the system are utilized to collect data, analyze data, transfer data to
Amazon AWS and finally, show the available spaces in the application.
24
The process decomposition diagram above displays the components that are related when
a carpool is created. Like Figure 5, the diagram is a breakdown of how the system functions
during a specific event. In this case, when creating a carpool object, it requires the following
components: a single driver, passengers, source and destination locations, date and time, and
status of the carpool (planned, ongoing, complete, cancelled).
Figure 7 above illustrates our three businesses classes: user, carpool and parking. It
identifies the dependent relationships each classes have with one another as well as the attributes
of each class.
The Carpool model and associated controller components are especially important for our
application’s main functionality. The process of the formation and completion of a Carpool is
shown in Figure 8. After a user posts a drive offer post or a ride request post, other users can
respond to the post and join them, creating a planned Carpool object. A Carpool object must
have at least one driver and at least one rider to be considered planned and if at any point these
requirements are not met by the specified departure time, the carpool will be canceled. Once the
26
carpool begins, the driver proceeds to pick up all passengers until there are none in the list of
passengers that have not been picked up. The carpool is considered complete once the final
destination is reached with all passengers picked up.
In order for the system to assign a parking spot to a carpool driver, the system must monitor the
designated UniRide parking spots and know which spots are currently available or occupied by
27
another vehicle. Each designated UniRide parking spot will have a sensor that will send data to
AWS IoT to let our system know when a spot becomes free or taken. As seen in Figure 9, the
sensor system uses the change in distance between the sensor and the potential vehicle in the spot
to determine the availability of the spot. When the sensor is detecting a change in this distance a
vehicle is either entering or leaving the parking spot. Once there is minimal change in distance,
the sensor sends the availability status (Available or Occupied) to AWS IoT. Once the status of
the spot is stored, the application can access AWS IoT to determine if it should schedule a
carpool driver to park in this space. The system also needs to know if a vehicle parks in the spot
that was not assigned to the parking spot. A validation system will check to make sure only valid
carpools assigned to a particular parking spot are parked in the spot. If an invalid vehicle has
parked in the spot, actions need to be taken to ensure that this spot will not be wasted on the
invalid vehicle. The system should send a message to the parking monitor for the parking garage
notifying them that the parking spot is being misused. This could mean that the invalid driver
receives a ticket or other actions are taken to enforce the proper use of the parking spot.
For this application to work with the desired manner we must follow through with the
standard we had set for it during last semester. Table 1 shows most of our functional
requirements.
3. Sign In The registered users must be able to sign into their account
using their registered email address and password.
must be specified.
8. Offer a ride A user must be able to post a drive offer post indicating that
they are willing to be the driver in a carpool. The post must
specify the source and destination locations, the date of the
carpool, and the time the user needs to reach the destination
by.
9. Request a ride A user must be able to post a ride request post indicating
that they want to be a passenger in a carpool. The post must
specify the destination location, the user’s pickup location,
the date of the carpool, and the time the user needs to reach
the destination by.
8. Post belongs to Every post must belong to a single organization. Only other
an organization members of that organization can view posts under that
organization. If a user is a member of multiple
organizations, then the user must be able to choose which
organization the post belongs to when creating a post.
10. Cancel any A user must be able to cancel any multi-step process, such
multi-step as making a post.
process
11. Delete a post A post can be deleted by the user that posted it.
13. Search for posts A member of an organization must be able to search for
posts for that organization. The user must be able to specify
the kind of post (drive offer or ride request), the date of the
carpool, the source and destination locations, and optionally
a time that the user would need to reach the destination by.
14. Automatic post When a user posts a new post, the application should
matchmaking automatically display a list of potential posts or open
carpools that meet the requirements for the user’s post. For
example, if the user posts a ride request and there is a drive
offer that has been posted for the same destination, date, and
time, this drive offer will be shown to the user as a
suggested carpool to join (as long as the trip time of adding
this passenger would not exceed the necessary time for both
the driver and the passenger to reach the destination on
time). [See Chapter 5.2 for more details]
15. View all posts A user should be able to view all posts they have made and
view the details of each post.
16. Join in a carpool Passengers must be able to join a drive offer post to form a
carpool, or join an open carpool (a carpool that still has seats
available). A driver must be able to offer to drive for a
passenger (by responding to the passenger’s ride request
post) to form a new carpool.
17. Carpool A user who has joined a carpool should receive notifications
notifications when the carpool is starting, when the user needs to be
available to be picked up (if the user is a passenger), and if
the carpool is cancelled. A user should also be notified when
new passengers are added to the carpool.
18. View all carpools A user should be able to view all carpools (planned,
ongoing, or past) they have been a part of (either as a driver
or as a passenger). The user should be able to view the
details of the carpool.
19. Display map The application must display a map of the route between the
source and destinations on all post and carpool displays.
the carpool driver has a space to park in. The system must
verify that the driver parked in the assigned parking space.
21. Validate users The application must be able to validate that each passenger
did actually in a carpool was actually pick up and joined the carpool.
carpool The system must be able to verify that all passengers
reached the correct destination.
22. Tutorial There should be a brief tutorial on each page where the user
has been for the first time to familiarize the user with the
content of the page.
23. Feedback Page There should be a page in the app that allows users to send
feed to the developers.
24. Security The user should have a way to report a driver or passenger
they are currently in a carpool with or have been in a
carpool with.
2. Amazon AWS The application will be integrated to Amazon AWS IoT for
IoT checking if the parking garages of a certain organization has
any empty spots.
3. Google Maps The application will be integrated with Google Maps which
Api will allow users to look addresses for sources and
destinations.
4. Free of charge The application should not cost any money to use and
download.
5. Regular Updates The application should receive regular updates ironing out
any defects or add new features.
31
7. Data Usage The should use as little data as possible from the user.
10. Parking check The part of the application that checks for parking
availability availability must come back online within 2 hours of
crashing.
11. Speed of Going from one page to the next must take no longer than
Application 1.5 seconds 99 percent of the time.
1. Android Studio All team members build and test code using Android Studio
version 3.0.
Interface Requirements:
1. Material Design Every application page must follow the standard of Material
Principles.
2. Help There must be a way for the users to get help regarding
features or trouble shooting in the application.
3. Page awareness Users should know which page they are on, meaning there
would be a title on each page.
4. Cancel any A user must be able to cancel any multi-step process, such
multi-step as making a post.
process
2. Android Studio The IDE we will using to work with android applications.
5. Arduino UNO The Arduino will collect data from the sensor.
8. Amazon AWS This part is the link between the parking sensors and the
application.
9. AWS Python This will allow the Raspberry Pi to interface with AWS.
SDK
11. Python Is used to write the script that analysis the data from the
Arduino and sends it to AWS.
13. Google Maps Is what the Android application uses to use Google Maps in
API the application, and allows people to search for addresses.
Figure 10. Android application architecture overview diagram. Shows the general
Model-View-Controller architecture of the UniRide Android mobile application.
The model components store the data that the application stores and accesses. This
includes a database that the team will create and maintain, and will store the main application
data such as data about user information, user posts, organization information, and trip data. Our
team plans on using a Firebase database. The application will also rely heavily on route, traffic,
and location data provided by the Google Maps Application Programming Interface (API).
The view components present the user interface. Android uses a number of predefined
layouts that are written in XML to define how the data and UI components should be displayed.
The controller components are the segments of code that make up most of the logic in the
system and link the data in the model components with the view components. These components
request data from the model components, then determine what data the view components should
be presenting. In an Android application, these components are Activity classes that manipulate
data to perform an action to be displayed to the user and services that perform actions behind the
scenes. Some of these services require access to additional services outside of the application,
such as email services.
Our architecture also shows device components that the controller components utilize.
These components are tied to the user’s physical device, and include location and notification
components. The location is the user’s location given from GPS that the device will provide to
our application. Our application will also provide notifications to be displayed by the mobile
device’s operating system.
36
UniRide connects to a Firebase Realtime Database to store all persisted data. The
structure of the database can be seen in Figure 14. This data includes user information, such as
name and email, university or organization information, such as location and website, and post
information, such as trip date and time. There are three types of posts. Ride requests are posts by
users looking for a carpool. Drive offers are posts by users who are offering to drive passengers
and carpool posts store the driver and all passengers in a carpool.
Since Firebase uses a tree structure to store data, each main model component has its own
branch, with further branches for the unique ID and data (the stored records for the model
component). Each major many-to-many relationship between the model components also has a
branch that connects the model components by their respective ID’s. For example, the User
branch is connected to the Organization branch, as each user can belong to multiple
organizations. Each user can also have multiple posts of each type.
37
The figure above illustrates the design of our application user interfaces. It displays a
clean, professional and appealing user interface for our users to interact with. We chose colors
that are attractive while also keeping the display simple to avoid them being an eyesore. Figure
12 has the following screens: login page, home page, process to request a ride, viewing an
existing carpool, and how the data captured by the sensors would be displayed on the
application. To avoid redundancy, we have only included views of process to request a ride as it
is similar to the process of offering a ride.
Using the figure above as reference, every user input retrieved from the text boxes are
instantly saved into our Firebase database. Data are stored in the proper branches like user
information is saved under the “user” branch in the database, and carpool details are saved under
the “carpool branch.”
39
The Parking System that will be integrated with the mobile application requires multiple
components, as shown in Figure 11. Each parking space that is part of the system will have a
sensor that determines if a vehicle is parked on the parking space. The sensor will provide this
information to the AWS IoT Platform service through the Arduino and Raspberry Pi. The
UniRide mobile application will then take the data from the AWS IoT Platform service and use it
to pair the user will a parking space and validate that the user parked in a space is the designated
user assigned to that parking space.
40
The figure above shows the following components of UniRide’s parking system: Ultrasonic
Sensor, Arduino, Raspberry Pi, and Amazon’s AWS IoT Platform service.
Our Android application makes use of the technologies above to update the status of the
monitored carpool parking spaces within the parking garage. The purpose of this component of
the project is to provide parking assistance for carpoolers to reduce the amount of time spent to
find parking.
Using Figure 15, the following details describe the flow of the prototype from left to right:
1. The ultrasonic sensor will sense if the monitored parking space is available or taken by
detecting if there is an object in a short distance away from the sensor.
2. The ultrasonic sensor will then send the collected data to the Arduino it’s connected to.
3. The Arduino does not store the collected data, therefore, it sends the data to the
connected Raspberry Pi, which analyzes and configures the data received.
41
4. After the data has been analyzed, the selected data will be sent to Amazon’s AWS IoT
Platform as the Raspberry Pi is connected to the Avnet Cellular Shield that provides
access to the internet.
5. The UniRide mobile application will then be connected to the AWS IoT Platform so that
the information collected will be visible to the users in real time.
Figure 13. Simplified UML Class Diagram. Shows the main model classes and their inheritance
and aggregation relationships.
The application architecture will be structured around the main model components shown
in Figure 13. The main model components are:
● User: the model component that represents the user and stores all personal data required
for the user.
● Organization: the model component that represents the organizations and universities
that a user can join. Each post is associated with an organization and only other users
who have also joined this organization can respond to the post.
● Post: the model component that represents the user offering to be a driver or a passenger
for a carpool trip. There are two subclasses: Ride Request, which represent the posts
where the user plans to be a passenger and is looking for a driver to take them to their
42
destination, and Driver Offer, which represent the posts where the user plans to be a
driver and is looking for passengers to join.
● Vehicle: the model component that represents a vehicle owned by a driver, storing data
such as the make, model, year, license plate number, and maximum number of seats of
the vehicle. A user can store a list of vehicles that they own and can choose to use for a
carpool they are driving for. Each carpool only uses one vehicle for the trip.
● Carpool: the model component that represents a planned or ongoing carpool trip with
multiple users. A Carpool object is created once a passenger joins a drive offer post or a
driver joins a ride request post. The carpool object can only have one driver but can have
a list of multiple passengers. Each post can only belong to one Carpool object, if one has
been created.
Each model component will be associated with a number of Android Activity classes and
Fragment classes, as well as a number of Android Layout files. The typical Activity and
Fragment classes associated with each model class include “Detail” Activities (that show the
details of one record of a particular model component), “New” Activities (that are used to create
a new record of a particular model component), and “List” Fragments (that are used to display
different lists and ordering of all records of a particular model component, or just a subset of
them).
The main model components have the following relationships, also shown in Figure 14:
● Each user joins one or more organizations
○ Each organization is joined by many users
● Each user posts zero or many posts
○ Each post is posted by exactly one user
● Each user owns zero or many vehicles
○ Each vehicle is owned by at least one user
● Each post is associated with exactly one organization
○ Each organization has zero or many posts associated with it
● Each post links to zero or one carpool
○ Each carpool links to one or many posts
● Each user can drive in zero or many carpools
○ Each carpool is driven by exactly one user
● Each user can ride in zero or many carpools
○ Each carpool is ridden by one or more users
● Each carpool is driven using exactly one vehicle
○ Each vehicle can be used to drive in zero or many carpools
43
The first algorithm is for the Arduino UNO which is the interface for the Ultrasonic
sensor. Although the file containing the code is much bigger than this, here is the brief
description of what the code primarily is supposed to be doing. The pseudo code in the figure
below is in style of C, because that’s the language that the Arduino uses.
while (true) {
current_dist = get distance from sensor;
if (current_dist is a significant amount bigger than previous_dist){
Output this value;
previous_dist = current_dist;
Wait for 500 milliseconds;
}
Wait for 1.5 milliseconds;
}
There are three different Python program files that are working on the Raspberry Pi. The
first file is briefly explained in the first section of the figure below. The second section is about
the second file that runs parallel to the first file and needs the first file to run properly for it to
work properly. The third and final section is about the third file, which is used by the second
section.
The following equations are being used. The x is the position of the y, and y is the
distance recorded using the sensor and the Arduino:
m−1
J (θ) = 1
2m
∑ (hθi (xi ) − y i )2
i=0
Which is minimised by optimization of theta values (factor weights) using the batch gradient
descent equation:
θj = θj − α δθδ j(θ0 , θ1 , θ2 , ...θj )
j
44
#------First section-----------
#set the connection to the arduino
establish a connection to the Arduino output port through the Raspberry Pi
Output the Arduino's output to a file on Raspberry Pi
#------Second section----------
#The output.txt file mentioned below is the one that the distance data
# from the Arduino is being stored in on the Raspberry Pi
#The state is the state of the parking spot this system will be deployed on
while(true)
Periodically check for new data in the output.txt file
and store it in an array
if (array is not empty)
Calculate linear regression of the distances in the array
Slope = Slope of the line produced in the step above
Set the state according the slope found above
Clear the array
if (slope changed)
Send the appropriate state to AWS
After 9 seconds clear the output.txt file's content
#------Third section-----------
#For AWS
Establish connection with the proper device on AWS
Send the passed in response to AWS
The search algorithm utilizes a variation of weighted squared error function, where the
weights are provided by the user. The algorithm first initializes a list of input where each element
corresponds to source, destination, and theta in the respective order. It also gathers a list of
carpools and posts that are potential candidates for a good match with the given list of inputs.
Each element of this list is a post, and each of these posts have their own source, destination,
and theta. The last variable used is the feature weights, which are also given by the user in terms
of how flexible they are with each of the factors from a scale of 1 to 10. For example, if a user is
very flexible with their timing, they may enter a value of 8. This value will then correspond to a
normalized value of 0.8 and will give extra weight to the time factor. Each factors of the input, as
well as potential posts, are also normalized. The normalization function used is:
45
current value
normalized value = max value
With all of these values acquired, the algorithm calculates the difference between each of
the factors, squares them, and multiplies them with the added weight. Upon a summation of all
of these values, the result acquired would be a variation of weighted squared error that would
determine whether a given post is a good choice or not. The smaller the value, the better the
match. The equation for this algorithm is:
2
︿
S quared Error F unction = ∑ θi (y i − yi )2
i=0
︿
Where θ is the weight, y is the value from the given post, and y is the input value given
by the user searching. The summation goes from 0 to 2 since there are three factors to be added:
source, destination, and time.
items = list of potential carpools or posts
source, destination, theta, date = search inputs by user #inputs
input = [source, destination, theta]
normalize(input)
feature_weights #given by users where all the weights are between 0
and 1
search_result = []
for item in items{
normalize(item)
result = (input - item)^2 # element based operation
result = dotProduct(result, feature_weights)
search_result.append(result)
}
return search_result
The algorithm for determining which posts should be matched is displayed below:
if user_role = driver {
all_potential_posts = filter to only have ride-request posts.
}
else if user_role = passenger {
all_potential_posts = filter to only have drive-offer posts
46
# step 4: filter posts based on whether all users can guarantee that the
potential carpool will reach the destination on time:
return all_potential_posts
47
Figure 18 explains the process in a flowchart. The algorithm works by getting posts from
Firebase that are from the same organization and are on the same day as the selected post. It also
makes sure that if a user is looking for a ride, then the matched posts will only be drive offers.
The application then uses Google Maps Directions API to check that only posts that form valid
carpools will be matched. A carpool is considered valid if all passengers will reach the
destination on time. The user is then shown a list of matching posts which they can join.
As we chose to design a mobile application, one of our first challenges was deciding
which platform to develop for. Because each operating system provides its own unique
challenges and benefits, we had to decide what aspects were important considering a prototype
application. Considerations for choosing which operating system to develop for include the
number of users of the particular operating system, the time it takes to learn the operating
system, and the resources the operating system provides and is compatible with (especially
mapping APIs available). The main two operating systems we considered were iOS and Android,
the two most popular mobile operating systems.
Depending on which system we chose, we would have to dedicate time and other
resources for learning the system and developing our application for it, so we had to determine if
it was worth it to develop for both operating systems or to just focus on one for the purpose of
creating our software prototype. Other resources include testing equipment, such as the specific
mobile devices that run the chosen operating system and which versions of the operating system
were compatible with which mobile devices. There are also many constraints on testing our
project, especially limited access to certain testing environments. We cannot reasonably test our
application a large range of device types and sizes without first acquiring this hardware. We also
cannot test our application on every possible version of the operating system we choose. It will
also be difficult to extensively test our application in its final environment: on the road and inside
parking garages. Another testing environment constraint will be testing the reliability of the
application with a large number of users accessing the system at the same time.
One important design constraint is the database that the application relies on. In choosing
a database we had to consider the flexibility of the database structure, the convenience to manage
the database, the cost of the database service, the ease of installation and hosting of the database
on a server accessible to our application, and the security and reliability of the service. We had to
consider if we preferred a traditional relational database and the structure it provides, or if the
freedom a non-relational database would be more convenient for our project.
Another one of our major design concerns is providing apt incentive for the uses.
Formation of a concrete user base is very essential for the success of any application. And
therefore, one of the incentives could be to provide verified drivers with parking spots. However,
the parking spots would have to be provided by the university. Moreover, the price of these
parking spots would have to be lower than the normal price of parking permit. But none of this
would be implementable if the university does not wish to support a carpool system. In that case,
a possible solution could have been to introduce money exchange amongst drivers and riders, but
that would not be possible due to legal complications.
49
Another constraint is that some parking structures do not have wifi connectivity,
therefore, a traditional sensor setup would not be effective. Since the sensor would not be able to
connect with the servers, preventing the data transfer amongst sensor and user devices.
Our group decided to choose Android as the mobile operating system we will develop our
application for. We chose to start with Android only for our prototype for a number of reasons.
One reason is because Android is currently the most-used mobile operating system, both globally
and in the U.S. Another reason is because the majority of our team members have access to
Android mobile devices, making testing more convenient. The fact that iOS development is
easiest on Apple computers and that most of our team members do not have access to these
computers, is another important reason for choosing Android. Another reason is because the Play
Store for distributing Android apps is far easier to get access to compared with the App Store
that offers iOS applications. Because our team has very little experience with mobile
development, choosing to develop exclusively for Android and not spending extra resources
trying to develop for iOS as well is the better choice for our team. We also recognize that this
application, while it should be usable, is primarily a prototype and can be expanded upon and can
be developed for iOS in the future.
We chose Firebase as our database service. The service is free to start and the Realtime
Database feature provides a flexible non-relational database structure that lets us determine our
data structure needs as we go. The service also has an extremely convenient web console that
allows complete access and management to the database from anywhere and the service hosts the
data online without any external requirements. Firebase also has an easy-to-use API for Android
and provides plenty of official tutorials and sample code resources.
For the parking lot incentive constraint we have come up with the solution of maintaining
the app’s integrability with the explained idea. At the same time ensuring the possibility of a
testing phase where a mock span of the application can be set with fewer parking spots and users
in order to generate viable results. Which could later on be used as a proof of efficient to help
university decide its implementation.
50
In order to connect the devices installed in parking structures with servers, we have
decided to add another module to the hardware setup: an AT&T cellular shield that can utilize
the LTE connection to send and receive data from the servers.
51
UniRide has a hardware, as well as software components to it. The most essential
software portion is the application itself, and with it being an Android application, Uniride is
majorly implemented using Java 8 and XML. The Application uses Firebase as its major
database, and is developed using Android Studio as the main IDE (Integrated Development
Environment). Furthermore, the hardware sector of Uniride comprises of the parking system
which utilizes Arduino Uno, Raspberry Pi 3, and ultrasonic sensor. The software portions of the
parking system alone is written in C for Arduino functionalities, and Python 3 for the rest. Which
included the script for identifying the state of the parking spot, and AWS Python SDK which
sends the identified status to AWS IoT via MQTT topics.
The main implementation scope of UniRide consists of the user being able to create or
join an organisation, submit a post, browse through existing posts, and create or join a carpool.
Where a carpool is a model that consists of a potential carpool with a driver, and several riders.
Along with these major models, the application consists of two main functionalities: search, and
carpool validation. The searching involves queries based on the searcher’s source, destination,
time, and date. Carpool validation on the other hand, takes place while a carpool trip is going on.
Which allows the algorithm to not only match posts with similar source and destination, but also
to pair with posts whose route passes through or near the query source and destination addresses.
The other major functionality, carpool validation, uses various factors such as GPS location of all
the users involved in the carpool, and QR code generation and detection to verify that a carpool
trip took place under valid circumstances.
Furthermore, Uniride consists of two major algorithms: the parking sensor algorithm, and
the search algorithm. The parking sensor calculates distance of any object away from it. The
sensor performs this action at a rate of one recording every 2-3 seconds. The algorithm takes in
recordings from past 30 seconds and generates a gradient of all the recorded values by
considering a plot where y-axis is distance, and x-axis is time. The algorithm then sends the
status change to AWS and confirms the change by checking whether the distance remains
constant for next 1.5 minutes. The algorithm goes in a semi-idle state after the confirmation.
While in a semi-idle state, it checks for any change every 5 minutes, and initiates a 30 second
check if it detects any significant change.
The search algorithm is responsible for facilitating a search functionality. The algorithm
takes source, destination, time, and date as the inputs. These inputs are entered by the user trying
to search, and based on these factors the algorithm searches through the existing set of both,
posts and carpools. The algorithm first narrows down its search domain by only including posts
with same dates. It then narrows it further by considering an oval with the input source, and
destination points at its foci. The algorithm searches for any posts or carpools whose routes fall
under that oval while also including a vector factor that ensures the considered results are
moving from source to destination and not the other way around. Finally, the search results are
narrowed, and sorted based on the time factor. The user can choose a time deviation factor that
will be used by the algorithm to decide the final results.
One of the major implementation challenge has been to access multiple attributes from
different Firebase tree at the same time. Firebase utilizes database snapshots generated, and we
have had trouble acquiring snapshots of two tables where an activity requires attributes from two
different tables at the same time. We have decided to solve this problem by creating separate
tables for each of the models whose attributes are required in the same android activity.
Another challenge has been to devise a system to validate a carpool. This system would
have to ensure that some, or all of the riders took part in the carpool in order to assign a parking
53
spot for the driver. We chose to do this with a tier based system where the several tiers are
comprised of GPS location of all the users involved in a carpool, and passengers can be verified
via NFC between phones, or entering randomly-generated codes or scanning QR codes. To
verify the carpool has reached the correct destination, the user must respond to a notification on
their phone to confirm the correct designated parking spot was taken. The only drawback of this
method is that it requires the device to be connected to internet at the end of the carpool. Another
approach that could be implemented in the future would be to have a camera scan the license
plate of the vehicle entering the parking spot to validate that it belongs to the vehicle registered
for the carpool.
54
Software Development
Hardware Tools
Version Control
Communication
The primary tool to develop the application was Android Studio. Android Studio is an
Integrated Development Environment (IDE) based off of the IntelliJ IDE and is designed
specifically for Android mobile development. Android Studio was selected because it is the
official Android development IDE supported by Google and it is free to install and runs on Mac
OS, Windows, and Linux operating systems. Each developer had a copy of the software on their
local machine. All lines of the code written for the mobile application were written in Android
Studio. Android Studio comes with easy Firebase integration and other SDKs that made
communication with other external development tools, such as Google Maps APIs, relatively
simple.
For database management, we used the Firebase Dashboard web application. Developers
can log in with their Google account and view the database schema and all database records,
except for secure information, such as user passwords. Because Firebase is a cloud application,
these records include all of the records from all devices that are running the associate mobile
application because each device connects to the database over an internet connection. Records
can be manually edited or deleted from within the dashboard as well. Developers used this tool
to make sure the correct data was being stored in the correct structure and that communication
between the application and the database worked correctly. We chose Firebase because it is
extremely simple to setup and connect with Android applications.
For managing the communication channel between the parking space sensor and the
application, we plan on using AWS IoT Services and Firebase database. Essentially, the
Raspberry Pi analyzes the data received from the sensors and sends it to AWS IoT dashboard via
an MQTT topic. We are using Amazon’s Python SDK for MQTT publication and subscription to
topics. We plan on setting up an AWS Lambda function that sends the received data to Firebase
Database. The android application can then be notified of availability of this data and fetch it
from Firebase Database with ease. We chose AWS IoT services because of the availability of
documentation, and ease of integration with Firebase Database. We considered using Google
Cloud Iot since it would have been seamless along side of Google’s firebase database. However,
we found it to be complicated to integrate due to our lack of experience with the framework.
For managing the asynchronous notification features of the application, we plan on using
Firebase Cloud Functions. Firebase Cloud Functions is another functionality of Firebase which
56
allows us to have server side functions that do jobs such as push notifications based on time,
matches of a certain thing found, upcoming events etc. for the users of the application. Since our
application is storing its data in another Firebase service, called Firebase Database, the
integration of the two, cloud and database, services might be considerably easier than if we were
to do use a similar but external service to Firebase Cloud Functions.
In addition to Slack, we utilize Google Hangouts to work together remotely. While most
group members are often able to meet in person, it is likely some are not able to. Therefore, we
use this tool to update one another on missed information from in-person meetings as well as
general voice and video communication. Google Hangouts also has a screen-sharing feature that
we use for bug and progress tracking.
We also use the learning management system, Canvas, for event tracking and as an
alternative tool for communication. Canvas is integrated with the university’s system as a student
resource. Students will find information about upcoming events, assignments, midterms and
general information about the current courses they are taking in a semester. Our group utilizes
Canvas to keep track of upcoming assignments and task deadlines. This helps us organize our
project schedule and plan accordingly. Canvas also supports direct messaging between students
and professors. Thus, if for any reason Slack, Google Hangouts and our email service providers
57
6.2 Standards
● Color Schemes
We used a set of various shades of blue for the major color scheme of our application.
We also used a set of complementary colors used throughout the app with each serving a specific
set of purposes in the application’s user interface. The generated palettes using Colormind.io.
● Buttons
For consistency, we used the same style for every button throughout the application. It
provides a repeating visual queue for a possible action to be performed.
A distinguished gradient background for sign in and sign up pages in order to provide a
highly distinguishable visual queue for important input fields such as email address and
password.
● Branches: The origin repository had two main branches, master and develop. Except for
some cases, these branches never received directly pushed code, and were never used as
the base branches for development of any functionalities. Each new feature or aspect of
the application received its own branch in the origin repository. Each member managed
their repositories as per their own preference. Functionality code were pushed to their
respective branches in the origin from the member repositories, and upon completion of a
functionality, it’s branch was merged into develop via a systematic pull request with
functionality branch as the base. Upon completion of a certain number of functionalities,
the develop branch is merged with master.
61
Our prime objective was to create a completed system that is optimized and bug-free. To
achieve this goal, frequent testing was required in the following areas: user-interface output,
Firebase query output, search algorithm output, sensor behaviour and output, and route results.
For each area, we performed unit testing, and used a combination of the white-box, black-box,
and gray-box testing. White-box testing was performed in areas that required extensive code
analysis such as the search algorithm, sensor functions, and routes created with input locations.
We carefully examined the data flow and control flow of each function to ensure they will output
correct results. These areas depended on other areas of our application, thus, integration testing
was essential for every stage of progress. Meanwhile, black-box testing was vital for design
phases and use of outside resources like Firebase and APIs. For this large group project, tasks
were divided among the team, and tasks that were completed by each member were tested by
other team members. To follow gray-box testing, we initially tested one another’s features with
little knowledge of how the source code was written and analyzed the results as well as its
performance.
3. Test each component in the user-interface to ensure functionality. Text fields must be
able to receive user input, buttons should be clickable and must perform an action when
pressed, intended color scheme and layout must be the same as what was coded, and
animations and images must be visible and positioned in the chosen activities.
1. Analyze the code thoroughly and examine data flow and control flow
2. Run the application on an actual device
3. Perform the necessary actions to test the search algorithm
63
1. Review the code of the function that commands sensors to retrieve the required data
2. Making sure the sensor and Arduino’s outputs are expected.
3. Ensuring the recorded data is being written into a file without any errors.
4. Making sure the file status is never corrupted, and the read data gives expected outputs.
5. Checking the MQTT topic is being published properly.
64
As our system consists of two large components–software and hardware–we have two
different testing environments for the features within either component. To test our features that
live in our application, we use Java, Android Studio, an actual Android device, and the Firebase
database. For our parking system, we utilize the components that make up the parking system: an
ultrasonic sensor, Raspberry Pi, Arduino UNO, Arduino IDE, internet connection, AWS IoT
along with Python, C, Numpy and Matplotlib Python libraries, a text editor and the
command-line interface.
Our actual test strategy consists of a number of different possible conditions with more
than one test case, however, the documented test strategy is more condensed for clarity. In this
document, the test strategy for our application consists of a minimum of two different conditions
with at least one test case. The table below shows our testing method with the data inputted or
action done, as well as the expected output with a brief description.
FiebaseDatabase.child("organization-posts").child(getSelectedOr
ganizationId()).child("driveOffers").limitToFirst(100);
Algorithm Process
1. Navigates to the “organization-posts” main database branch.
2. Navigates to the sub-branch with the selected organization ID.
3. Navigates to the sub-branch named “driveOffers”.
4. Retrieves a list of the first 100 posts in the sub-branch.
FiebaseDatabase.child("posts").child("driveOffers").orderByChil
d("tripDate").equalTo(selectedTripDate)
Algorithm Process
1. Navigates to the “posts” main database branch.
2. Navigates to the sub-branch named “driveOffers”.
3. Retrieves a list of all posts in the sub-branch with a “tripDate” attribute equal to the
selected trip date.
70
Input: User’s Post and Potential Match Post where the posts aren’t the same type
(either Ride Request or Drive Offer).
- isLookingForDriver = false
http://maps.googleapis.com/maps/api/directions/xml?origin=456+S
+2nd+St,+San+Jose,+CA+95113,+USA&destination=1+Washington+Sq,+S
an+Jose,+CA+95192,+USA&waypoints=optimize:true|567+N+2nd+St,+Sa
n+Jose,+CA+95112,+USA&sensor=false&units=metric&mode=driving
● The user with the post of type Drive Offer is the driver.
● The source of the carpool trip is the driver’s source location.
● The pick up points for the trip are the source locations of the rider(s).
● Rider pick up points are ordered so that the trip time is optimized.
● The final destination of the trip is the driver’s destination location.
Input: Sensor location is set and an object is moving directly towards the sensor.
A set of decreasing numbers since the object is moving towards the sensor, and a json MQTT
73
Condition 1 Summary:
The sensor should work in the predicted manner and detect the object in front of it, when
it’s within its range. The sensor must also be able to detect the distance between itself and the
object in front of it getting smaller.
● Raspberry Pi correctly collects all the output data from the Arduino-sensor
combination.
Condition 2 Summary:
The Arduino gets the output from the sensor, and outputs that value to its console. Then
this console output is being successfully collected by the Raspberry Pi.
74
Input: Raspberry Pi location is set, Raspberry Pi is connected to internet, and an object has
been detected by the sensor.
Condition 3 Summary:
The Raspberry Pi’s location has been set, meaning it knows which spot it has been set on.
The ATT Shield that is the gateway of the Pi to the internet is working properly. The Raspberry
Pi should be able to establish a connection between it and AWS. When the time comes, the
Raspberry Pi is sending the correct information to AWS, which is being received by AWS.
75
Using the test approaches described in the previous section, we were able to write the
following testing results and analysis. For each feature and their test conditions, we noted a
“Pass” or “Fail” result for their expected outputs. As we performed the tests described above
several times throughout the development of this application, the results recorded in this
document all pass after numerous times of enhancement.
FiebaseDatabase.child("organization-posts").child(getSelectedOr
ganizationId()).child("driveOffers").limitToFirst(100);
FiebaseDatabase.child("posts").child("driveOffers").orderByChil
d("tripDate").equalTo(selectedTripDate)
The pick up points for the trip are the source Pass
locations of the rider(s).
The pick up points for the trip are the source Pass
locations of the rider(s).
Input: Raspberry Pi location is set, Raspberry Pi is connected to internet, and n object has been
detected by the sensor.
UniRide is a system that helps members of an organization connect and form carpools to
a common destination. The system incorporates a mobile application and a parking space sensor
system. The mobile application allows users to sign up and find matches for carpools with other
people in their organization. The parking spot sensor system allows the application to verify that
the carpool was successful and reserve a parking spot for the driver. This provides a strong
incentive to participate in carpools in areas where parking space is an increasingly difficult
problem. Promoting more carpooling has various other benefits, such as saving costs and
lowering environmental impact. An organization that wants to promote carpooling within their
organization can use UniRide to provide a means for members to easily find potential carpool
drivers or passengers and plan the trip and handle scheduling for them, while ensuring that there
will be a parking space for the driver. San Jose State University is a prime example of an
organization that could use UniRide to solve traffic and parking space limitations by promoting
carpooling to the campus and helping students find parking more reliably.
The Android mobile application of UniRide works by letting users join organizations that
they belong to. Once the user is a verified member of an organization, they can make posts that
other members of that organization can view. Posts fall under two main categories: ride request
posts and drive offer posts. Ride request posts are posts by a user that wants to be a passenger in
a carpool. Drive offer posts are posts where the user wants to be a driver for a carpool. Users can
respond to posts made by other users and form a carpool that will be planned for a specific date
and time in the future. The application will find the optimized route for the carpool trip and
notify members of a carpool when others join the carpool and when the trip is about to begin.
The parking spot sensor system of UniRide works by using an ultrasonic sensor that
monitors a single parking space, detecting if a nearby vehicle is approaching or moving away
from the sensor. This information is transferred to a Raspberry Pi through an Arduino, where it is
processed and sent to AWS IoT, where it can be accessed by the mobile application. This allows
each sparking spot to be monitored by the system so that it can know which parking spaces are
available or taken. The mobile application can then use this information to reserve a parking spot
for a planned carpool.
After designing and implementing our core features of our application and our sensor
system, we ran several tests to ensure functionality. We used techniques like white-box,
black-box, and gray-box testing throughout our testing phase. We did extensive code analysis for
features like our search algorithm and sensor functions to expect passing results as well as
executing the codes to view actual results. Black-box testing was also important to view our
85
Firebase database outputs after user input and check that the APIs were properly integrated into
our application. While this was a large project with many functionalities, we tested one another’s
completed code with little knowledge of its expected results like gray-box testing. We created
test suites that display user input, expected output, and actual results. Each actual result was
carefully analyzed and all expected output passed with flying colors. By using the mentioned
testing techniques, we were able to identify the functions that needed enhancement and which
that did not need any.
By combining the parking sensor system with the mobile application, UniRide provides a
service that can be used to promote carpooling. By having exclusive memberships to
organizations, riders and drivers can have a higher sense of security and commonality and by
providing a system that can ensure a parking space provides an additional incentive.
While UniRide can help with planning carpools, there are many improvements that could
be added to make it a more complete system. For the mobile application, more subtle features
could be added to make it more standardized and usable. Custom views and more flexibility,
such as the ability to edit posts should be added to create an experience that users would expect
from a standard application. Adding a private chat system would also provide a more convenient
communication method between users. Improvements in the verification process could be added.
More options for passenger verification methods, such as QR codes, NFC-base verification, or
generating custom randomized text codes could be used to make the passenger verification
process convenient yet secure. Other application integrations, such as natural language
processing or chatbots could improve the usability of the application by letting users create
queries in a more flexible way and request services from our system without needing to have the
application open. Built-in security features could be added to improve the safety of an
application that allows strangers to communicate. Adding a rating system of both drivers and
passengers would also help to promote trust within the application. Adding support for
translations into other languages and other customization features could be added to make the
app more versatile. Letting organizations setup custom incentive plans, such as rewards points,
would also be a way to provide organizations with more flexibility.
There are also a number of improvements to the parking system that could be done.
Making the sensor a stand-alone device that comes working and synchronized with the mobile
application out-of-the-box would be an important improvement to make the parking system
scalable and standardized. Other features could be added to the sensor, such as license plate
recognition for vehicle verification or more accurate location monitoring sensor that would be
more reliable than single-sensor motion detection.
86
References
[2] "Add Firebase to Your Android Project | Firebase", Firebase, 2017. [Online]. Available:
https://firebase.google.com/docs/android/setup. [Accessed: 16- Nov- 2017].
[3] "Google Maps Android API | Google Developers", Google Developers, 2017. [Online].
Available: https://developers.google.com/maps/documentation/android-api/. [Accessed: 16-
Nov-
2017].
[5] "Park Assist at Westfield Valley Fair", Westfield.com, 2017. [Online]. Available:
https://www.westfield.com/valleyfair/services/all-services/park-assist/1258.[Accessed:
16- Nov- 2017].
[7] Population Density - Country Comparison. (n.d.) Retrieved September 19, 2017,
from https://www.indexmundi.com/g/r.aspx?v=21000
[8] Ausick, Paul. Global New Car Sales in 2013 Top 83 Million. (2014, February).
Retrieved September 19, 2017, from
http://247wallst.com/autos/2014/02/16/global-new-car-sales-in-2013-top-83-million-sale
-forecast-higher-for-2014/
[10] Xu, Jiaquan. Average Annual Number of Deaths and Death Rates from Unintentional,
Non-Fire Related Carbon Monoxide Poisoning. (2014, January).
Retrieved September 19, 2017, from
https://www.cdc.gov/mmwr/preview/mmwrhtml/mm6303a6.htm
[12] Lindsey, Rebecca. Climate Change: Global Sea Level. (2017, September).
Retrieved September 19, 2017, from
https://www.climate.gov/news-features/understanding-climate/climate-change-global-sea
-level
[13] Parking Garages & Lots. (n.d.) Retrieved September 16, 2017,
from http://www.sanjoseca.gov/index.aspx?NID=1870
[15] Estimating the Energy Consumption Impact of Casual Carpooling (2011, January)
Retrieved September 19, 2017, from http://www.mdpi.com/1996-1073/4/1/126/htm
[18] Garling, T., Garling, A., Johansson, A. Household choices of car-use reduction measures.
(2000).
from https://link-springer-com.libaccess.sjlibrary.org/article/10.1007/s11116-015-9661-7