Professional Documents
Culture Documents
Batch 10 Finalll
Batch 10 Finalll
Submitted By
MUBEEN S 812020205031
SUBASRI V 812020205048
RAJATHI S 812020205309
INFORMATION TECHNOLOGY
MAY 2024
i
ANNA UNIVERSITY: CHENNAI 600025
BONAFIDE CERTIFICATE
Certified that this project report "BUS SERVICE FACILITY AT PEAK TIME " is the
bonafide work of Mubeen.S(812020205031), Subasri.V(812020205048),
Rajathi.S(812020205309) who carried out the project under my supervision.
SIGNATURE SIGNATURE
Dr. K. Geetha, M.E., Ph.D., Dr. K. Geetha, M.E., Ph.D.,
Departmentof IT Department of IT
M.A.M College of Engineering M.A.M College of Engineering
and Technology and Technology
Submitted for B.Tech degree viva-voce held at M.A.M College of Engineering and
Technology on ………………
ii
ACKNOWLEDGEMENT
With warm hearts and immense pleasure, I thank the almighty for his grace
and blessing bestowed on me, which drove me to the successful completion of this
project. I take this opportunity to express my sincere thanks to the respected
Chairman Dr. M.A. Maluk Mohammed, M.E., Ph.D., and Secretary &
Correspondent Mrs. Fathima Bathool Maluk , M.B.A., who is guiding light for
all activities in our college.
I would like to thank our Head of the Department Dr.K. Geetha, M.E., Ph.D.,
for her cooperation, advice and suggestions at every stage of my project work.
I would also like to express with gratitude and my sincere thanks to my guide
Dr.K.Geetha, M.E., Ph.D., Head of the Department for motivating me
throughout the project work.
I also thank all the teaching faculty and non-teaching faculty of the Department
of Information Technology, my parents and all my friends for their help and
support to complete this project successfully.
iii
ABSTRACT
The web application for requesting bus services during peak hours serves as a pivotal tool in
application, users gain seamless access to real-time bus arrival information for specific
routes, specifying their journey's origin (FROM) and destination (TO). This innovative
system proves particularly invaluable during peak hours, empowering users to plan their
journeys with efficiency and precision. The applications core functionality allows users to
transportation that streamlines the overall process at bus stations during busy periods. This
enhanced level of control and convenience contributes to a more efficient and user-friendly
intelligent transport solutions. In the web application's key features include real-time
information access, journey planning capabilities, and advanced bus service requests, all of
particularly during peak hours. By facilitating proactive planning and reducing congestion at
bus stations, the application contributes to an improved and more user-centric urban
transportation system.
iv
CHAPTER NO. TITLE PAGE
NO.
ABSTRACT iv
LIST OF FIGURES vii
LIST OFABBREVIATIONS viii
1 INTRODUCTION 1
1.1 OVERVIEW 1
2 LITERATURE SURVEY 3
v
4.1 HARDWARE REQUIREMENTS 26
4.2 SOFTWARE REQUIREMENTS 26
5 SYSTEM DESIGN 28
5.1 SYSTEM ARCHITECTURE 28
6 MODULES 22
6.1 ARDUINO MODULE 29
6.2 IR SENSORS MODULE 30
6.3 GPS MODULE 32
6.4 POWER SUPPLY 33
7 CONCLUSION AND FUTURE ENHANCEMENT 35
7.1 CONCLUSION 35
7.2 FUTURE ENHANCEMENT 35
APPENDICES 36
A. SOURCE CODE 36
B. SCREENSHOT 44
REFERENCES 47
vi
LIST OF FIGURES
vii
LIST OF ABBREVIATIONS
viii
CHAPTER-1
INTRODUCTION
1.1. OVERVIEW
The Mobile application for requesting bus services during peak hours marks a
significant leap forward in the realm of intelligent transport systems, aiming to
revolutionize and streamline the public transportation experience. In the contemporary
landscape, where urban mobility is a critical aspect of daily life, this application stands
out as a solution designed to address the challenges posed by peak-hour congestion and
inefficiencies in the bus service system. By providing users with real-time access to bus
arrival information and enabling advanced service requests between specified routes, the
application becomes a powerful tool for enhancing journey planning and overall
commuting convenience. The goal of this web application is to empower users to
navigate public transportation seamlessly, especially during peak hours when the
demand for efficient transit solutions is at its peak. Offering features such as proactive
service requests and precise journey planning, the application seeks to alleviate
congestion at bus stations and optimize the utilization of available resources. As cities
continue to grow and evolve, the demand for intelligent transport solutions becomes
increasingly pronounced, and this web application emerges as a timely and innovative
response to the challenges posed by the modern urban commuting landscape. The
proposed web application aims to revolutionize public bus transportation during peak
hours by introducing a user-friendly platform for efficient service requests and
information access. The system involves an Admin module for managing bus details, a
Data Storage module to securely store information, a User Interface module for user
interactions, and a Bus Information module for real-time updates. Admins can log in,
input bus details, and ensure system accuracy. Users log in, enter their journey details,
and view relevant bus information. The application streamlines peak-hour travel by
allowing users to proactively request services and access real-time data, addressing
challenges in traditional manual methods.
1
However, ensuring passenger safety and comfort, particularly during peak hours when
buses are often crowded, remains a significant challenge. To address this issue, integrating
infrared (IR) sensors into buses can offer a proactive solution. IR sensors are capable of
detecting the presence of passengers and estimating crowd density within the bus in real-
time. By strategically placing these sensors at key points within the vehicle, such as
entryways and aisles, the system can continuously monitor passenger occupancy levels.
When the number of passengers exceeds a predefined threshold, indicating a crowded
environment, the system triggers automated alerts or notifications. These alerts can be
transmitted to both onboard displays and external interfaces accessible to the public, such as
mobile applications or digital signage at bus stops. Through timely notifications, passengers
can make informed decisions about their travel plans, choosing alternative routes or modes
of transportation to avoid overcrowded buses. Ultimately, the integration of IR sensors for
crowd detection and public notification enhances passenger experience, promotes safety,
and optimizes the efficiency of public transportation systems in densely populated urban
areas. In bustling urban environments, navigating through traffic congestion and efficiently
managing public transportation systems poses considerable challenges, especially during
peak hours. To address these challenges and enhance commuter experience, real-time
tracking of public transport vehicles has become imperative. One such solution involves
leveraging GPS technology to precisely determine the latitude and longitude coordinates of
buses operating during peak times. By equipping buses with GPS devices and integrating
them into a centralized tracking system, transportation authorities gain the ability to monitor
the precise location of each bus in real-time. This allows for accurate tracking of buses
along their routes, enabling commuters to access up-to-date information regarding bus
locations and estimated arrival times. By providing commuters with visibility into the
current location of buses during peak hours, they can better plan their journeys, anticipate
delays, and make informed decisions about their travel routes.
2
CHAPTER-2
LITERATURE SURVEY
4
long term and short-term predictions. The experimental results obtained show that
increasing the degree of non-linearity of the predictors is highly benefic for the accuracy
of the obtained predictions. They also show that significant improvements can be
achieved over state of the art techniques. In the case of long-term prediction, the FNN
method performs the best when compared with the baseline OLS technique, with a
significant increase in accuracy (more than 66%). For short-term prediction, the FNN
method is also the best performer, with more than 15% of gain in accuracy with respect
to OLS.
Introduction
Today, the concept of modern and smart cities cannot be envisaged without
mentioning the ITS (Intelligent Transportation Systems). Since the beginning of this
important domain, in the early 1970’s, there has been a lot of progress, innovation and
development. In recent years, the emergence of ITS-related applications has been
catalysed by the rapid growth of available data, as well by the increase of the
computational power that is naturally needed to process such data. Both public
institutions and private companies are proposing various solutions for gathering and
processing of its-related data. Among the various use cases considered, let us mention
trip planning, daily commute, real-live traffic information, trip cost, multi modality and
so on. Usually as end results, the corresponding services are provided in a form of
phone app or web portal, where the users can get the desired information. Traffic jam,
pollution, security, unreliable public transportation, limited parking facilities, are the
main problems that modern cities are facing today all over the world. Addressing and
minimizing such problems could bring some potential benefits for the society in terms
of safety for both pedestrians and vehicles, better traffic management, fuel/energy
consumption and environmental issues. In addition, let us underline that vehicular
transports in the urban areas performed by individuals or public transportation vehicles
contribute heavily on the carbon footprint, called greenhouse gas. The data provided by
the French government in 2015 gives an extensive overview of the key numbers related
to the production of the greenhouse gas. Transportation, in general, is responsible for
27% of the production of greenhouse gas. Transport operated by road represents 94,8 %
5
of them. The logical step to reduce such emissions is to decrease the number of
individual vehicles used for transportation, by privileging reliable public transportation
facilities. Let us underline that the question of reliability is highly important since the
user acceptancy of public transportation strongly depends on. Within this framework,
disposing of efficient traffic prediction tools, dedicated to public transportation, is a
highly challenging issue, for both users (which want to be informed precisely and in
real-time) and transportation operators (which aim at optimizing their transport
networks/itineraries). Different approaches attempt to address this issue. One solution
relates to the infrastructure and proposes building bigger lanes, bridges, roundabouts or
underground passages. Such a solution is applicable only in areas where the extension
of the infrastructure is possible, excluding hence most of the densely populated cities. In
addition, it is also the costliest solution. Another approach concerns the creation of areas
restricted to specific types of vehicles (such as public transportation or electrical
vehicles) and thus with low density traffic flow. Even though the proposed solutions are
achievable, they are not suitable for numerous urban areas. Seeking a response to such
problems, a new research domain, so-called Intelligent Transportation Systems (ITS)
has emerged in early 1970s and continuously evolved since then. ITS aims today at
bringing advanced techniques and technologies into the transportation systems such as
electronic sensors, data transmission and intelligent control technologies. Under this
framework, the required data can be obtained from different and diverse sources such as
smart cards, GPS, sensors, video streams, images, social media and so on. The main
purpose is to provide better services for both drivers and passengers and
to globally improve the whole transportation system. In this article, we are
investigating an ITS-related predictive approach, based on computer simulation and
machine learning techniques. The proposed methods are applied over existing systems
in an artificial environment (traffic simulator software) that can simulate real-life
scenarios. The main goal is to develop prediction algorithms that can improve the
efficiency of transportation over existing systems/infrastructures
6
Methodology
The initial goal is to improve the public transportation system by predicting bus
arrival time at desired station while taking to account the real-time traffic situations on
the whole bus itinerary. In order to do so, the traffic situation at each measurement
station is represented with the help of the TDM (Traffic Density Matrix) . Measurement
stations are points in space that detects and counts how many vehicles pass at a certain
period of time. The TDM(i,j) entry thus provides the number of vehicles that are present
in the bus station at time j. In real-life scenarios such sensors are most often the loop
detectors, but other sensors can perform similar task, like camera for vehicle counting.
For the convenience of the whole simulation, each bus stop location was considered as a
measurement station. In this particular scenario, the detection radius around the
considered measurement station was set to 100 meters. The objective is to inform the
user, in real-time, of the arrival of the buses in his location. To this purpose, we
estimate, for a given bus stop provided as input, the expected arrival time of the next
bus. In order to do achieve this goal, we sample the TDM and construct vectors that are
further used for prediction purposes. Such a vector is composed of the Nstops values
from the TDM matrix that correspond to a given time Rtime, which represents the
current time. In total, for the whole bus itinerary there are Nstops bus stops. In our
experiments, we have focused on bus line 89, which included 36 bus stops, since its
prediction is more difficult due to the presence of traffic jams . We have chosen 5
different bus stop stations, evenly sampling the itinerary, and denoted as Rstop: 11, 16,
21, 26 and 31. These are the bus stops that will be used to predict bus arrival time in
seconds. In order to construct the training vector, set, for each current time, randomly
chosen and denoted by tcrt, we determine the location of the closest bus Cstop, prior to
the current bus location Rstop. During the construction of the training data set, we make
sure to retain only valid trials, i.e., values for which in the simulations, at the current
time there exists a bus prior to current bus location
7
Merits:
The accuracy of real-time bus arrival predictions and this adaptability allows the
system to continually improve its predictions as it encounters new data.
Demerits:
Introduction
Road networks are the backbones of any country’s development structure. Free
flowing of road traffic is important for faster connectivity and transportation systems. In
a smart city roads would be equipped with the sensors for analyzing the traffic flow and
transportation. Accurate traffic flow information is desperately needed for various group
of road users like, commuters, private vehicle travelers and public transportation system.
This information will help road users to make better travel decisions, improve traffic
operation efficiency, reduce pollution and overcome traffic congestion. The purpose of
traffic congestion prediction is to provide information about the traffic congestion well
in advance. Traffic congestion prediction (TCP) has gained increasing popularity with
the rapid development and deployment of Smart transportation systems (STSs).Traffic
8
congestion prediction is considered as an important element for the successful
deployment of STS subsystems, particularly advanced traveler information systems,
advanced traffic management systems, advanced public transportation systems and
commercial vehicle operations. Hence, free flowing of road traffic is important for faster
connectivity and transportation systems. Few traffic flow prediction methods proposed
have used Neural Networks and other prediction models which take presumably more
time with manual intervention which are not suitable for many real-world applications.
TCP mostly depends on past and present real-time traffic data collected from various
sources of sensors, like mobile Global Positioning System, social media, RFIDs,
cameras, etc. In a smart city with the widely deployed traffic sensors and new emerging
traffic sensor technologies, traffic data are accumulated a lot. We can make use of these
data to find out interesting nuggets and utilize these knowledge for the prediction of
congestion like problems. So, here, we come up with an algorithm which makes use of
the data and predicts well in advance whether there would be a traffic congestion or not.
The proposed Machine learning based congestion prediction algorithm that used Logistic
Regression gives a simple, accurate and early prediction of the traffic congestion for a
given static road network which can be considered as a graph. The complexity of the
algorithm mentioned above would be constant. So, this is can be effectively used by any
devices which has a less computation capability and with less resources. As a future
direction the traffic congestion
prediction can be predicted using various Hybrid techniques which can give high
accurate results.analysis and congestion prediction.
Methodology
In this paper we propose a novel architecture which can be used by the systems deployed
at the road junction for analysis and congestion prediction. We assume that all the smart
cities are well developed and well connected, with all the sensors deployed at the crucial
junctions. The data is being gathered from different junction points through different
sensors. The data is assumed to be stream data which is time dependent. Our goal is to
predict the congestion on any specific path which is about to occur in the due time. For this
we divide the data into twodifferent parts based on the time frames namely T1 and T2. T1
9
data is used for training machine learning algorithm which learns a model based on the
10
data supplied. Since we are using the supervised classification algorithms for prediction, we
need to have a labeled data to train the classification algorithms. For this reason we take the
help of an algorithm called as CONGESTION ALGORITHM proposed by Suguna Devi .
The working procedure of the architecture can be explained as follows: First, the T1 data is
taken and for each sample the path is identified. The average speed of all the vehicles
travelling in the same path is determined. With the help of the CONGESTION
ALGORITHM, we try to label the data based on the condition, that if the average speed of
the vehicle is less than the defined threshold “t” we label it as congested otherwise not. In
this way all the data would be labelled and grouped in the next step to make it a collection
of dataset. Thus obtained dataset is used for training the different machine learning
algorithms to generate the models which can be used for predictions. Here in this context,
we have applied five different machine learning algorithms and trained them and predicted
the output of these algorithms. The results of these algorithms are discussed in the results
and discussion section. Now, for the generated model we can supply the test data T2 and
predict the accuracy of the learnt models. The model which gives the high accuracy and
recall can be considered the best prediction model. The data used for this proposed method
is assumed to have the following description. The data may have following five attributes,
Vehicle identification number Time stamp at which the data is collected Speed of the
vehicle at above mentioned time X and Y co-ordinates of the vehicle at the above
mentioned time. Congestion in the path on the path in which it is Travelling .The fifth
attribute is assigned a label using the CONGESTION ALGORITHM described in section
3. All the four attribute would be numerical whereas the fifth attribute would be nominal. It
is a synthetic data generated on the lines of road traffic analysis.
Merits:
Demerit:
Continuous monitoring of traffic using sensors raises privacy concerns, as it
involves tracking the movement of vehicles and, indirectly, individuals.
11
2.3 OPTIONAL EXPANSION OF THE AUTOMATED FARE
The subject of this research is the automated fare collection system and the
possibility of its expansion. The purpose of the work is the optional expansion of the
automated fare collection system in public transport of the city of Kharkiv to improve
the transport network based on the use of GPS tracker. The following tasks are solved
in the article: analysis of the existing automated fare collection system, construction of
the structure of the automated system, construction of the data exchange model
between the server and the devices validating the system, assessing the capabilities of
the existing system, developing an extension for further improvement of the
system .The following methods are used process modeling using the IDEF0 charts. The
following results were obtained: The article proposes an optional extension of the
automated fare collection system for public transport in the city of Kharkiv to improve
the transport network based on the use of GPS tracker. The analysis of the working
system and its possibilities is carried out, namely: the analysis of data flow exchange
in the existing system has been performed in order to identify the possibilities of its
expansion; the structure of the existing system of automated payment of travel has been
developed. The proposed expansion is characterized by minimal costs, since it is based
on an already functioning system, which enables the provision of full dispatching and
logistics of public transport in the city of Kharkiv using the subsystem of analysis and
processing of information. The system is characterized by the ability to optimize the
route network by collecting and analyzing the statistics of travel paid , passenger traffic
and behavioral models of passengers, as well as information on road conditions and
routes. The proposed expansion of the automated payment system for public transport
in the city of Kharkiv can be applied without changing the hardware base of the system,
and will also achieve results such as increasing road safety, reducing time and energy
resources costs for travel, improving vehicle comfort, increasing the competitiveness of
carriers , improving public transport image.
12
Introduction
Nowadays, the lives of most citizens of the world is closely connected with the
use of information systems. Due to the significant advances in information technology,
the transport sector is undergoing significant changes: from smart ticket payments to
new initiatives multi modal mobility and autonomous vehicles. There is a rapid increase
in the popularity of cashless settlement [20]. At the time when most financial
settlements can be made even without leaving home, it becomes obvious that the method
of payment of travel in transport with the help of a paper ticket is completely outdated.
This article presents solutions for increasing the efficiency of the use of the existing
automated fare collection system (AFC).Nowadays, the global changes occurrence in the
services sector, which are expressed in the reorientation of the market towards the
consumer. This also applies to the sphere of transport services. In this regard, the
application of new managerial decisions in creating conditions for the provision of
transport services and public transport organization becomes essential. In particular, the
improvement of the existing automated fare collection system for public transport
services by involving modern methods of distribution, collection and processing of
information. Improvement of the system aims at bringing it to such a level that it will be
able to respond flexibly to the change of any components: density of passenger traffic,
road conditions, routes etc. The existing automated fare payment system is flexible and
has the ability to expand and align with other systems, using only its own hardware base,
by improving the software. Implementation of the GPS navigation system will cause a
9% increase in channel traffic, which is entirely within the current system and will not
require additional financial costs. The use of additional functions based on GPS
navigation will increase the competitiveness of the system and in the long run will allow
to transfer the entire system of vehicles management and monitoring, as well as workers,
into an electronic automated system. Referring to the information on the driver's
working time on the line, it is possible to introduce a payroll system for employees in
accordance with the data in the transport system.
13
Methodology
The article proposes an optional extension of the automated fare collection system
for public transport in the city of Kharkiv to improve the transport network based on the
use of GPS tracker. The analysis of the working system and its possibilities is carried
out, namely: the analysis of data flow exchange in the existing system has been
performed in order to identify the possibilities of its expansion; the structure of the
existing system of automated payment of travel has been developed. The proposed
expansion is characterized by minimal costs, since it is based on an already functioning
system, which enables the provision of full dispatching and logistics of public transport
in the city of Kharkiv using the subsystem of analysis and processing of information.
The system is
characterized by the ability to optimize the route network by collecting and analyzing
the statistics of travel paid , passenger traffic and behavioral models of passengers, as
well as information on road conditions and routes. The proposed expansion of the
automated payment system for public transport in the city of Kharkiv can be applied
without changing the hardware base of the system, and will also achieve results such as
increasing road safety, reducing time and energy resources costs for travel, improving
vehicle comfort, increasing the competitiveness of carriers , improving public transport
image.Many industries use new technologies in an effort to increase efficiency and
attract consumers to use innovations. Nowadays, most developed countries use an
automated payment and checking system for public transport as an alternative to cash
payments. The automated fare collection system is intended for fare payment and
control, sale and replenishment of electronic travel document on the basis of contact less
technology Mi fare Plus, as well as sales of one-time travel document. AFC is a new
stage in the development of passenger transportation. The automated fare collection
system plays an important role in the production activities of transport companies. They
allow to transfer payments for travel in non-cash form, increase the efficiency and
control of financial activities of transport companies, improve the culture and quality of
passenger services. The automated fare collection systems allow to effectively deal with
14
the problem of unlisted travel, forgery of travel document, as well as to carry out
the most accurate
15
accounting of the number of passengers in public transport, to accumulate, store and
analyze this data. Ground transport is equipped with validators of contact less electronic
cards. Systems use non-contact cards of the Mi fare family. Contact less card Mi fare
PLUS is a plastic card, which works up to 10 cm away from the reader (card reader).
The PLUS card carries the UID, which is a unique identifier and additional memory that
can be overwritten. The PLUS card provides standard security in smart card
applications. The card can use the updated security level, the AES 128 algorithm for
authentication, data integrity and encryption. Information security of the validation
system is provided using hardware SAM modules. They are equipped with devices that
read contact less cards. The SAM module includes secure memory and supports crypto
graphic functions (encryption,electronic signature readout, authentication of
electronic signatures, etc.)
used to enhance the security of systems with contact less cards. The keys are
diversified,which means that each contact less card used in the system has its own
unique key issuedby the SAM module. In addition, data stored on contact less cards has
an electronic signature, and it is encrypted. The SAM module uses standard crypto
graphic algorithmsfor MAC signatures, for encoding 3DES and AES. The system uses
the FareOn control software. This software allows the system to continuously improve,
optimize, adapt to changing conditions, and take full advantage of the new technologies
potential. Fare On effectively evaluates and uses the received operational data. Its high
adaptability allows to program functions in accordance with the individual needs of the
client. Fare On also provides the ability to import data from other systems and provides
an efficient analysis of operational data. Openness of the system and the use of
advanced standards facilitate the work with data (for example: XML), data exchange
through web services, and integration with equipment subsystems such as payment
terminals, information boards, etc. On the ETD the required tariff is entered (full,
preferential). In the future, the maps can be repeatedly replenished with the help of self-
service devices. In the public transport the passenger apply an ETD to the
validator/turnstile. As a result, the fare is deducted orthe availability of travel document
is checked, payment information is recorded on the card and transmitted to the
16
processing and issuing center. Also, the validator has the function of payment for
17
another person (persons) and luggage.The controller checks the payment on the card
with a hand-held contact less electronic card reader. All informationon sales statistics
and the use of maps is collected automatically in the processing and issuing center and
is displayed in the analytic system.In such systems, for the provision of communication
through GSM channels, the power of local telecommunications operators is used,
which imposes certain restrictions on the volume, speed and data transmission
volumes. Within this system, a tariff plan with a traffic restriction of 700 MB per
month is used for each vehicle.Ground transport is equipped with validators of contact
less electronic cards. Systems use non-contact cards of the Mifare family. Contact less
card Mifare PLUS is a plastic card, which works up to 10 cm away from the reader
(card reader). The PLUS card carries the UID, which is a unique identifier
andadditional memory that can be overwritten. The PLUS cardmprovides standard
security in smart card applications. The card can use the updated security level, the
AES 128 algorithm for authentication, data integrity and encryption.Information
security of the validation system is provided using hardware SAM modules. They are
equipped with devices that read contactless cards. The SAM module includes secure
memory and supports cryptographic functions (encryption, electronic signature
readout, authentication of electronic signatures, etc.) used to enhance the security of
systems with contact less cards.The keys are diversified, which means that each
contactless card used in the system has its own unique key issued by the SAM
module.In addition, data stored on contact less cards has an electronic signature, and
it is encrypted. The SAM module uses standard cryptographic algorithms for MAC
signatures, for encoding 3DES and AES.The system uses the Fare On control software.
This software allows the system to continuously improve, optimize, adapt to changing
conditions, and take full advantage of the new technologies potential. Fare On
effectively evaluates and uses the received operational data. Its high adaptability allows
to program functions in accordance with the individual needs of the client. FareOn also
provides the ability to import data from other systems and provides an efficient analysis
of operational data. Openness of the system and the use of advanced standards facilitate
the work with data (for example: XML), data exchange through web services, and
18
integration with equipment
19
subsystems such as payment terminals, information boards, etc. On the ETD the
required tariff is entered (full, preferential).In the future, the maps can be repeatedly
replenished with the help of self-service devices. In the public transport the passenger
apply an ETD to the validator/turnstile. As a result, the fare is deducted or the
availability of travel document is checked, payment information is recorded on the card
and transmitted to the processing and issuing center. Also, the validator has the
function of payment for another person (persons) and luggage.The controller checks the
payment on the card with a hand-held contactless electronic card reader. All
information on sales statistics and the use of maps is collected automatically in the
processing and issuing center and is displayed in the analytics system.
Merit
The proposed extension leverages the existing automated fare collection system,
minimizing the need for additional hardware or infrastructure investments.
Demerit
20
transformed in intensive systems in order to automate routines, methods and procedures
in several areas of knowledge. The spread of these technologies has produced large
volumes of data. These large volumes of data embody the knowledge of the organization,
processes and environments. Access to this knowledge is the result of data analysis
processes. However, database technology by itself is not comprehensive enough to
support data analysis. Complementary technologies and tools are required in this process,
mostly developed in the context of Data Mining and Machine Learning. The main
objective of these areas is to uncover knowledge through the analysis of data. By
uncovering knowledge, we mean the discovery of patterns, trends, classes and groups of
data. Recently, the areas of mobile computing, remote sensing and mobile telephony
experienced fast development and, as a result, produced large amounts of data.The
proposal of this paper is based on some concepts that have been studied by researchers
worldwide. These concepts include semantic of moving objects trajectories, pattern
detection, forecasting, location base services, and travel time prediction, among others.
This section intends to present an overview of some works related to the proposal of this
work. The concept of Trajectory Pattern introduced defines a sequence of geo-referenced
objects S of size m and a list of Temporal Annotations A of size (m - 1), whose values
represent the temporal distance between two consecutive geo-referenced objects
belonging to S. The information of the trajectory patterns, i.e., the geo-referenced objects
and temporal annotations, are extracted from a set of trajectories of moving objects (in
this case, a sequence of triple <latitude, longitude, timestamp>) by identifying regions of
interest (geo-referenced objects) often visited by moving objects. The computation of
temporal annotations is formalized as a problem of density estimate, whose values are
used to calculate the time difference between timestamps of two consecutive triples in a
trajectory.On the path between two stops of a vehicle there can be a variation of vehicle
speed, causing some parts to be slower than others. Segmenting portions of the
movement of vehicles allows us to represent this difference in speed over a movement.
This segmentation allows to estimate accurately know how long time the vehicle will
spend from the current position to the next known place (again, based on the application
context) location it will stop considering slices of the segment with different average
21
speed. Considering the movement between stops P1 and P2, four segments are defined:
S1, S2, S3 and S4. Segment S1 starts at the stop P1 and ends at the stop P2. Segment S2
starts at the position indicated in the figure and ends at stop P2. Segment S3 starts at the
position indicated in the figure and ends at stop P2.
Methodology
The methodology we propose in this paper uses a mechanism for estimating the
time that will be spent by a vehicle between any two points that: (1) pre-processes raw
trajectory data to create aggregated data; and (2) learns the behavior of the vehicles using
this aggregated data. 3.1 Moves and stops Any moving object moves and stops. The stops
have a goal (semantic) and a period of time: a person stops for 10 minutes at a bus
stationto take a bus or a vehicle stops for 5 minutes in a gas station to refuel. Figure 1
illustratesa situation in which a moving object made three stops P1, P2 and P3 along the
path between A and B in the space S. Taking into account the movements and stops
(later on the concept of stop is defined) of moving objects, the mechanism of travel time
prediction proposed in this paper uses data mobility (GPS coordinates with timestamp and
speed) to "learn" the behavior of vehicles (and their drivers) in a given region and
estimate the timea vehicle (driven by the same driver) in a given region will take to move
between two distinct points. The construction of the travel time estimating mechanism
involves the following steps: extracting the mobility data; processing the trafficked
segments; and creating the time estimation model. These steps are described in the next
subsections
Merits:
This can result in more precise travel time predictions compared to conventional
approaches.
Demerits:
The module especially complex ones, can be challenging to interpret.
22
2.5.ACTIVE BUS TRACKING AND BUS
RECOMMENDATION SYSTEM USING IOT & MACHINE
LEARNING
Abstract
Traveling by the bus is an option but in most cases the chance of a bus getting
delayed is high, this can be of various reasons like heavy traffic, engine problems, etc.
The objective of this project is to provide the real-time locations, routes of travel, also
recommending bus to a particular destination and best travel options that ensures
available bus routes, available buses to a destination, provide bus timing to reach the bus
stop and required time to reach the destination. IoT is used to provide real-time bus
location and machine learning to build recommendation engine. The recommendation
based on most scored, reviewed, budget, travel comments, similar travels. Cloud-based
database is used for storing and manipulating the data. Database stores the location
along with the update time. Machine learning server uses data in the database to
recommend the best route to travel and creates a model for future use. The user interface
provided by using an android application. This proposed system saves time and
increases the work efficiency of end- users because it reduces the user’s efforts to
traveling.Currently, buses are an important part of the public transport system. Traveling
by the bus is an option but in most cases the chance of a bus getting delayed is high, this
can be of various reasons like heavy traffic, engine problems, etc. The objective of this
project is to provide the real-time locations, routes of travel, also recommending bus to a
particular destination and best travel options, that ensures available bus routes, available
buses to a destination, provide bus timing to reach the bus stop and required time to
reach the destination. IoT is used to provide real-time bus location and machine
learning to build recommendation engine. The recommendation based on most scored,
reviewed, budget, travel comments, similar travels. Cloud-based database is used for
storing and manipulating the data. Database stores the location along with the update
time. Updating time and location can be used to calculate the time taken to travel and
average speed. If the bus is not running on that day, the proper indication is displayed
23
along with the location and the timing of the next bus through the route will be given.
Machine learning server uses data in the database to
24
recommend the best route to travel and creates a model for future use. The user interface
provided by using an android application. This proposed system saves time and
increases the work efficiency of end-users because it reduces the user’s efforts to
traveling for work and avoids the wastage of waiting time for the bus.
Introduction
The public transportation system plays a major role in daily routine. Sometimes
there are lots of problems arising because of the lack of information about the
availability of buses in a route at a time. Lots of technologies can be applied to
transportation systems, especially in buses, but they don’t run according to the
predefined timetable as described due to traffic jams, breakdown, engine problems, etc.
The bus corporations provide bus timetables on the websites, but such bus timetables
are usually static and provide only very limited information to the user. This project
focuses to solve problems facing every people in the public transportation system. This
information will help people in making better traveling decisions. Here explaining an
IoT based bus tracking system, deals with NodeMCU which serves as the central
controller acting as the brain of the system, by using GPS (Global Positioning System),
the geographic location of a vehicle can be determined, and the related information can
be transmitted to a remotely located server. This will locate the position of bus in google
maps through track requests. Machine learning is used for route recommendation
systems, which provide an available path and available buses to a destination. The user
uses an android application to access the service. The user selects the travel destination.
The app processes the data by accessing the database and shows the available
transport options to the destination at that specified time. The recommendation engine
builds by using content-based filtering and collaborative filtering algorithm. A cloud-
hosted database is used for storing and manipulating the real-time data and normal data
(user information, Bus details), which enables the fast and efficient use of the
application.The system in uses a GPS module that is attached to the Arduino system
inside the bus.
25
Methodology
This system is using Internet of Things (IoT) and Machine Learning to get the
data over the internet and building a recommendation system. In IoT, all devices are
connected in a network by using internet service for transmitting data. Affordable and
reliable devices and sensors are making IoT possible for more developments. IoT
development boards, also known as prototyping boards, are hardware platforms that are
widely used to build prototypes of developer's ideas. Here using an IoT board for
building the hardware portion. These boards can save you from a lot of repetitive tasks
and processes. A Recommender System refers to a system that can predict the future
preference of a set of items for a user and recommend the top items. Machine learning is
used for a route recommendation system, which provides an available path and available
buses to a destination. The outcome of the project gives to the user through a very
simple, effective, and friendly android application.A system described in aims in
automating the services of the system that can provide the real-time tracking experience
of the public transport buses. The RFID (Radio Frequency Identification) tags placed
inside buses and RFID readers will be placed at every bus stop. Arduino act as the
controller for this system. GSM (Global System for Mobile communication) module
will send the tracking messages to authorized persons for continuous monitoring. GPS
(Global Positioning System) is used to track the location of the buses. Users will get the
details of the bus as notifications in their mobiles through IoT. The inputs from RFID
readers are updated continuously to Arduino for processing the data. After processing,
the data is sent to the cloud which serves as the interface between the user and the
system.The designed in- vehicle device works using GPS and GSM/GPRS (General
Packet Radio Service) technology. The hardware part is embedded inside a vehicle
whose position is to be determined and tracked in real-time. A microcontroller is
employed to manage the GPS and GSM/GPRS modules. The GSM/GPRS module helps
to transmit and update the vehicle location to a database. A smartphone application is
employed for continuously monitoring the vehicle location. The Google Maps API
(Application Programming Interface) is helping to display the vehicle on the map.In this
system , the position of the bus is gathered by embedding GPS on the bus and the
26
location of the bus is sent by
27
GPRS service provided by GSM networks or by SMS or using RFID. The GPS device is
enabled on the tracking device and this information is distributed to a centralized
controller or directly to the bus stops using RF receivers. People can get the details
using LEDs that connected at bus stops, or by SMS, or using a web application or an
Android application.The system architecture describes , the development of a vehicle
tracker using the GPS and GSM modem is done with the aim of enabling users to locate
their vehicles with ease and in a convenient manner. That paper explains the
development of the vehicle tracking system's hardware prototype. The system will
utilize GPS to obtain a vehicle's position coordinate and transmit it using a GSM
modem to the user's phone through the network. The u-blox NEO-6Q GPS receiver
module, u- blox LEON-GIOO GSM module, and Arduino Uno microcontroller are the
hardware component of this system. The tracking system is using the integration of
GPS, GSM, and RFID. There is a need for accurate estimation of Bus location. Here
using a novel approach for location estimation called B-T-S (Bust Tracking System)
based on adaptive location estimation method and GPS approach. The evaluation of the
approach is done using java simulation tool by considering both simulation and real-
time analysis.The hardware components integrated inside the bus by providing power
from bus and a battery source. The system uses internet service to communicate and
update data on the server and later to the real-time database. The server receives the data
and stores it to the database and provides the data as input to the machine learning
model to crate suggestions to the user for better travel options. The user interface is
provided with an android application which gives the user access over the service
provide with a smartphone.
Merits:
The active bus tracking system provides real-time information about bus
locations, reducing uncertainty and waiting times for passengers.
Demerits:
The systems effectiveness may be limited to areas with proper IoT infrastructure
and network coverage, excluding remote or less developed regions.
28
CHAPTER 3
SYSTEM ANALYSIS
The existing system for bus services during peak times typically involves a
combination of scheduled routes, increased frequency of buses, and strategic
deployment of resources to manage the surge in demand. During peak hours, transit
agencies often adjust schedules to accommodate higher passenger volumes, with more
buses deployed on popular routes to reduce overcrowding and minimize wait times.
Additionally, dedicated bus lanes or priority signals may be implemented to expedite
travel and improve reliability. Real-time communication tools, such as mobile apps or
digital displays at bus stops, are also commonly utilized to provide passengers with up-
to-date information on arrival times and service disruptions. Despite these measures,
challenges such as congestion and capacity constraints may still arise, prompting
ongoing efforts to optimize operations and enhance the overall effectiveness of bus
services during peak periods.
Many transit agencies utilize GPS technology to track the real-time location of buses.
This information is often made available to passengers through mobile apps and
websites, allowing them to check bus arrival times and plan their journeys accordingly.
Contactless payment methods, such as smart cards and mobile ticketing apps, have
become prevalent. Passengers can use these technologies for fare payment, reducing
boarding times and improving the overall efficiency of the boarding process.
Reliance on manual data management processes for bus schedules, leading to potential
inaccuracies and difficulties in maintaining up-to-date information.
29
3.1.1. DEMERITS:
The collection of passenger data for analytics purposes raises privacy concerns.
Striking a balance between improving services and safeguarding passenger privacy
poses a challenge.
In the GPS tracking and automated announcement systems, can be expensive for
transit agencies, potentially leading to increased operational costs.
30
Fig 3.2 Proposed System
The functioning of the proposed web application for requesting bus services during
peak hours involves a streamlined process catering to both administrators and users. The
process begins with the administrative functionalities, where the admin can securely
access the system through a login page. Here, the admin has the capability to manage
user registrations and logins, ensuring that access is controlled and secure. Additionally,
the admin plays a pivotal role in inputting and updating critical bus information such as
timings and route details, contributing to the accuracy of the systems data. The heart of
the system lies in the effective storage and retrieval of this bus-related information,
facilitated by the web application's data storage module. This module ensures that the
details entered by the admin, including bus timings and data, are stored in a well-
organized and secure manner. The web application serves as a centralized repository for
this information, enabling quick and reliable access for both administrators and users.
The meticulous management of data within the application is crucial for maintaining the
efficiency and reliability of the public bus transportation system.
User side, the process involves a straightforward and user-friendly interface. Users
initiate their interaction by registering or logging into the system, providing a
personalized experience. Once logged in, users can enter their journey details,
specifying the origin (FROM) and destination (TO) locations, such as Trichy to Madurai
or other routes. This information is then processed by the system, which, in turn,
retrieves and displays relevant bus details based on the user's input.
31
3.2.1. MERITS
Optimized Traffic Flow: Through measures such as dedicated bus lanes and
priority signals, the system helps to mitigate congestion and improve traffic flow,
benefiting not only bus passengers but also other road users.
32
CHAPTER – 4
SYSTEM REQUIREMENTS
• Arduino Microcontroller
• LCD Display
• GPS Location Tracker
• IR Sensors
• Frontend: HTML,CSS
33
CHAPTER 5
SYSTEM
DESIGN
35
Power Supply
Limit Switch
Transmitter Block:
RF Transmitter
S-3
S-4
SIM800A GSM
Neo-6M GPS
Module
36
CHAPTER-6
MODULES
6.1.ARDUINO MODULE
Fig.6.1Arduino UNO
The utilization of infrared (IR) sensors to detect the presence of passengers within a bus
and connecting these sensors to a microcontroller represents a pivotal aspect of modern
38
transportation systems, enhancing safety, efficiency, and passenger experience. IR sensors,
equipped with infrared light-emitting diodes (LEDs) and photodiodes, detect changes in
infrared radiation caused by the presence of objects or individuals within their detection
range. By strategically placing IR sensors at various locations within the bus, such as near
seats or entryways, transportation authorities can effectively monitor passenger occupancy
and assess crowd density in real-time. To integrate IR sensors into a bus tracking system,
proper wiring and connections are essential to ensure accurate and reliable operation. The
process begins by selecting suitable IR sensors capable of detecting human presence and
interfacing them with a microcontroller, such as an Arduino or Raspberry Pi. Each IR
sensor typically consists of three pins: VCC (power supply), GND (ground), and OUT
(output signal). The first step in connecting IR sensors to the microcontroller involves
establishing power and ground connections. The VCC pin of each sensor is connected to
the microcontroller's power supply pin, while the GND pin is connected to the ground pin.
This ensures that the sensors receive the necessary power to operate and establish a
common ground reference with the microcontroller. Next, the output signals of the IR
sensors are connected to digital input pins of the microcontroller. The output pin of each
sensor, which provides a digital signal indicating the presence or absence of an object
within its detection range, is connected to a separate digital input pin on the
microcontroller. This allows the microcontroller to read the state of each sensor and
determine whether a passenger is occupying a seat or entering/exiting the bus. Proper
wiring and connections are crucial to ensure reliable communication between the IR
sensors and the microcontroller. It is essential to use appropriate cables and connectors,
ensuring secure connections and minimizing signal interference or loss. Additionally, care
should be taken to avoid signal cross-talk or short circuits by routing wires neatly and
using insulation where necessary. Once the IR sensors are properly connected to the
microcontroller, software programming is required to interpret sensor data, monitor
passenger occupancy, and assess crowd density. By processing data from the IR sensors,
the microcontroller can generate actionable insights, such as updating bus occupancy status
in real-time, triggering alerts for overcrowding, or optimizing seating arrangements based
on passenger demand.In conclusion, the usage of IR sensors in bus tracking systems, along
with proper wiring and connections to a microcontroller, enables transportation authorities
39
to effectively monitor passenger occupancy and assess crowd density within buses. By
implementing this technology, public transportation systems can enhance safety, optimize
resource allocation, and improve overall passenger experience in urban environments.
Fig.6.2.IR SENSORS
Fig.6.3.GPS MODULE
41
integrating Arduino boards with IR sensors. The power supply serves as the backbone of
the IoT ecosystem, providing the necessary electrical energy to power the Arduino board,
IR sensors, and other peripheral components. This infrastructure is essential for
maintaining continuous functionality and facilitating seamless data collection and
processing in various IoT applications. In the context of connecting IR sensors to an
Arduino board, a robust power supply system plays a pivotal role in ensuring the stability
and longevity of the hardware setup. The Arduino board itself requires a stable and
regulated power source to operate efficiently, typically ranging from 5 volts to 12 volts
depending on the specific model and configuration. Therefore, selecting an appropriate
power supply unit with the correct voltage output is paramount to avoid potential damage
or malfunction of the Arduino board. Moreover, the integration of IR sensors adds an
additional power requirement to the system. While IR sensors typically operate at lower
voltages (e.g., 3.3 volts or 5 volts), they still necessitate a reliable and consistent power
supply to function optimally. Therefore, the power supply system must be capable of
supplying adequate power to both the Arduino board and the IR sensors simultaneously,
without compromising performance or stability. When designing the power supply system
for an IoT hardware setup with Arduino and IR sensors, several factors must be
considered to ensure efficiency and reliability. Firstly, the power supply unit should have
sufficient capacity to meet the combined power demands of all connected components,
including the Arduino board, IR sensors, and any other peripherals or modules.
Additionally, attention should be paid to the quality and stability of the power supply
output. Fluctuations or disruptions in power supply voltage can lead to erratic behavior or
malfunction of the Arduino board and connected sensors, potentially compromising the
integrity of data collection and processing. Therefore, utilizing a high- quality power
supply unit with built-in voltage regulation and protection features is essential for
maintaining consistent and reliable power delivery to the IoT hardware. Furthermore, the
physical layout and wiring of the power supply system should be carefully planned to
minimize interference and ensure proper heat dissipation. Adequate insulation and
shielding should be employed to protect against electrical noise and external
environmental factors that may affect the performance of the IoT hardware.
42
CHAPTER 7
7.1 CONCLUSION
Future enhancements for bus services during peak times aim to address the
challenges of overcrowding, delays, and inefficiencies, ensuring a smoother and more
reliable commuting experience for passengers. One potential enhancement
involves the implementation of advanced predictive analytics and machine learning
algorithms to accurately forecast demand patterns and optimize bus schedules
dynamically. By analyzing historical data, traffic patterns, and passenger behavior,
transit authorities can adjust service frequencies and routes in real-time to match the
fluctuating demand during peak hours. Additionally, the integration of smart
technologies such as IoT sensors and real-time GPS tracking enables better monitoring
of bus occupancy levels and allows for proactive management of overcrowding
situations. Dedicated bus lanes, priority signals, and traffic management systems can
further expedite bus travel times, reducing delays and improving overall service
reliability.
43
APPENDICES
A. SOURCE CODE
44
fields = [ 'username','email', 'email2', 'password']
def clean(self, *args, **kwargs):
email = self.cleaned_data.get('email')
email2 =
self.cleaned_data.get('email2')
45
if email != email2:
raise forms.ValidationError("Emails must match")
email_qs = User.objects.filter(email=email)
if email_qs.exists():
raise forms.ValidationError( "This email has already been registered")
return super(UserRegisterForm, self).clean(*args, **kwargs)
rom django.db import models
class Bus(models.Model):
bus_name = models.CharField(max_length=30)
source = models.CharField(max_length=30)
dest = models.CharField(max_length=30)
nos = models.DecimalField(decimal_places=0, max_digits=2)
rem = models.DecimalField(decimal_places=0, max_digits=2)
price = models.DecimalField(decimal_places=2, max_digits=6)
date = models.DateField()
time = models.TimeField()
class Meta:
verbose_name_plural = "List of
Busses" def str (self):
return self.bus_name
class User(models.Model):
user_id = models.AutoField(primary_key=True)
email = models.EmailField()
name = models.CharField(max_length=30)
password = models.CharField(max_length=30)
class Meta:
verbose_name_plural = "List of
Users" def str (self):
return self.email
class Book(models.Model):
BOOKED = 'B'
46
CANCELLED = 'C'
TICKET_STATUSES = ((BOOKED, 'Viewed'), (CANCELLED, 'Cancelled'),)
email = models.EmailField()
name = models.CharField(max_length=30)
userid =models.DecimalField(decimal_places=0, max_digits=2)
busid=models.DecimalField(decimal_places=0, max_digits=2)
bus_name = models.CharField(max_length=30)
source = models.CharField(max_length=30)
dest = models.CharField(max_length=30)
nos = models.DecimalField(decimal_places=0, max_digits=2)
price = models.DecimalField(decimal_places=2, max_digits=6)
date = models.DateField()
time = models.TimeField()
status = models.CharField(choices=TICKET_STATUSES, default=BOOKED,length=2)
class Meta:
verbose_name_plural = "List of
Buses" def str (self):
return self.email
from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name="home"),
path('findbus', views.findbus,
name="findbus"),
path('bookings', views.bookings, name="bookings"),
path('cancellings', views.cancellings, name="cancellings")
path('seebookings', views.seebookings, name="seebookings"),
path('signup', views.signup, name="signup"),
path('signin', views.signin, name="signin"),
path('success', views.success, name="success"),
path('signout', views.signout, name="signout"),
47
]
48
from datetime import datetime
from django.contrib import messages
from django.shortcuts import render
from decimal import Decimal
from django.shortcuts import render, redirect
from django.http import HttpResponse, HttpResponseRedirect
from .models import User, Bus, Book
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from .forms import UserLoginForm, UserRegisterForm
from django.contrib.auth.decorators import login_required
from decimal import Decimal
def home(request):
if request.user.is_authenticated:
return render(request,
'myapp/home.html') else:
return render(request,
'myapp/signin.html')
@login_required(login_url='signin')
def findbus(request):
context = {}
if request.method == 'POST':
source_r = request.POST.get('source')
dest_r = request.POST.get('destination')
date_r = request.POST.get('date')
date_r = datetime.strptime(date_r,"%Y-%m-%d").date()
year = date_r.strftime("%Y")
month =
date_r.strftime("%m") day =
date_r.strftime("%d")
49
if bus_list:
return render(request, 'myapp/list.html', locals())
50
else:
context['data'] = request.POST
context["error"] = "No available Bus Schedule for entered Route and Date"
return render(request, 'myapp/findbus.html', context)
else:
return render(request, 'myapp/findbus.html')
login_required(login_url='signin')
def bookings(request):
context = {}
if request.method == 'POST':
id_r = request.POST.get('bus_id')
seats_r = int(request.POST.get('no_seats'))
bus = Bus.objects.get(id=id_r)
if bus:
if bus.rem > int(seats_r):
name_r = bus.bus_name
cost = int(seats_r) * bus.price
source_r = bus.source
dest_r = bus.dest
nos_r = Decimal(bus.nos)
price_r = bus.price
date_r = bus.date
time_r =
bus.time
username_r =
request.user.username email_r =
request.user.email userid_r =
request.user.id
rem_r = bus.rem - seats_r
Bus.objects.filter(id=id_r).update(rem=rem_r)
book = Book.objects.create(name=username_r, email=email_r,
51
userid=userid_r, print('------------bus id ', book.id)
# book.save()
52
return render(request, 'myapp/bookings.html', locals())
else:
context["error"] = "Sorry select fewer number of seats"
return render(request, 'myapp/findbus.html', context)
else:
return render(request, 'myapp/findbus.html')
@login_required(login_url='signin')
def cancellings(request):
context = {}
if request.method == 'POST':
id_r = request.POST.get('bus_id')
#seats_r = int(request.POST.get('no_seats'))
try:
book = Book.objects.get(id=id_r)
bus = Bus.objects.get(id=book.busid)
rem_r = bus.rem + book.nos
Bus.objects.filter(id=book.busid).update(rem=rem_r)
#nos_r = book.nos - seats_r
Book.objects.filter(id=id_r).update(status='CANCELLED')
Book.objects.filter(id=id_r).update(nos=0)
messages.success(request, "Viewed Bus has been cancelled successfully.")
return redirect(seebookings)
except Book.DoesNotExist:
context["error"] = "Sorry You have not that bus"
return render(request, 'myapp/error.html', context)
else:
return render(request, 'myapp/findbus.html')
@login_required(login_url='signin')
def seebookings(request,new={}):
context = {}
id_r = request.user.id
53
book_list = Book.objects.filter(userid=id_r)
if book_list:
return render(request, 'myapp/booklist.html', locals())
else:
context["error"] = "Sorry no buses"
return render(request, 'myapp/findbus.html', context)
def signup(request):
context = {}
if request.method == 'POST':
name_r = request.POST.get('name')
email_r = request.POST.get('email')
password_r =
request.POST.get('password')
user = User.objects.create_user(name_r, email_r, password_r, )
if user:
login(request, user)
return render(request, 'myapp/thank.html')
else:
context["error"] = "Provide valid credentials"
return render(request, 'myapp/signup.html', context)
else:
return render(request, 'myapp/signup.html', context)
def signin(request):
context = {}
if request.method == 'POST':
name_r = request.POST.get('name')
password_r =
request.POST.get('password')
user = authenticate(request, username=name_r, password=password_r)
if user:
login(request, user)
54
# username =
request.session['username']
context["user"] = name_r
55
context["id"] = request.user.id
# return HttpResponseRedirect('success')
else:
context["error"] = "Provide valid credentials"
return render(request, 'myapp/signin.html',
context) else:
context["error"] = "You are not logged in"
return render(request, 'myapp/signin.html', context)
def signout(request):
context = {}
logout(request)
context['error'] = "You have been logged out"
return render(request, 'myapp/signin.html', context)
def success(request):
context = {}
context['user'] = request.user
return render(request, 'myapp/success.html', context)
56
B. SCREENSHOT
57
Fig.B.3.Seat occupied 1 (LCD Display) Fig.B.4.Seat Occupied 2 (LCD Display)
58
Fig.B.7.Seat occupied:0(App) Fig.B.8. Occupied :1(App)
59
REFERENCE
9. Suguna Devi, T. Neetha, A Novel Algorithm for predicting road traffic congestion in a
IOT based smart city. IJERD, Special Issue SIEICON-April, 2017, p-ISSN : 2348-
6406
10.Wang, L., & Lee, S. (2023). "Optimizing Bus Services During Peak Hours: A Study
on the Effectiveness of the Bus Information Module."
60