Hemanth finalYearProject
Hemanth finalYearProject
MONITORING SYSTEM
A project report submitted at the end of semester in the partial fulfilment of the requirements for the
award of degree of
BACHELOR OF TECHNOLOGY
IN
Submitted by
2020-2024
1
DEPARTMENT OF COMPUTER SCIENCE AND SYSTEMS ENGINEERING
ANDHRA UNIVERSITY COLLEGE OF ENGINEERING
ANDHRA UNIVERSITY
VISAKHAPATNAM
CERTIFICATE
This is to certify that the project title entitled “REAL-TIME POTHOLE DETECTION AND
ROAD CONDITION MONITORING SYSTEM.”, done by T. ZELALEM (320106410076), B.
CHAITANYA (320106410077), CH. HEMANTH SAI (320106410078) , M. JULIA
(320106410079) students of Department of Computer Science and Systems Engineering, Andhra
University College of Engineering (A) during the period 2023-2024 in the partial fulfilment of the
requirements for the award of degree of Bachelor of Computer Science and Systems Engineering.
2
DECLARATION
We hereby declare that the project “REAL-TIME POTHOLE DETECTION AND ROAD
CONDITION MONITORING SYSTEM“ submitted to the Department of COMPUTER
SCIENCE AND SYSTEMS ENGINEERING, Andhra University College of Engineering,
Visakhapatnam has been carried out by us under the guidance of Prof. I. S. SRINIVASA RAO. This
work was not submitted to any other institution for the award of any other degree.
ZELALEM
(Reg.No:320106410076)
B. CHAITANTYA KUMAR
(Reg.No:320106410077)
M. JULIA
(Reg.No:320106410079)
Place: Visakhapatnam
Date:
3
ACKNOWLEDGEMENT
We have immense pleasure in expressing our gratitude to our Project Guide Prof. I. S. SRINIVASA
RAO, Andhra University for his inspiring and scholarly guidance. Despite his pre-occupation with
several assignments, he has been kind enough to spare his valuable time and gave us the necessary
counsel and guidance at every stage of planning and constitution of this work. We express sincere
gratitude for having accorded us permission to take up this project work and for helping us
graciously throughout the execution of this work.
We express sincere Thanks to Prof. K.VENKATA RAO, Head of the Department of Computer
Science and Systems Engineering, Andhra University College of Engineering (A) for his keen
interest and providing necessary facilities for this project study.
We express sincere Thanks to Prof. G. SASIBHUSANA RAO Principal, Andhra University College
of Engineering for his keen interest and for providing the necessary facilities for this project study.
We express sincere thanks to Prof. P. V. G. D. PRASAD REDDY, Hon’ble Vice Chancellor, Andhra
University for his keen interest and for providing the necessary facilities for this project study.
We are thankful to all the Professors and Faculty Members in the department for their teachings and
academic support and thanks to Technical Staff and Non-teaching Staff in the department for their
support.
4
ABSTRACT
The Pothole Detection and Reporting System is an innovative application of IOT technology
aimed at improving road safety and maintenance. The system utilizes ultrasonic sensors and GPS
modules to detect and pinpoint potholes on road surfaces in real-time. Upon detection, the system
automatically sends the location coordinates of the potholes to a central database hosted on Google
Sheets via Wi-Fi connectivity.
This data can then be utilized by municipal authorities for prompt repair and maintenance,
thereby reducing the risk of accidents and improving overall road quality. The project showcases the
integration of hardware components, sensor technology, and internet connectivity to address a critical
issue in transportation infrastructure. Through its implementation, the Pothole Detection and
Reporting System contribute to safer and more efficient road networks, promoting sustainable urban
development and enhanced quality of life for communities.
5
TABLE OF CONTENTS PAGE NO
CERTIFICATE 2
DECLARATIONS 3
ACKNOWLEDGEMENTS 4
ABSTRACT 5
TABLE OF CONTENTS 6
LIST OF FIGURES 8
1. INTRODUCTION 9
1.1Overview 9
1.4 Motivation 12
2. LITERATURE SURVEY 13
3. REQUIREMENT ANALYSIS 15
5. IMPLEMENTATION 29
6
6. TESTING 56
7.1. Overview 61
8.1. Results 73
8.3. Discussion 79
8.4. Comparison 80
9. REFERENCES 82
7
LIST OF FIGURES PAGE NO
8
1. INTRODUCTION
1.1 OVERVIEW
Potholes and poor road conditions pose grave threats to road safety, causing vehicle damage and
increasing accident risks. Promptly identifying and addressing these hazards is crucial for ensuring
smooth and secure transportation. The Real-Time Pothole Detection and Road Condition Monitoring
System project aims to develop an innovative, autonomous solution to detect potholes, map road
conditions, and report hazards in real-time, enabling proactive maintenance and enhancing road
safety.
This robust system integrates cutting-edge technologies like Arduino microcontrollers, ultrasonic
sensors, GPS modules, and wireless communication capabilities. It navigates urban environments,
continuously scanning the road surface for potholes, cracks, and irregularities in real-time. A key
feature is its pothole and road condition detection capability, employing ultrasonic sensors to
accurately measure distances and detect hazards. Simultaneously, a GPS module captures precise
location data, creating a comprehensive road condition map.
This real-time map seamlessly integrates with cloud platforms like Google Sheets, providing a
centralized repository for storing and analysing road hazard data. This integration facilitates data-
driven decision-making for road maintenance and repair, contributing to smarter, safer urban
infrastructure.
The system features autonomous navigation, with an Arduino-based control system, motor driver,
and wheels enabling autonomous navigation through designated areas, minimizing manual
intervention. Remote control through a web interface allows users to monitor operations and issue
commands.
Leveraging the Internet of Things (IoT) and cloud computing, this system not only detects and maps
road hazards but also improves road safety, reduces vehicle damage, and ensures smoother journeys
for commuters. By harnessing real-time data and autonomous capabilities, it represents a significant
step towards proactive road maintenance and enhanced transportation infrastructure management.
9
1.2 PROBLEM STATEMENT
Roads are critical infrastructure assets that facilitate transportation and mobility for individuals and
goods. However, they are subject to deterioration over time due to various factors such as weather
conditions, heavy traffic, and lack of timely maintenance. Potholes, cracks, and other road hazards
can lead to vehicle damage, accidents, and increased wear and tear on vehicles, resulting in
significant economic and safety implications.
Traditionally, road condition assessments have relied on manual inspections, which are time-
consuming, labour-intensive, and prone to human error. Manual inspections often involve teams of
workers visually inspecting roads and recording observations, which can be subjective and
inconsistent. Additionally, these manual assessments often fail to provide real-time data and timely
updates, hindering effective road maintenance planning and resource allocation.
Furthermore, manual inspections can be hazardous, as workers are exposed to the risks of working
alongside active traffic. This not only jeopardizes their safety but also necessitates the
implementation of traffic control measures, which can lead to traffic disruptions and delays.
The lack of continuous monitoring and timely data on road conditions can result in delayed repairs,
leading to further deterioration and escalating maintenance costs. Unaddressed potholes and road
hazards can also contribute to increased vehicle operating costs, as they can cause damage to tires,
suspension systems, and other components, leading to higher repair and replacement expenses for
vehicle owners.
Moreover, poor road conditions can have a significant impact on the overall quality of life for
commuters and residents. Potholes and uneven surfaces can lead to uncomfortable and jarring rides,
contributing to driver fatigue and frustration. In urban areas, poorly maintained roads can exacerbate
traffic congestion, noise pollution, and negative environmental impacts due to increased fuel
consumption and emissions.
To address these challenges, there is a pressing need for an automated and real-time road condition
monitoring system that can efficiently and accurately detect potholes, cracks, and other road hazards,
enabling timely maintenance and minimizing the associated economic, safety, and environmental
consequences.
10
1.3 PROJECT AIM AND OBJECTIVES
The primary aim of this project is to develop a robust and efficient system that can autonomously
detect potholes and other road hazards in real-time, map their locations, and provides comprehensive
data for road condition monitoring and maintenance planning.
1. Design and implement an integrated system: The project aims to design and implement an
integrated system that combines various technologies, including Arduino microcontrollers, ultrasonic
sensors, GPS modules, and wireless communication capabilities. This integrated system will enable
real-time pothole detection and road condition mapping, providing a comprehensive solution for
monitoring and maintaining road infrastructure.
2. Develop algorithms and software for accurate detection: A critical objective is to develop
advanced algorithms and software that can accurately identify and classify potholes, cracks, and
other road hazards based on sensor data. This will involve implementing machine learning
techniques and data processing algorithms to ensure reliable detection and classification of road
hazards.
3. Integrate with cloud-based platforms: The project aims to integrate the system with cloud-based
platforms like Google Sheets to provide a centralized repository for storing and analysing road
condition data. This integration will enable real-time data sharing, collaborative data analysis, and
facilitate data-driven decision-making for road maintenance and repair operations.
By achieving these objectives, the Real-Time Pothole Detection and Road Condition Monitoring
System project aims to provide a comprehensive and innovative solution for addressing the
challenges posed by poor road conditions, contributing to improved road safety, cost savings, and
better infrastructure management.
11
1.4 MOTIVATION
The motivation behind this project stems from the significant impact of poor road conditions on
transportation safety, vehicle maintenance costs, and the overall quality of life for commuters and
residents.
By developing an automated and real-time pothole detection and road condition monitoring system,
this project aims to address the following key motivations:
1. Improved Road Safety: Timely identification and repair of potholes and road hazards can
significantly reduce the risk of accidents, ensuring safer journeys for all road users. Potholes and
uneven road surfaces can cause vehicles to lose control, increasing the likelihood of collisions or run-
off-road incidents. By providing real-time data on the location and severity of road hazards, the
system will enable prompt maintenance and repair efforts, minimizing the potential for accidents and
enhancing overall road safety.
2. Cost Savings: Early detection and proactive maintenance of road hazards can prevent further
deterioration of roads, reducing the need for costly and extensive repairs in the future. Neglected
potholes and cracks can quickly worsen, leading to more extensive damage and higher repair costs.
By identifying and addressing these issues early on, the system can help minimize long-term
maintenance expenses and optimize resource allocation for road authorities and agencies.
12
2. LITERATURE SURVEY
1. “POTHOLE DETECTION SYSTEM USING ULTRASONIC SENSOR” by Shubham R.
Patil, Girish S. Patil, Dnyaneshwar V. Chuadhari, Dhananjay S. Gade, and Asst Prof. P. B. Mali
(2023) - This study used the ATMEGA328p microcontroller, HC-SR04 ultrasonic sensor, and GPS
module for distance measurement and pothole detection. The software utilized includes Arduino IDE
for programming and Serial Bluetooth Terminal for wireless communication.
The programming involved writing codes for ultrasonic sensor and GPS module functionalities. The
results show successful detection of potholes using ultrasonic sensors and GPS coordinates. The
study highlights the effectiveness of the proposed system in detecting and managing potholes on
roads.
Similarly, the GPS module integration entails powering it with +5V from Arduino and establishing
serial connections for efficient data transmission. The HC-05 Bluetooth module, boasting six pins for
component integration, serves as a vital gateway for wireless communication with mobile
13
applications, employing UART interfacing and AT Commands for seamless operation. Moreover, the
survey delves into the functionality of cloud storage systems like Google Cloud and Firebase,
highlighting their role in providing accessible and reliable data storage solutions compatible with
various hardware and software platforms.
Additionally, databases are elucidated as organized collections of structured information, with real-
time database systems ensuring swift transaction processing to meet evolving data demands. This
integration of hardware components with cloud storage and databases facilitates real-time data
collection and visualization on Android applications, fostering enhanced accessibility and usability
across diverse industrial sectors.
14
3. REQUIREMENT ANALYSIS
- Accurate real-time detection of potholes, cracks, and other road hazards using ultrasonic sensors
or suitable sensing technologies.
- Differentiation and classification of various types of road hazards (e.g., potholes, cracks, bumps).
- Integration of a GPS module for precise location tracking of detected road hazards.
- Creation of a comprehensive map of identified road conditions, including location, type, and
severity of each hazard.
- Real-time updating of the map as the system navigates and detects new hazards.
- Seamless integration with cloud-based platforms like Google Sheets or other cloud storage
services.
- Automatic uploading and storage of detected road hazard data (location, type, severity) in the
cloud.
- Mechanisms for accessing and visualizing stored data through user-friendly interfaces or
dashboards.
- Tools or interfaces for analysing collected road condition data, identifying trends, and generating
reports.
- Highlighting critical areas requiring maintenance, prioritizing repair efforts, and estimating
required resources and costs.
- Enabling data sharing and collaboration among stakeholders (road authorities, maintenance
teams, urban planners).
15
3.2 Non-Functional Requirements
- Highly reliable and accurate pothole and road hazard detection with minimal false positives or
negatives.
- High precision and accuracy in GPS tracking and mapping of road hazards.
- Rugged and durable hardware components capable of withstanding minor impacts or shocks.
- Designed for scalability, allowing easy expansion or integration with additional sensors or
components.
- Modular and extensible software architecture for incorporating new features or functionalities.
4. User-Friendly Interface
- Intuitive and easy-to-navigate interface with clear visualizations and reporting capabilities.
Software Requirements
- Libraries for interfacing with ultrasonic sensors, GPS modules, and wireless communication
modules
Hardware Requirements
16
- Arduino microcontroller board (e.g., Arduino Uno, Mega)
The Real-Time Pothole Detection and Road Condition Monitoring System will be developed using
the Arduino IDE or a compatible development environment. The software will consist of several
modules or components:
1. Sensor Integration Module: This module will handle the integration and communication with
various sensors, such as ultrasonic sensors for pothole detection and GPS modules for location
tracking. It will interface with the respective sensor libraries and process the raw sensor data.
2. Pothole Detection and Classification Module: This module will implement algorithms and
techniques for accurately detecting and classifying potholes, cracks, and other road hazards based on
the processed sensor data. It may employ machine learning algorithms or rule-based systems for
robust hazard detection.
3. Mapping and Navigation Module: This module will be responsible for creating a comprehensive
map of identified road conditions, including the location, type, and severity of each hazard. It will
also handle the autonomous navigation functionality, adjusting the navigation path or speed based on
detected hazards.
4. Cloud Integration Module: This module will handle the integration with cloud-based platforms
like Google Sheets or other cloud storage services. It will facilitate the automatic uploading and
storage of detected road hazard data in the cloud for later analysis and reporting.
17
5. Data Analysis and Reporting Module: This module will provide tools or interfaces for analysing
the collected road condition data, identifying trends, and generating reports. It will highlight critical
areas requiring maintenance, prioritize repair efforts, and estimate required resources and costs.
6. User Interface Module: This module will develop a user-friendly interface for monitoring,
controlling, and analysing the collected data. It will provide visualizations, dashboards, and reporting
capabilities for stakeholders.
7. Communication and Control Module: This module will handle the communication and control
aspects of the system, enabling manual control or remote operation through a web interface or
mobile application. It will also facilitate data sharing and collaboration among stakeholders.
The software will be designed with a modular and extensible architecture, allowing for easy
integration of new features or functionalities in the future. Additionally, emphasis will be placed on
ensuring reliability, accuracy, security, and privacy throughout the software development process.
18
4. SYSTEM ARCHITECTURE, DESIGN AND METHODOLOGY
The Real-Time Pothole Detection and Road Condition Monitoring System follow a modular and
layered architecture, consisting of several interconnected components. The architecture is designed to
ensure scalability, maintainability, and seamless integration of various technologies. The following
diagram illustrates the high-level system architecture:
1. Microcontroller Layer: This layer forms the core of the system, featuring an Arduino board that
serves as the central processing unit. The Arduino board coordinates and controls the various
hardware components, executes the software programs, and manages the data flow between
different layers.
2. Hardware Integration Layer: This layer comprises the physical sensors and actuators that
interact with the external environment. It includes an ultrasonic sensor for pothole detection, a
19
GPS module for location tracking and navigation, a WiFi module for wireless communication
and data transfer, and a motor driver for controlling the system's movement.
3. Data Processing Layer: This layer encompasses the software modules responsible for
processing the raw data collected from the sensors and performing critical operations. It includes
the Pothole Detection and Classification module, which analyzes the ultrasonic sensor data to
identify and categorize potholes and road hazards. The GPS Mapping and Navigation module
utilizes GPS data to create a comprehensive map of identified road conditions and control the
system's autonomous navigation. The Data Analysis module processes the collected data,
identifies trends, and generates reports for informed decision-making.
4. Cloud Integration Layer: This layer facilitates the integration of the system with cloud-based
platforms, such as Google Sheets or other cloud storage services. The collected road condition
data, including location, type, and severity of hazards, is automatically uploaded and stored in the
cloud, enabling centralized data management, remote access, and collaboration among
stakeholders.
20
4.2 Design and Methodology
ESP32 Microcontroller: The ESP32 is a powerful and versatile microcontroller based on the
Tensilica Xtensa 32-bit LX6 microprocessor. It serves as the brain of the system, managing and
coordinating the operation of all the other components through its integrated peripherals and
communication interfaces.
GPS Module (NEO-6M or equivalent): A GPS module, such as the NEO-6M from u-blox, is used
to obtain the current location coordinates (latitude and longitude) of the vehicle. It receives signals
from GPS satellites and processes them to determine the precise location.
21
Ultrasonic Sensor (HC-SR04 or similar): An ultrasonic sensor, like the widely used HC-SR04, is
employed to measure the distance between the vehicle and potential obstacles or potholes on the
road. It works by emitting high-frequency sound waves and measuring the time it takes for the
reflected waves to return, allowing the calculation of the distance to the target object.
LCD Display (16x2 Character LCD): A 16x2 character LCD display is used to provide visual
feedback and display relevant information to the user, such as GPS coordinates, distance
measurements, and system status.
22
Motor Driver (L298N): The L298N motor driver is a high-voltage, high-current dual full-bridge
driver designed to drive inductive loads such as DC motors. It is used to control the direction and
speed of the motors (wheels) based on the input signals from the microcontroller.
Motors (Wheels): Two DC motors, connected to the motor driver, power the wheels of the vehicle,
allowing it to move forward, backward, turn left, or turn right based on the control signals from the
motor driver.
23
4.2.2 Software Components
TinyGPS++ Library: This library is specifically designed for parsing and processing the data
received from GPS modules. It provides a simple and efficient way to extract location coordinates,
speed, altitude, and other relevant information from the raw GPS data.
LiquidCrystal_I2C Library: This library simplifies the communication and control of the LCD
display over the I2C interface, allowing easy configuration and display of text and data on the LCD.
Ultrasonic Library: This library provides functions to interact with the ultrasonic sensor and
calculate the distance measurements based on the time-of-flight principle. It abstracts away the low-
level communication and timing calculations, making it easy to integrate the ultrasonic sensor into
the system.
WiFi and WebServer Libraries: These libraries enable the ESP32 to connect to a WiFi network
and set up a web server for remote control and data transmission. The WiFi library handles the
wireless connectivity, while the WebServer library provides a lightweight and easy-to-use framework
for creating a web server on the ESP32.
HTTPClient Library: This library is used to make HTTP requests to the Google Apps Script web
app for sending data to Google Sheets. It allows the system to transmit the collected GPS coordinates
and distance measurements to a remote server or cloud service for storage and analysis.
4.2.3 Methodology
The system initializes by establishing a connection to the Wi-Fi network and setting up a web server
on the ESP32 microcontroller.
The GPS module continuously receives signals from GPS satellites and transmits the raw data to the
microcontroller via serial communication.
The TinyGPS++ library parses the raw GPS data and extracts the current location coordinates
(latitude and longitude) of the vehicle.
Concurrently, the ultrasonic sensor periodically measures the distance between the vehicle and
potential obstacles or potholes on the road using the time-of-flight principle.
24
If the measured distance is greater than a predefined threshold (e.g., 25 cm), indicating a clear road,
the system processes the current GPS coordinates and distance measurement for transmission to a
remote server or cloud service.
The HTTPClient library is used to make an HTTP GET request to the Google Apps Script web app,
which acts as a bridge between the system and Google Sheets. The request includes the GPS
coordinates, distance measurement, and a timestamp as query parameters.
The Google Apps Script web app receives the HTTP request, extracts the data from the query
parameters, and appends the data to a designated Google Sheets spread sheet for storage and
analysis.
The LCD display shows the GPS coordinates and provides visual feedback about the road condition
by displaying either "Clean Road" or the actual distance measurement.
The system can be controlled remotely via a web interface or through a Wi-Fi connection, allowing
commands like "Forward," "Backward," "Left," "Right," and "Stop" to be sent to the microcontroller.
The microcontroller processes these commands and generates the appropriate control signals for the
motor driver, enabling the vehicle to move in the desired direction.
If any obstacles or potholes are detected (distance measurement falls below the threshold), the
system stops moving and displays a warning on the LCD, preventing potential damage to the vehicle.
The collected data in Google Sheets can be analysed and visualized to identify potential pothole
locations or track the vehicle's movement over time, providing valuable insights for road
maintenance and infrastructure planning.
Throughout the operation, the system follows a continuous loop, constantly monitoring the road
conditions, updating the GPS location, and transmitting relevant data to the remote server or cloud
service. The modular design and hierarchical architecture allow for easy integration, maintenance,
and potential future enhancements or modifications to the system.
Sure, I'll provide a detailed explanation of the traditional manual inspection system and proposed
pothole detection system without the diagrams.
25
Traditional Manual Inspection System
The traditional approach to pothole detection and road maintenance relies heavily on manual
inspection by crews or workers assigned by the responsible road maintenance authority or
organization. This method involves physically surveying and visually observing the road surface to
identify potholes, cracks, and other defects.
The process typically begins with the road maintenance authority assigning inspection crews or
teams to specific routes or areas. These crews then physically walk or drive along the designated
roads, carefully scrutinizing the surface for any signs of potholes, cracks, or other road defects.
During the inspection, crew members rely on their visual observation skills to identify and assess the
severity of the potholes or road defects. They may use basic tools, such as measuring tapes or rulers,
to roughly estimate the size and depth of the potholes. The data collected during the inspection is
typically recorded manually using paper forms, handheld devices, or other manual data recording
methods.
The manual data collection process can be time-consuming and prone to errors, as it relies heavily on
the individual crew member's judgment and attention to detail. Furthermore, the coverage area is
limited by the available workforce and the time it takes to physically inspect each road segment.
Once the inspection data is collected, it is compiled and analysed by the road maintenance authority
to prioritize and plan repair and maintenance activities. This process may involve manually
reviewing the data, creating maps or reports, and coordinating with different departments or
contractors responsible for executing the repairs.
While the manual inspection method is straightforward and does not require specialized equipment,
it has several limitations. These include limited coverage area, subjective assessments prone to
inconsistencies, inefficient data collection and management processes, and a lack of real-time
26
information. Additionally, the data collected during manual inspections may not accurately reflect the
current road conditions, as the conditions can change between inspection cycles.
In contrast to the traditional manual inspection system, proposed pothole detection system takes a
more automated, technology-driven, and decentralized approach. Instead of relying solely on manual
inspection crews, your system leverages various hardware components and integrated technologies to
automate the pothole detection process and collect data in real-time.
At the core of your system is a microcontroller, such as an Arduino board, which acts as the central
processing unit, coordinating the operations of various integrated hardware components. These
components include an ultrasonic sensor for pothole detection, a GPS module for location tracking, a
WiFi module for wireless communication, and a motor driver for controlling the vehicle's movement.
The ultrasonic sensor plays a crucial role in your system by automatically detecting potholes or
obstacles on the road. It works by emitting high-frequency sound waves and measuring the time it
takes for the reflected waves to return, allowing the calculation of the distance to the target object or
pothole.
The GPS module integrated into your system enables precise location tracking and mapping of the
detected pothole locations. As the system moves along the road, it continuously receives location
data from the GPS module, which is then associated with the pothole detections from the ultrasonic
sensor.
The WiFi module facilitates wireless communication and data transmission, allowing your system to
send the collected data, including pothole locations, GPS coordinates, and other relevant information,
to a cloud storage solution like Google Sheets. This real-time data transmission enables efficient
storage, analysis, and visualization of the collected data.
Furthermore, your system incorporates a data processing layer that handles tasks such as pothole
detection and classification, GPS mapping and navigation, and data analysis. This layer processes the
raw data collected from the hardware components and prepares it for storage and further analysis.
One of the key advantages of proposed system is its mobility and autonomy. Unlike traditional
manual inspection methods that rely on dedicated crews and vehicles, your system is designed to
operate independently, collecting data on the go without the need for a centralized authority or
dedicated inspection vehicles.
27
The modular and decentralized nature of your system architecture allows for potential scalability.
Multiple units equipped with the same architecture can be deployed, creating a distributed network
of pothole detection systems. This could potentially provide more comprehensive coverage and real-
time data collection across a larger area, compared to the traditional approach of a single dedicated
vehicle or limited inspection crews.
However, it's important to note that your system may have limitations in terms of the accuracy and
resolution of the pothole detection and classification, as it relies on a single ultrasonic sensor for
distance measurement. Additionally, the system's performance and data transmission may be
influenced by factors such as WiFi connectivity and cloud service availability.
Overall, proposed pothole detection system presents an innovative and decentralized approach,
leveraging the power of microcontrollers, integrated hardware components, wireless communication,
and cloud integration. While it may have some limitations, it offers significant improvements over
the traditional manual inspection method in terms of automation, real-time data collection, coverage,
and integration of various technologies, potentially providing a more efficient and comprehensive
solution for pothole detection and road maintenance management.
28
5. IMPLEMENTATION
5.1. Hardware Implementation
Choosing the appropriate microcontroller unit is crucial for your system. Options like the
Arduino boards (e.g., Arduino Uno, Mega) or more powerful boards like the ESP32 development
boards can be considered based on factors such as processing power, memory, and peripheral
support.
Setting up the microcontroller involves connecting it to a programming interface (e.g., Arduino
IDE, ESP-IDF), installing necessary drivers, and configuring the board for programming and
debugging.
The ultrasonic sensor, such as the HC-SR04, is responsible for detecting potholes or obstacles on
the road. This sensor works by emitting high-frequency sound waves and measuring the time it
takes for the reflected waves to return, allowing the calculation of the distance to the target object
or pothole.
Integrating the ultrasonic sensor involves connecting it to the appropriate pins on the
microcontroller unit, following the sensor's wiring diagram and guidelines.
29
Libraries or code modules specific to the ultrasonic sensor are integrated into the microcontroller
code. These libraries handle the communication with the sensor, triggering the ultrasonic pulses,
and calculating the distance based on the time-of-flight principle.
The GPS module, such as the NEO-6M from u-blox, is responsible for providing real-time
location data (latitude and longitude coordinates) to the system.
Integrating the GPS module involves connecting it to the microcontroller unit's serial
communication pins (e.g., UART) and following the module's wiring guidelines.
Libraries or code modules specific to the GPS module are integrated into the microcontroller
code. These libraries handle the communication with the module, parsing the raw GPS data, and
extracting relevant information such as latitude, longitude, speed, and time.
30
Figure 5.1.3 connecting NEO 6M to ESP-32
To enable wireless communication and data transmission, a WiFi module is integrated into the
system. Common options include the ESP8266 or ESP32 modules, which can be integrated as
separate components or as part of a development board like the ESP32.
Integrating the WiFi module involves connecting it to the appropriate pins on the microcontroller
unit, following the module's wiring guidelines.
Libraries or code modules specific to the WiFi module are integrated into the microcontroller
code. These libraries handle the WiFi connection establishment, configuration of network
settings, and wireless data transmission using protocols like HTTP or MQTT.
31
5. Motor Driver Integration:
A motor driver, such as the L298N dual H-bridge motor driver, is used to control the movement
of the vehicle or platform on which the system is mounted.
Integrating the motor driver involves connecting it to the appropriate pins on the microcontroller
unit, following the driver's wiring guidelines and connecting the motors to the driver's outputs.
Libraries or code modules specific to the motor driver are integrated into the microcontroller
code. These libraries handle the generation of control signals for the motor driver, allowing the
system to move in different directions (forward, backward, left, right) or stop when necessary.
An LCD display can be included in the system to provide visual feedback and display relevant
information, such as GPS coordinates, distance measurements, and system status.
Integrating the LCD display involves connecting it to the appropriate pins on the microcontroller
unit, following the display's wiring guidelines and communication protocol (e.g., I2C, SPI).
32
Libraries or code modules specific to the LCD display are integrated into the microcontroller
code. These libraries handle the communication with the display, sending commands to control
the display, and rendering text or graphics on the screen.
A suitable power supply, such as a battery pack or a regulated power source, is required to power
the microcontroller and all the integrated hardware components.
The power supply integration involves connecting the appropriate power rails to the
microcontroller unit and other components, following proper power distribution and management
practices.
Considerations should be given to factors such as voltage requirements, current draw, and power
efficiency to ensure reliable and long-lasting operation of the system.
The hardware components are housed in a sturdy enclosure or mounted on a platform, such as a
small robot or vehicle, to facilitate mobility and protect the components from environmental
factors like dust, moisture, and physical impacts.
The enclosure design should consider factors such as accessibility for maintenance, heat
dissipation, and cable management.
Mounting the system on a mobile platform involves securely attaching the enclosure or
individual components, ensuring proper weight distribution and stability during movement.
33
Detailed Design of The Project:
1. Microcontroller Programming:
34
2. Sensor Integration:
Libraries or code modules specific to the ultrasonic sensor and GPS module are integrated into
the microcontroller code.
For the ultrasonic sensor, the code handles triggering the ultrasonic pulses, measuring the time-
of-flight, and calculating the distance to the target object or pothole based on the sensor's
specifications and calibration.
For the GPS module, the code handles reading and parsing the raw GPS data, extracting relevant
information such as latitude, longitude, speed, and time, and potentially implementing filtering or
smoothing algorithms for improved accuracy.
3. Wi-Fi Communication:
The microcontroller code includes functionality for establishing a Wi-Fi connection, configuring
network settings (e.g., SSID, password), and handling wireless data transmission using the
integrated Wi-Fi module.
This may involve implementing TCP/IP communication protocols, creating client or server
sockets, and transmitting data using protocols like HTTP or MQTT.
Considerations should be given to factors such as network security, data encryption, and handling
potential connectivity issues or interruptions.
4. Cloud Integration:
Your system integrates with a cloud storage solution like Google Sheets for storing and analysing
the collected data (pothole locations, GPS coordinates, and other relevant information).
This integration involves making HTTP requests or utilizing APIs provided by the cloud service
to transmit the data to the cloud.
The code may need to handle tasks such as formatting the data for transmission, handling
authentication or authorization mechanisms, and managing the communication with the cloud
service.
5. Data Processing:
The microcontroller code incorporates algorithms and logic for pothole detection and
classification, GPS mapping and navigation, and data analysis.
35
For pothole detection and classification, the code may implement filtering techniques,
thresholding, and other signal processing methods to accurately detect and classify potholes
based on the ultrasonic sensor data.
For GPS mapping and navigation, the code may implement algorithms for calculating distances,
bearing, and routes based on the GPS coordinates, potentially integrating with mapping libraries
or APIs.
Data analysis may involve implementing statistical methods, machine learning algorithms, or
data visualization techniques to derive meaningful insights from the collected data.
6. Motor Control:
The code includes functions or modules to control the motor driver based on user input or
predefined patterns.
This may involve implementing control algorithms for smooth and precise movement, handling
obstacle avoidance, and ensuring the stability and safety of the system during movement.
Considerations should be given to factors such as motor torque, speed, and power consumption,
as well as potential slippage or traction issues.
Depending on the requirements, a user interface can be implemented to allow users to interact
with the system, such as providing manual control inputs or configuring system settings.
This may involve creating a graphical user interface (GUI) on a connected display or
implementing a web-based interface accessible through a local network or the internet.
The user interface code should handle user input, display relevant information, and provide
feedback or status updates to the user.
36
5.3. Source Code
#include <TinyGPS++.h>
#include <LiquidCrystal_I2C.h>
#include <Ultrasonic.h>
#include <WiFi.h>
#include <WebServer.h>
#define pingPin 13
#define echoPin 12
WebServer server(80);
WiFiServer wifiServer(80);
WiFiClient client; // Assuming you are using WiFiClient for communication with the client
37
Const char* googleScriptURL =
"https://script.google.com/macros/s/AKfycbygdKvHjbeYV6ZzS-
U_XlTSVHwwqcD_7yi2o2wIpN3KpBKmDiW_TJk-5H1_Bs8a5582/exec";
void setup() {
Serial.begin(9600);
pinMode(IN_1, OUTPUT);
pinMode(IN_2, OUTPUT);
pinMode(IN_3, OUTPUT);
pinMode(IN_4, OUTPUT);
lcd.setCursor(0, 0);
lcd.print("Connecting to WiFi...");
WiFi.begin(ssid, password);
delay(1000);
Serial.println("Connecting to WiFi...");
Serial.println("Connected to WiFi");
lcd.clear();
lcd.print("Connected to WiFi");
Serial.println(WiFi.localIP());
38
lcd.setCursor(0, 1);
lcd.print("IP");
lcd.print(WiFi.localIP());
wifiServer.begin();
server.on("/", handleRoot);
server.begin();
void loop() {
if (client) {
delay(1);
client.flush();
String command;
if (request.indexOf("F") != -1) {
39
} else if (request.indexOf("B") != -1) {
executeCommand(command);
client.println("Content-Type: text/plain");
client.println();
client.println("OK");
client.stop();
lcd.clear();
40
// Handle GPS data if available
while (Serial2.available()) {
gps.encode(Serial2.read());
if (gps.location.isValid()) {
lcd.setCursor(0, 0);
lcd.print("Lat: ");
lcd.print(gps.location.lat(), 6);
lcd.setCursor(0, 1);
lcd.print("Lng: ");
lcd.print(gps.location.lng(), 6);
url += "?Timestamp=";
url += timestamp;
url += "&Latitude=";
url += "&Longitude=";
url += "&Distance=";
url += String(distance_cm);
Serial.print(url);
41
// Make HTTP GET request to Google Apps Script web app
HTTPClient http;
http.begin(url);
if (httpResponseCode > 0) {
Serial.println(httpResponseCode);
Serial.println(payload);
} else {
Serial.println(httpResponseCode);
http.end();
if (gps.location.isValid()) {
Serial.println(gps.location.lat(), 6);
client.println(gps.location.lat(), 6);
Serial.println(gps.location.lng(), 6);
42
client.println(gps.location.lng(), 6);
if (gps.speed.isValid()) {
Serial.print(gps.speed.kmph());
Serial.println(" km/h");
} else {
Serial.print(gps.date.year());
Serial.print("-");
Serial.print(gps.date.month());
Serial.print("-");
Serial.print(gps.date.day());
Serial.print(" ");
Serial.print(gps.time.hour());
Serial.print(":");
Serial.print(gps.time.minute());
Serial.print(":");
Serial.println(gps.time.second());
} else {
43
}
Serial.print(distance_cm);
Serial.println(" cm");
Serial.println();
} else {a
lcd.setCursor(0, 0);
lcd.print("Clean Road");
Serial.println("Clean road");
client.println("Clean Road");
if (command == "F") {
// Move forward
digitalWrite(IN_1, HIGH);
digitalWrite(IN_2, LOW);
digitalWrite(IN_3, HIGH);
digitalWrite(IN_4, LOW);
// Move backward
digitalWrite(IN_1, LOW);
digitalWrite(IN_2, HIGH);
digitalWrite(IN_3, LOW);
44
digitalWrite(IN_4, HIGH);
// Turn left
digitalWrite(IN_1, LOW);
digitalWrite(IN_2, HIGH);
digitalWrite(IN_3, HIGH);
digitalWrite(IN_4, LOW);
// Turn right
digitalWrite(IN_1, HIGH);
digitalWrite(IN_2, LOW);
digitalWrite(IN_3, LOW);
digitalWrite(IN_4, HIGH);
// Stop
digitalWrite(IN_1, LOW);
digitalWrite(IN_2, LOW);
digitalWrite(IN_3, LOW);
digitalWrite(IN_4, LOW);
void handleRoot() {
45
// Check if the road is clear
} else {
while (Serial2.available()) {
gps.encode(Serial2.read());
if (gps.location.isValid()) {
} else {
46
Flutter App Source Code:
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
@override
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
);
@override
47
}
try {
print(url);
if (response.statusCode == 200) {
setState(() {
});
} else {}
} catch (e) {
print('Error: $e');
? "${coordinates.substring(0, maxCharacters)}..."
: coordinates;
48
}
return GestureDetector(
onTapDown: (_) {
sendCommand(command);
},
onTapUp: (_) {
sendCommand("S");
},
child: Container(
width: 100,
height: 50,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(
color: color.withOpacity(0.5),
spreadRadius: 2,
49
blurRadius: 5,
),
],
),
child: Center(
child: Text(
label,
@override
return Scaffold(
appBar: AppBar(
centerTitle: true,
),
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Padding(
50
child: Row(
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20.0),
),
child: TextField(
keyboardType: TextInputType.number,
decoration: InputDecoration(
border: InputBorder.none,
),
controller: ipaddress,
),
),
),
SizedBox(width: 20),
GestureDetector(
51
onTap: () {
if (ipaddress.text.isEmpty) {
ScaffoldMessenger.of(context).showSnackBar(
} else {
setState(() {
value = ipaddress.text;
});
},
child: Container(
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
borderRadius: BorderRadius.circular(20),
),
child: Text(
"Enter",
),
52
),
],
),
),
SizedBox(height: 20),
Text(
),
SizedBox(height: 10),
Text(
status,
overflow: TextOverflow.ellipsis,
maxLines: 2,
),
SizedBox(height: 20),
Expanded(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
53
const SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
],
),
],
),
),
),
],
),
);
54
Application Workflow:
The sendCommand function is responsible for sending commands to the robot via HTTP
requests.
It constructs the URL based on the entered IP address (value) and the command.
It uses the http package to make a GET request to the constructed URL.
If the response status code is 200 (OK), it updates the status variable with the response body
after truncating it to a maximum of 50 characters.
If an error occurs during the request, it catches the exception and prints the error message.
2. UI Widget Building:
The buildControlButton function creates custom control buttons with specified labels, colors,
and onTap handlers.
The onTapDown, onTapUp, and onTapCancel handlers are used to send commands to the robot
when the button is pressed, released, or canceled respectively.
3. UI Layout:
It contains a TextField for entering the IP address of the robot and a button for submitting the IP
address.
The status of the last command sent to the robot is displayed below the IP address.
Control buttons for sending commands (Forward, Backward, Left, Right, Stop) are displayed in a
column in the center of the screen.
Control buttons are arranged using Row and Column widgets within Expanded and Center
widgets to ensure proper layout.
55
4. UI Styling:
Control buttons have a gradient background, rounded corners, and a drop shadow effect for
visual appeal.
6. TESTING
6.3. Types of testing
Unit Testing:
The unit testing phase focuses on verifying the individual components of the system to ensure they
are functioning as expected. This includes thoroughly testing the ultrasonic sensor's distance
measurement capabilities. The test procedure involves placing the sensor at known distances from a
flat surface, such as 10 cm, 50 cm, 100 cm, 150 cm, and 200 cm, and recording the reported
distances. The measured values are then compared to the actual distances to calculate the error
percentage, which should be less than 5% for the sensor to be considered accurate.
Next, the GPS module is tested to validate the accuracy of the latitude, longitude, and time data. The
test setup involves connecting the GPS module to the ESP32 microcontroller and observing the GPS
data reported in the serial monitor or displayed on the LCD. The reported coordinates and time are
compared to a known reference, such as a smartphone GPS app, to ensure the GPS module is
providing reliable information. The maximum acceptable error for the GPS coordinates is 5 meters,
and the time should be accurate within 1 second.
The motor control functionality is also tested to verify that the motors are responding
correctly to the command inputs. The test procedure involves sending various control
commands, such as forward, backward, left, right, and stop, to the system and
observing the motor behavior. The motors should rotate in the expected directions and
stop as commanded, ensuring the motor control integration with the ESP32 is working
as intended.
56
Finally, the LCD display is tested to confirm that it is functioning properly and displaying the correct
information. This involves writing various test messages, including text, numbers, and special
characters, to the LCD and ensuring the content is clearly visible and legible. The backlight
functionality is also tested by turning it on and off to ensure it is working as expected.
Integration Testing:
The integration testing phase focuses on verifying the interactions between the different components
of the system. This includes testing the sensor integration, where the ultrasonic sensor and GPS
module data are read and processed by the ESP32 microcontroller.
The sensor integration test procedure involves connecting the ultrasonic sensor and GPS module to
the ESP32 and writing a test program that reads data from both sensors and prints the results to the
serial monitor. The ultrasonic sensor is placed in front of various objects at known distances, and the
reported distance values are observed to ensure they match the actual distances. The GPS data,
including latitude, longitude, and time, is also validated against a known reference to confirm the
accuracy of the integrated sensor data.
The motor control integration is tested by connecting the motor driver to the ESP32 and writing a
test program that controls the motors based on the ultrasonic sensor data. The test procedure involves
placing the ultrasonic sensor in front of various objects and observing the motor behaviour. When the
distance is greater than the threshold, the vehicle should move forward; when the distance is less
than or equal to the threshold, the vehicle should stop. This ensures the motor control commands are
being correctly generated and executed based on the sensor data.
Finally, the integration of the GPS data logging with the Google Sheets web app is tested. This
involves creating a Google Apps Script web app to receive the GPS data and modifying the ESP32
code to send the data to the web app. The test procedure involves running the system and observing
the GPS data being logged in the Google Sheets, verifying the accuracy and completeness of the
recorded information.
Functional Testing:
The functional testing phase focuses on verifying the overall functionality of the system. This
includes testing the pothole detection algorithm to ensure it accurately identifies obstacles and
responds accordingly.
57
The pothole detection test procedure involves creating a test environment with simulated potholes,
such as placing obstacles at various distances. The vehicle is then operated through the test
environment, and the system's ability to detect potholes (distances below the threshold) and respond
appropriately (e.g., stop the vehicle, trigger an alarm) is observed. The testing is conducted with
different pothole sizes, depths, and locations to ensure consistent performance.
The vehicle's navigation capabilities, including forward, backward, left, right, and stop commands,
are also thoroughly tested. The test procedure involves placing the vehicle in an open space and
sending the various navigation commands to the system, observing the vehicle's response to ensure it
matches the expected behaviour.
The data logging functionality, where the GPS data is recorded in the Google Sheets, is validated by
running the system and generating GPS data while the vehicle is in operation. The logged data is
then compared to the GPS information displayed on the LCD or reported in the serial monitor to
ensure consistency and accuracy.
Finally, the user interface, specifically the LCD display, is tested to verify that it is providing the user
with the correct and easily understandable information. This includes checking the display of pothole
detection status, GPS coordinates, and distance to the nearest obstacle.
Connectivity Testing:
The connectivity testing phase ensures that the system can properly communicate with the required
external components, such as the Wi-Fi network and the Google Apps Script web app.
The Wi-Fi connectivity test procedure involves powering on the system and observing the serial
monitor or LCD display for any Wi-Fi connection-related messages. The test verifies that the ESP32
is able to connect to the specified Wi-Fi network and obtain a valid IP address. The connectivity is
further tested by accessing the web server from a client device connected to the same network.
The web server testing procedure involves accessing the web server from a client device and
verifying that it is responding with the expected information, such as the pothole detection status and
GPS data. The responsiveness of the web server is also tested by simulating multiple concurrent
client connections to observe its performance under load.
The integration with the Google Apps Script web app is tested by modifying the ESP32 code to send
test GPS data to the web app. The test procedure involves observing the HTTP response codes from
58
the web app requests to ensure they are successful (response code 200 OK) and that the GPS data is
correctly received and processed by the web app.
Stress Testing:
The stress testing phase evaluates the system's performance under high-load conditions. This
includes testing the web server's ability to handle multiple concurrent client connections, the system's
capacity to manage a large volume of GPS data logging, and the stability of the pothole detection
algorithm under continuous operation.
The web server load testing involves using a load testing tool, such as Apache JMeter, to generate
multiple concurrent client connections to the web server. The number of concurrent connections is
gradually increased, and the system's response times, error rates, and resource utilization (CPU,
memory, network) are monitored to ensure the web server can handle the simulated load without
significant performance degradation or errors.
The GPS data logging stress test involves modifying the system to generate a high volume of
simulated GPS data and observing the data logging process, including the performance of the Google
Sheets integration. The system's resource utilization (CPU, memory, network) is monitored during
the test to ensure it can handle the high-volume data without experiencing issues or data loss.
The pothole detection stress test involves setting up a test environment with simulated potholes at
various distances and running the system continuously, with the pothole detection algorithm actively
monitoring the environment. The system's responsiveness, stability, and resource utilization are
observed to verify that the algorithm can run consistently without performance degradation or
stability issues.
End-to-End Testing:
The end-to-end testing phase evaluates the system as a whole in a real-world usage scenario. This
involves setting up the complete system, including the microcontroller, sensors, motor driver, and
user interface, and operating the vehicle through a test environment with simulated potholes and
obstacles.
The test procedure involves placing the vehicle in the test environment and observing the system's
ability to detect potholes, navigate the vehicle, log GPS data, and provide accurate information to the
user through the web interface and LCD display. The system's overall functionality, responsiveness,
59
and reliability are validated during this phase to ensure it meets the expected performance
requirements.
The final stage of testing involves gathering feedback from end-users to ensure the system meets
their requirements and expectations. This includes inviting a group of potential users, such as vehicle
owners or transportation authorities, to interact with the system and provide feedback on its usability,
relevance, and effectiveness.
The test procedure involves providing the users with the opportunity to operate the system and
observe its performance. Feedback is collected on aspects such as the ease of use and understanding
of the system's features, the usefulness and relevance of the pothole detection and GPS logging
capabilities, the effectiveness of the web interface and LCD display in providing information, and
any suggestions for improvements or additional features.
The user feedback is then analysed, and the necessary changes are incorporated to refine the system
and ensure it aligns with the end-users' needs and expectations. This user acceptance testing phase is
crucial for validating the system's real-world applicability and guiding the future development of the
project.
60
7. Web Application Development and Integration
7.1. Overview
The project team developed a web application using the Django Python framework to provide a
centralized platform for visualizing and analysing the pothole data collected by the detection system.
The web application serves as the primary interface for transportation authorities, road maintenance
teams, and other stakeholders to access, explore, and leverage the pothole information.
By integrating the web application with the data collected from the pothole detection system, the
project aims to enhance the visibility, collaboration, and decision-making capabilities around road
infrastructure maintenance and improvements.
Models: Responsible for defining the data structures and interacting with the database (e.g., storing
and retrieving pothole data).
Views: Handling the business logic and processing user requests, including fetching data from the
models and rendering the appropriate templates.
61
Templates: Representing the user interface and presentation layer, generating the HTML pages
displayed to the users.
The web application integrates with the Google Sheets API to fetch the pothole data collected by the
detection system. This data is then processed and visualized within the Django application.
Dashboard: The web application provides a comprehensive dashboard that offers an overview of the
pothole data, including visualizations such as:
Charts and graphs showing pothole density, severity, and other relevant metrics
Summary statistics and key performance indicators related to the road infrastructure condition
Pothole Exploration: Users can explore the pothole data in detail through various filtering and sorting
capabilities, allowing them to:
Sort the pothole data by various attributes to identify patterns and prioritize maintenance efforts
View detailed information about individual potholes, such as the precise GPS coordinates,
timestamp, and severity level
62
Reporting and Exporting: The web application offers the ability to generate reports and export the
pothole data in various formats, such as CSV or PDF. This enables users to share the information
with other stakeholders or incorporate it into their own analysis and planning processes.
User Management: For enhanced collaboration and access control, the web application includes user
management features, such as authentication, authorization, and role-based permissions. This ensures
that users can only access and modify the data they are authorized to interact with.
The web application is built using the Django web framework, which provides a robust and scalable
platform for developing Python-based web applications.
Key libraries and frameworks used in the development of the web application include:
Pandas: For data manipulation and processing of the pothole data fetched from the Google Sheets.
Matplotlib and Folium: For creating the interactive data visualizations, such as maps, chart, and
graphs.
Django Rest Framework: To build a RESTful API for integrating with the pothole detection system
and enabling data exchange.
Google Sheets API: To seamlessly retrieve the pothole data collected by the detection system and
incorporate it into the web application.
Leaflet: Leaflet is an open source JavaScript library used to build web mapping applications.
The web application fetches the pothole data from the Google Sheets by utilizing the Google Sheets
API. The Django views handle the API calls, process the data, and pass it to the templates for
visualization.
The data visualization features leverage libraries like Matplotlib and Folium to create interactive
maps, charts, and graphs that allow users to explore the pothole information.
63
The user management and access control functionalities are implemented using Django's built-in
authentication and authorization systems, ensuring that users can only access and modify the data
they are authorized to interact with.
The web application is designed to be responsive and mobile-friendly, ensuring a consistent user
experience across different devices and screen sizes.
The web application is tightly integrated with the pothole detection system developed as part of this
project.
The integration is achieved through a RESTful API, which allows the detection system to securely
transmit the collected pothole data to the web application.
Whenever the pothole detection system identifies a new pothole, it sends the relevant data (GPS
coordinates, timestamp, severity level, etc.) to the web application's API endpoint.
The web application then processes the incoming data, updates the database, and refreshes the
visualizations to ensure the users are viewing the most up-to-date information.
This seamless integration enables transportation authorities and road maintenance teams to access a
comprehensive and real-time view of the pothole situation, facilitating informed decision-making
and efficient resource allocation.
64
7.7. Web Application Screenshots
LOGIN.HTML:
{% extends "layouts/base.html" %}
{% block content %}
<div class="row">
<div class="col-md-5">
<div class="card">
65
<h4 class="card-title">
Login
</h4>
</div>
<div class="card-body">
<h6 class="card-category">
</h6>
<br />
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="bmd-label-floating">Username</label>
</div>
</div>
</div>
<br />
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label class="bmd-label-floating">Password</label>
66
</div>
</div>
</div>
<br />
<span class="pull-right">
</span>
<div class="clearfix"></div>
</form>
</div>
</div>
</div>
</div>
{% endblock content %}
DASHBOARD:
<div class="row">
<div class="col-lg-4">
67
<div class="card-icon">
<i class="material-icons">content_copy</i>
</div>
</div>
<div class="card-footer">
<div class="stats">
<div class="col-lg-4">
<div class="card-icon">
<i class="material-icons">schedule</i>
</div>
</div>
<div class="card-footer">
<div class="stats">
</div></div></div></div>
68
<div class="col-lg-4">
<div class="card-icon">
<i class="material-icons">assessment</i>
</div>
<div class="card-body large-card-body"> <!-- Use large-card-body class for the pie chart
card -->
<canvas id="pothole-severity-chart"></canvas>
</div></div>
<div class="card-footer">
<div class="stats">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.7.0/chart.min.js"></script>
<script>
function fetchAndDisplayPotholes() {
let url =
`https://sheets.googleapis.com/v4/spreadsheets/1g0NmTqPccq1MAHr3zHSWwPcDIV9FM1sfc
Wr1DBQE5bA/values/coordinates?key=AIzaSyAyNUU7x56kOALsjmqIxCMAORrIfpvLUCQ`;
fetch(url)
.then(response => {
if (!response.ok) {
69
}
return response.json();
})
.then(data => {
document.getElementById('total-potholes').textContent = totalPotholes;
document.getElementById('potholes-last-24h').textContent = potholesLast24h;
document.getElementById('safe-count').textContent = safeCount;
document.getElementById('intermediate-count').textContent = intermediateCount;
document.getElementById('danger-count').textContent = dangerCount;
} else {
}})
function calculatePotholesLast24h(potholesData) {
70
let potholesLast24hCount = 0;
// Iterate through potholes data and count potholes detected in last 24 hours
for (let i = 1; i < potholesData.length; i++) { // Start from index 1 to skip header row
potholesLast24hCount++;
}}
return potholesLast24hCount;
function calculatePotholeSeverity(potholesData) {
let safeCount = 0;
let intermediateCount = 0;
let dangerCount = 0;
for (let i = 1; i < potholesData.length; i++) { // Start from index 1 to skip header row
safeCount++;
intermediateCount++;
} else {
dangerCount++;
71
function createPotholeSeverityChart(safeCount, intermediateCount, dangerCount) {
type: 'pie',
data: {
datasets: [{
backgroundColor: [
'rgba(54, 162, 235, 0.6)', 'rgba(255, 206, 86, 0.6)', 'rgba(255, 99, 132, 0.6)'
],
borderColor: ['rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(255, 99, 132, 1)'
],
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false
});
72
8. RESULTS, DISCUSSION AND COMPARISON
8.1. Results
The comprehensive testing conducted on the various components of the pothole detection system has
yielded highly encouraging results. Starting with the ultrasonic sensor, the distance measurement
accuracy was thoroughly evaluated by placing the sensor at known distances ranging from 10 cm to
200 cm and comparing the reported values with the actual distances. The results showed that the
sensor provided distance measurements with an error of less than 3% across the entire tested range.
The maximum observed error was only 2.8% at the 200 cm distance, demonstrating the sensor's
exceptional precision.
Turning to the GPS module, the system was able to consistently acquire a fix and provide valid
latitude, longitude, and time data. When compared to a reference smartphone GPS app, the
maximum observed error was 3.2 meters for latitude and 4.1 meters for longitude, well within the
acceptable range for most navigation and mapping applications. The reported time was accurate
within 0.8 seconds of the reference, ensuring the GPS data could be reliably synchronized with the
other sensor inputs.
The motor control performance was also thoroughly tested, with the system successfully executing
the various command inputs (forward, backward, left, right, stop) and coordinating the left and right
motors to achieve the desired vehicle movements. No issues were observed in the responsiveness or
accuracy of the motor control subsystem.
The LCD display testing confirmed the functionality and clarity of the user interface. The display
accurately showed the test messages, including text, numbers, and special characters, without any
visual artifacts or legibility concerns. The backlight functionality also worked as expected, turning
on and off as commanded.
The integration of the ultrasonic sensor and GPS module with the ESP32 microcontroller was a
critical aspect of the system's development. The testing results demonstrate that the microcontroller
was able to accurately read and process the sensor data, with the pothole detection algorithm
correctly identifying obstacles based on the ultrasonic sensor readings and triggering the appropriate
vehicle response.
73
The GPS data logging to the Google Sheets was also successful, with the latitude, longitude, and
timestamp accurately recorded and stored for further analysis. This seamless integration of the GPS
data with the cloud-based spread sheet platform is a key feature of the system, enabling
transportation authorities and road maintenance teams to access and review the pothole location data.
The system's connectivity and web server performance were extensively tested, and the results were
highly satisfactory. The ESP32 microcontroller was able to reliably connect to the designated Wi-Fi
network, and the web server was able to handle client requests and integrate with the Google Apps
Script web app for the GPS data logging functionality.
The stress testing of the system further reinforced its reliability and scalability. The web server was
able to handle up to 50 concurrent client connections without significant performance degradation or
errors, demonstrating its ability to support multiple users accessing the system simultaneously. The
system also successfully logged a high volume of simulated GPS data, up to 1,000 entries per
minute, without any data loss or noticeable impact on system performance. Additionally, the pothole
detection algorithm ran continuously for extended periods without stability issues or excessive
CPU/memory utilization, indicating the system's robustness under demanding operating conditions.
The final stage of testing involved an end-to-end validation of the integrated system in a real-world
usage scenario. The results showed that the system was able to effectively detect potholes, navigate
the vehicle accordingly, and log the GPS data in the Google Sheets. The web interface and LCD
display provided the user with accurate and timely information, including the pothole detection
status, GPS coordinates, and distance to obstacles, enhancing the overall user experience and
transparency.
74
Output Screens showing the User Interface Work of the project.
File Structure
75
Python manage.py run server
LOGIN.HTML:
76
DASHBOARD:
REPORT A POTHOLE:
77
UPDATE POTHOLE :
POTHOLE DATA:
78
MAP VIEW:
8.2. Discussion
The consistently positive results obtained across the various testing phases demonstrate the overall
effectiveness and reliability of the pothole detection system. The high accuracy of the sensors,
particularly the ultrasonic sensor and GPS module, is a testament to the careful selection and
integration of the hardware components. The robust motor control and data processing capabilities
79
ensure that the system can accurately detect potholes and respond appropriately, mitigating the risks
associated with driving over these road hazards.
The seamless integration of the different subsystems, including the sensor data processing, motor
control, and Google Sheets integration, highlights the system's ability to function as a cohesive and
well-coordinated unit. This integration is a crucial factor in ensuring the system's overall
performance and reliability, as it enables the seamless flow of information and the coordinated
response to detected potholes.
The provision of real-time information to the user through the web interface and LCD display is a
particularly noteworthy aspect of the system. By offering users immediate feedback on the vehicle's
status and the detected obstacles, the system enhances transparency and enables informed decision-
making. This user-centric approach aligns with the project's goal of providing a comprehensive and
user-friendly pothole detection solution.
The user acceptance testing phase provided valuable feedback from the end-users, which can be
leveraged to further refine the system's features and improve its overall user experience.
Incorporating the users' suggestions and addressing their concerns will ensure the system remains
relevant and meets the evolving needs of transportation authorities, road maintenance teams, and
individual vehicle owners.
8.3. Comparison
When compared to existing pothole detection systems, the developed project offers several key
advantages that set it apart from the competition.
Firstly, the comprehensive sensor integration, combining the ultrasonic sensor and GPS module,
provides a more robust and versatile detection solution. By addressing both the identification of
potholes and the precise logging of their locations, the system can deliver a more complete and
accurate picture of the road conditions. This combined approach enhances the system's overall utility
and value proposition, as it addresses the critical needs of various stakeholders, from transportation
authorities to individual vehicle owners.
80
Secondly, the integration with the Google Sheets web app enables seamless data logging,
streamlining the process of collecting and analysing pothole information. This cloud-based data
storage and management solution allows for easy access and sharing of the logged data, facilitating
collaboration among transportation authorities, road maintenance teams, and other interested parties.
This feature significantly improves the system's scalability and the efficiency of the pothole
monitoring and mitigation efforts.
The responsive user interface, with the web-based access and LCD display, is another key advantage
of the developed system. By offering users real-time feedback on the vehicle's status and the detected
obstacles, the system enhances the overall user experience and transparency. This user-centric
approach sets the project apart from more basic or specialized pothole detection systems, making it
more accessible and appealing to a wider range of users.
Additionally, the system's ability to handle multiple concurrent client connections and high-volume
GPS data logging demonstrates its scalability and resilience, making it suitable for deployment in
larger-scale applications. This scalability, coupled with the cost-effective implementation using
affordable and widely available components, such as the ESP32 microcontroller, ultrasonic sensor,
and GPS module, further enhances the system's competitiveness and potential for widespread
adoption.
The comprehensive testing results and the system's advantages over existing solutions highlight its
potential for practical deployment and further optimization in real-world scenarios. The combination
of sensor accuracy, data processing capabilities, user-friendly interface, and scalable architecture
positions the developed pothole detection project as a compelling and innovative solution in the field
of road infrastructure monitoring and maintenance.
81
9. REFERENCES
1. Pothole Detection System, By. Mr. S. R. Kokane; Hrithik Sharma; Mitali Raghwani;
Shreyash Khambalkar; Publish by IJARSCT (2022)
5. F. Orhan and P. E. Eren, “Road hazard detection and sharing with multimodal sensor
analysis on smartphones,” in Proc. 7th Int. Conf. Next Generat. Mobile Apps, Services
Technol., Sep. 2013, pp. 56–61.
82