0% found this document useful (0 votes)
20 views82 pages

Hemanth finalYearProject

The document presents a project report on the 'Real-Time Pothole Detection and Road Condition Monitoring System' developed by students of Andhra University for their Bachelor of Technology degree. The system utilizes IoT technology, including ultrasonic sensors and GPS modules, to detect potholes and report their locations in real-time, facilitating timely maintenance and enhancing road safety. The project aims to address the challenges of traditional manual inspections by providing an automated solution for road condition monitoring, ultimately contributing to improved transportation infrastructure.

Uploaded by

hemanthxox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views82 pages

Hemanth finalYearProject

The document presents a project report on the 'Real-Time Pothole Detection and Road Condition Monitoring System' developed by students of Andhra University for their Bachelor of Technology degree. The system utilizes IoT technology, including ultrasonic sensors and GPS modules, to detect potholes and report their locations in real-time, facilitating timely maintenance and enhancing road safety. The project aims to address the challenges of traditional manual inspections by providing an automated solution for road condition monitoring, ultimately contributing to improved transportation infrastructure.

Uploaded by

hemanthxox
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

REAL-TIME POTHOLE DETECTION AND ROAD CONDITION

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

COMPUTER SCIENCE AND SYSTEMS ENGINEERING

Submitted by

ZELALEM TESEMMA 320106410076


BILLA CHAITANYA KUMAR 320106410077
CHALUMURU HEMANTH SAI 320106410078
JULIA GRACE MUDDADA 320106410079

Under the guidance of

Prof. I. S. SRINIVASA RAO


Professor
Department of CS&SE

DEPARTMENT OF COMPUTER SCIENCE AND SYSTEMS ENGINEERING

ANDHRA UNIVERSITY COLLEGE OF ENGINEERING

ANDHRA UNIVERSITY, VISAKHAPATNAM – 530003

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.

Signature of Project guide Signature of Head of The Department


Prof. I. S. SRINIVASA RAO Prof. K. VENKATA RAO
Professor Head Of The Department
Department of Computer Science Department of Computer Science
and Systems Engineering (CS&SE) and Systems Engineering (CS&SE)

Signature of the Examiner

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)

CH. HEMANTH SAI


(Reg.No:320106410078)

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. D. LALITHA BHASKARI, Chairperson, Board of Studies,


Computer Science and Systems Engineering, Andhra University College of Engineering for her keen
interest and for providing the 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.

Keywords: Pothole Detection, Ultrasonic Sensor, GPS, IOT, Arduino

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.2 Problem statement 10

1.3 Project Aim and objectives 11

1.4 Motivation 12

2. LITERATURE SURVEY 13

3. REQUIREMENT ANALYSIS 15

3.1 Functional Requirements 15

3.2 Non-Functional Requirements 16

3.3 Software & Hardware Requirements 16

3.4 Software Description 17

4. SYSTEM ARCHITECTURE, DESIGN AND METHODOLOGY 19

4.1. System Architecture 19

4.2. Design and Methodology 21

5. IMPLEMENTATION 29

5.1. Hardware Implementation 29

5.2. Software Implementation 34

6
6. TESTING 56

6.1. Types of Testing 56

7. Web Application Development and Integration 61

7.1. Overview 61

7.2. Web Application Architecture 61

7.3. Key Features 62

7.4. Technologies and Libraries 63

7.5. Implementation Details 64

7.6. Integration with Pothole Detection System 64

7.7. Web Application Code 65

8. RESULTS, DISCUSSION AND COMPARISON 73

8.1. Results 73

8.2. User Interface 72

8.3. Discussion 79

8.4. Comparison 80

9. REFERENCES 82

7
LIST OF FIGURES PAGE NO

Figure 4.1.3 System Architecture 19

Figure 4.1.3 Workflow 20

Figure 4.2.1 ESP-32 Microcontroller 21

Figure 4.2.2 NEO6M GPS 21

Figure 4.2.3 HC-SR04 22

Figure 4.2.4 16X2 I2C Display 24

Figure 4.2.4 L298N Motor Driver 23

Figure 4.2.5 12V DC Motor 23

Figure 5.1.1 ESP-32 Microcontroller 29

Figure 5.1.2 connecting Ultrasonic sensor to ESP-32 30

Figure 5.1.3 connecting NEO 6M to ESP-32 31

Figure 5.1.4 connecting L298N Motor Driver to ESP-32 32

Figure 5.1.5 connecting 16X2 I2C Display to ESP-32 33

Figure 5.1.6 Detailed Design of hardware 34

Figure 7.1.1 Web Application Framework 61

Figure 7.1.2 Web Application Architecture 62

Figure 7.7.1 Google Sheets Database 65

Figure 8.1.1 File Structure 75

Figure 8.1.2 Server 76

Figure 8.1.3 Dashboard 77

Figure 8.1.4 Pothole Data 78

Figure 8.1.5 Map View 79

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.

The specific objectives of the project are:

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.

4. Establish user-friendly interfaces and documentation: A key objective is to develop user-


friendly interfaces and comprehensive documentation to support the deployment, operation, and
maintenance of the system by engineers, hobbyists, and road authorities. This will involve creating
intuitive graphical user interfaces (GUIs), detailed installation and setup guides, and troubleshooting
resources to ensure seamless adoption and utilization of the system.

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.

3. Environmental Benefits: Well-maintained roads contribute to reduced fuel consumption and


emissions, promoting environmental sustainability. Potholes and uneven surfaces can increase
vehicle rolling resistance, leading to higher fuel consumption and increased greenhouse gas
emissions. By identifying and addressing these issues promptly, the system can indirectly contribute
to reducing the environmental impact of transportation and support sustainable mobility initiatives.

4. Technological Innovation: This project leverages cutting-edge technologies and introduces


innovative solutions to address a critical infrastructure challenge, advancing the field of smart city
initiatives and Internet of Things (IoT) applications

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.

2. "ROAD POTHOLE DETECTION USING ULTRASONIC SENSORS” by Kalpana


Ettikyala, Assistant Professor, CSE Department CBIT, Gandipet, Hyderabad, India. (2022) - The
proposed solution in this paper is an Arduino-based module for Pothole Detection and Warning
System, aimed at assisting drivers in avoiding potholes by issuing prior warnings
.
The system incorporates ultrasonic sensors mounted on the exterior of the vehicle to broadcast data,
alerting the driver through an alarm and displaying the distance on an LCD panel, thereby preventing
major damages or accidents. In this we can see the utilization of HC SR-04 ultrasonic sensor for
detecting potholes, highlighting its features and functionality.

3. "Pothole Detection System” by Mr. S. R. Kokane, Hrithik Sharma, Mitali Raghwani,


Shreyash Khambalkar, Guide, Department of Electronics and Telecommunication, All India Shri
Shivaji Memorial Society Institute of Information Technology, Pune, India. This paper provides a
comprehensive overview of interfacing hardware components with Arduino for diverse applications.
Beginning with the HCSR04 ultrasonic sensor, which necessitates a 3.3V power source and digital
pin connections for distance calculation, the process emphasizes the importance of proper power
management and serial communication for data acquisition.

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

3.1 Functional Requirements

1. Pothole and Road Hazard Detection

- 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).

- Measurement of depth and size of detected potholes and hazards.

2. GPS Tracking and Mapping

- 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.

3. Cloud Integration and Data Storage

- 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.

4. Data Analysis and Reporting

- 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

1. Reliability and Accuracy

- 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.

2. Robustness and Durability

- Ability to withstand various environmental conditions (temperature, moisture, vibrations) for


reliable operation.

- Rugged and durable hardware components capable of withstanding minor impacts or shocks.

3. Scalability and Extensibility

- 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

- User-friendly interface for monitoring, controlling, and analysing collected data.

- Intuitive and easy-to-navigate interface with clear visualizations and reporting capabilities.

3.3 Software & Hardware Requirements

Software Requirements

- Arduino IDE or compatible development environment

- Libraries for interfacing with ultrasonic sensors, GPS modules, and wireless communication
modules

- Cloud integration libraries or APIs (e.g., Google Sheets API)

- Data processing and analysis libraries or tools

- User interface development tools or frameworks

Hardware Requirements

16
- Arduino microcontroller board (e.g., Arduino Uno, Mega)

- Ultrasonic sensor module (e.g., HC-SR04)

- GPS module (e.g., NEO-6M)

- Wireless communication module (e.g., ESP8266, Wi-Fi module)

- Motor driver and DC motors for autonomous navigation

- Power supply (batteries, solar panels, or other sources)

- Enclosure or chassis for mounting components

- Additional components (e.g., breadboards, jumper wires, connectors)

3.4 Software Description

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

4.1 System Architecture

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:

Figure 4.1.3 System Architecture

The system architecture consists of the following layers:

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.

Figure 4.1.3 Workflow

20
4.2 Design and Methodology

4.2.1 Hardware Components

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.

Figure 4.2.1 ESP-32 Microcontroller

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.

Figure 4.2.2 NEO6M GPS

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.

Figure 4.2.3 HC-SR04

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.

Figure 4.2.4 16X2 I2C Display

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.

Figure 4.2.4 L298N Motor Driver

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.

Figure 4.2.5 12V DC Motor

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.

4.2.4 Proposed Pothole Detection System

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

1. Microcontroller Unit (MCU) Selection and Setup:

 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.

Figure 5.1.1 ESP-32 Microcontroller

2. Ultrasonic Sensor Integration:

 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.

Figure 5.1.2 connecting Ultrasonic sensor to ESP-32

3. GPS Module Integration:

 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

4. WiFi Module Integration:

 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.

Figure 5.1.4 connecting L298N Motor Driver to ESP-32

6. LCD Display Integration (Optional):

 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.

Figure 5.1.5 connecting 16X2 I2C Display to ESP-32

7. Power Supply Integration:

 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.

8. Enclosure and Mounting:

 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:

Figure 5.1.6 Detailed Design of hardware

5.2. Software Implementation

1. Microcontroller Programming:

 The microcontroller unit is programmed using a suitable programming language and


development environment, such as the Arduino IDE for Arduino boards or C/C++ with the ESP-
IDF for ESP32 boards.
 The code handles the communication and coordination between the various hardware
components, as well as data processing, decision-making, and transmission.
 The programming process involves setting up the development environment, writing and
organizing the code into modular functions or classes, and implementing algorithms and logic for
different system functionalities.

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.

7. User Interface (Optional):

 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>

#include <HTTPClient.h> // Include the HTTPClient library

#define GPS_BAUDRATE 9600 // The default baudrate of NEO-6M is 9600

#define pingPin 13

#define echoPin 12

#define MAX_DISTANCE 200 // Maximum distance we want to ping for

(in centimeters). Maximum sensor distance is rated at 400-500cm.

TinyGPSPlus gps; // the TinyGPS++ object

Ultrasonic ultrasonic(pingPin, echoPin); // Create an Ultrasonic object

const char* ssid = "chalumuru_4G";

const char* password = "wxu8694@WX";

WebServer server(80);

// Motor control pins

#define IN_1 33 // L298N in1 motors Right GPIO15(D1)

#define IN_2 32 // L298N in2 motors Right GPIO13(D2)

#define IN_3 25 // L298N in3 motors Left GPIO2(D3)

#define IN_4 26 // L298N in4 motors Left GPIO2(D4)

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";

LiquidCrystal_I2C lcd(0x27, 16, 2);

void executeCommand(String command);

void setup() {

Serial.begin(9600);

pinMode(IN_1, OUTPUT);

pinMode(IN_2, OUTPUT);

pinMode(IN_3, OUTPUT);

pinMode(IN_4, OUTPUT);

lcd.init(); // Initialize the LCD

lcd.backlight(); // Turn on the backlight

lcd.clear(); // Clear the LCD screen

lcd.setCursor(0, 0);

lcd.print("Connecting to WiFi...");

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {

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());

delay(10000); // Display for 2 seconds

wifiServer.begin();

server.on("/", handleRoot);

server.begin();

void loop() {

server.handleClient(); // Handle incoming client connections

// Check for incoming client connections

WiFiClient client = wifiServer.available();

if (client) {

// Wait until the client sends some data

while (client.connected() && !client.available()) {

delay(1);

// Read the first line of the request

String request = client.readStringUntil('\r');

client.flush();

// Extract the command from the request

String command;

if (request.indexOf("F") != -1) {

command = "F"; // Move forward

39
} else if (request.indexOf("B") != -1) {

command = "B"; // Move backward

} else if (request.indexOf("L") != -1) {

command = "L"; // Turn left

} else if (request.indexOf("R") != -1) {

command = "R"; // Turn right

} else if (request.indexOf("S") != -1) {

command = "S"; // Stop

// Execute the command

executeCommand(command);

// Send HTTP response

client.println("HTTP/1.1 200 OK");

client.println("Content-Type: text/plain");

client.println();

client.println("OK");

// Close the connection

client.stop();

// Measure the distance in centimeters

long distance_cm = ultrasonic.distanceRead();

lcd.clear();

// Check if the road is clear

if (distance_cm > 25) {

40
// Handle GPS data if available

while (Serial2.available()) {

gps.encode(Serial2.read());

// If GPS data is valid, send it to Google Sheets

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);

String timestamp = String(gps.time.hour()) + ":" + String(gps.time.minute()) + ":" +


String(gps.time.second());

// Construct the query parameters

String url = googleScriptURL;

url += "?Timestamp=";

url += timestamp;

url += "&Latitude=";

url += String(gps.location.lat(), 6);

url += "&Longitude=";

url += String(gps.location.lng(), 6);

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);

int httpResponseCode = http.GET();

if (httpResponseCode > 0) {

Serial.print("HTTP Response code: ");

Serial.println(httpResponseCode);

String payload = http.getString();

Serial.println(payload);

} else {

Serial.print("Error code: ");

Serial.println(httpResponseCode);

http.end();

// Print GPS information

if (gps.location.isValid()) {

Serial.print("- latitude: ");

Serial.println(gps.location.lat(), 6);

client.print("- latitude: ");

client.println(gps.location.lat(), 6);

Serial.print("- longitude: ");

Serial.println(gps.location.lng(), 6);

client.print("- longitude: ");

42
client.println(gps.location.lng(), 6);

if (gps.speed.isValid()) {

Serial.print("- speed: ");

Serial.print(gps.speed.kmph());

Serial.println(" km/h");

} else {

Serial.println("- speed: INVALID");

if (gps.date.isValid() && gps.time.isValid()) {

Serial.print("- GPS date&time: ");

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 {

Serial.println("- GPS date&time: INVALID");

43
}

Serial.print("- Distance: ");

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");

void executeCommand(String command) {

if (command == "F") {

// Move forward

digitalWrite(IN_1, HIGH);

digitalWrite(IN_2, LOW);

digitalWrite(IN_3, HIGH);

digitalWrite(IN_4, LOW);

} else if (command == "B") {

// Move backward

digitalWrite(IN_1, LOW);

digitalWrite(IN_2, HIGH);

digitalWrite(IN_3, LOW);

44
digitalWrite(IN_4, HIGH);

} else if (command == "L") {

// Turn left

digitalWrite(IN_1, LOW);

digitalWrite(IN_2, HIGH);

digitalWrite(IN_3, HIGH);

digitalWrite(IN_4, LOW);

} else if (command == "R") {

// Turn right

digitalWrite(IN_1, HIGH);

digitalWrite(IN_2, LOW);

digitalWrite(IN_3, LOW);

digitalWrite(IN_4, HIGH);

} else if (command == "S") {

// Stop

digitalWrite(IN_1, LOW);

digitalWrite(IN_2, LOW);

digitalWrite(IN_3, LOW);

digitalWrite(IN_4, LOW);

void handleRoot() {

// Measure the distance in centimeters

long distance_cm = ultrasonic.distanceRead();

45
// Check if the road is clear

if (distance_cm <= 25) {

server.send(200, "text/html", "Clean Road");

} else {

// Handle GPS data if available

while (Serial2.available()) {

gps.encode(Serial2.read());

// Print GPS information

if (gps.location.isValid()) {

String response = "Latitude: " + String(gps.location.lat(), 6) + "<br>";

response += "Longitude: " + String(gps.location.lng(), 6);

server.send(200, "text/html", response);

} else {

server.send(200, "text/html", "GPS data not available");

46
Flutter App Source Code:

import 'package:flutter/material.dart';

import 'package:http/http.dart' as http;

void main() {

runApp(const MyApp());

class MyApp extends StatelessWidget {

const MyApp({Key? key}) : super(key: key);

@override

Widget build(BuildContext context) {

return MaterialApp(

debugShowCheckedModeBanner: false,

title: 'Robot Control App',

theme: ThemeData(

primarySwatch: Colors.blue,

),

home: const MyHomePage(),

);

class MyHomePage extends StatefulWidget {

const MyHomePage({Key? key}) : super(key: key);

@override

_MyHomePageState createState() => _MyHomePageState();

47
}

class _MyHomePageState extends State<MyHomePage> {

String status = "Status: ";

TextEditingController ipaddress = TextEditingController();

String value = "null";

void sendCommand(String command) async {

try {

String url = "http://$value/?State=$command";

print(url);

final response = await http.get(Uri.parse(url));

if (response.statusCode == 200) {

setState(() {

status = "Status: ${truncateCoordinates(response.body)}";

});

} else {}

} catch (e) {

print('Error: $e');

String truncateCoordinates(String coordinates) {

const int maxCharacters = 50;

return coordinates.length > maxCharacters

? "${coordinates.substring(0, maxCharacters)}..."

: coordinates;

48
}

Widget buildControlButton(String command, String label, Color color) {

return GestureDetector(

onTapDown: (_) {

sendCommand(command);

},

onTapUp: (_) {

sendCommand("S");

},

onTapCancel: () => sendCommand("S"),

child: Container(

width: 100,

height: 50,

decoration: BoxDecoration(

gradient: LinearGradient(

colors: [color.withOpacity(0.8), color.withOpacity(1.0)],

begin: Alignment.topCenter,

end: Alignment.bottomCenter,

),

borderRadius: BorderRadius.circular(10),

boxShadow: [

BoxShadow(

color: color.withOpacity(0.5),

spreadRadius: 2,

49
blurRadius: 5,

offset: const Offset(0, 2),

),

],

),

child: Center(

child: Text(

label,

style: const TextStyle(

color: Colors.white, fontWeight: FontWeight.bold),

@override

Widget build(BuildContext context) {

return Scaffold(

backgroundColor: Colors.grey[900], // Changed background color

appBar: AppBar(

backgroundColor: Colors.grey[900], // Changed app bar color

title: const Text('Robot Control App'),

centerTitle: true,

),

body: Column(

mainAxisAlignment: MainAxisAlignment.start,

children: <Widget>[

Padding(

padding: const EdgeInsets.symmetric(horizontal: 20),

50
child: Row(

children: [

Expanded(

child: Container(

padding: const EdgeInsets.symmetric(horizontal: 10),

decoration: BoxDecoration(

color: Colors.white,

borderRadius: BorderRadius.circular(20.0),

),

child: TextField(

style: TextStyle(color: Colors.black),

keyboardType: TextInputType.number,

decoration: InputDecoration(

border: InputBorder.none,

hintText: 'Enter IP Address',

hintStyle: TextStyle(color: Colors.grey),

contentPadding: EdgeInsets.all(15), // Added padding

),

controller: ipaddress,

),

),

),

SizedBox(width: 20),

GestureDetector(

51
onTap: () {

if (ipaddress.text.isEmpty) {

ScaffoldMessenger.of(context).showSnackBar(

SnackBar(content: Text("IP address is empty")));

} else {

setState(() {

value = ipaddress.text;

});

},

child: Container(

padding: EdgeInsets.all(15),

decoration: BoxDecoration(

gradient: LinearGradient(

colors: [Colors.blue, Colors.lightBlueAccent],

begin: Alignment.topCenter,

end: Alignment.bottomCenter,

),

borderRadius: BorderRadius.circular(20),

),

child: Text(

"Enter",

style: TextStyle(color: Colors.white),

),

52
),

],

),

),

SizedBox(height: 20),

Text(

"IP Address : $value",

style: TextStyle(color: Colors.white),

),

SizedBox(height: 10),

Text(

status,

style: TextStyle(fontSize: 16, color: Colors.white),

overflow: TextOverflow.ellipsis,

maxLines: 2,

),

SizedBox(height: 20),

Expanded(

child: Center(

child: Column(

mainAxisAlignment: MainAxisAlignment.center,

children: <Widget>[

buildControlButton("F", "Forward", Colors.green),

53
const SizedBox(height: 10),

Row(

mainAxisAlignment: MainAxisAlignment.spaceEvenly,

children: [

buildControlButton("L", "Left", Colors.orange),

buildControlButton("S", "Stop", Colors.red),

buildControlButton("R", "Right", Colors.orange),

],

),

const SizedBox(height: 10),

buildControlButton("B", "Backward", Colors.blue),

],

),

),

),

],

),

);

54
Application Workflow:

1. HTTP Request Handling:

 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.

 It returns a GestureDetector wrapped Container widget with specified width, height,


decoration, and child Text widget.

 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:

 The MyHomePage class represents the main page of the app.

 It contains a TextField for entering the IP address of the robot and a button for submitting the IP
address.

 The entered IP address (value) is displayed below the text field.

 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:

 The app's background color is set to Colors.grey[900].

 The app bar's background color is also set to Colors.grey[900].

 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.

User Acceptance Testing:

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.

Figure 7.1.1 Web Application Framework

7.2. Web Application Architecture

The web application follows a Model-View-Template (MVT) architectural pattern, which is a


variation of the Model-View-Controller (MVC) pattern commonly used in Django projects.

The key components of the web application's architecture include:

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.

Figure 7.1.2 Web Application Architecture

7.3. Key Features

Dashboard: The web application provides a comprehensive dashboard that offers an overview of the
pothole data, including visualizations such as:

Interactive map displaying the locations of detected potholes

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:

Filter potholes based on location, severity, date of detection, or other criteria

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.

7.4. Technologies and Libraries

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.

7.5. Implementation Details

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.

7.6. Integration with Pothole Detection System

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

Google sheets DataBase:

Figure 7.7.1 Google Sheets Database

LOGIN.HTML:

{% extends "layouts/base.html" %}

{% block title %} Login {% endblock %}

<!-- Specific Page CSS goes HERE -->

{% block stylesheets %}{% endblock stylesheets %}

{% block content %}

<div class="row">

<div class="col-md-5">

<div class="card">

<div class="card-header card-header-primary">

65
<h4 class="card-title">

Login

</h4>

</div>

<div class="card-body">

<h6 class="card-category">

Add your credentials

</h6>

<br />

<form role="form" action="/">

<div class="row">

<div class="col-md-12">

<div class="form-group">

<label class="bmd-label-floating">Username</label>

<input type="text" class="form-control" placeholder="Username">

</div>

</div>

</div>

<br />

<div class="row">

<div class="col-md-12">

<div class="form-group">

<label class="bmd-label-floating">Password</label>

<input type="password" class="form-control" placeholder="Password">

66
</div>

</div>

</div>

<br />

<button type="submit" name="login" class="btn btn-primary pull-left">Login</button>

&nbsp; &nbsp;

<span class="pull-right">

Don't have an account? <a href="/register.html" class="text-primary">Create</a>

</span>

<div class="clearfix"></div>

</form>

</div>

</div>

</div>

</div>

{% endblock content %}

<!-- Specific Page JS goes HERE -->

{% block javascripts %}{% endblock javascripts %}

DASHBOARD:

<div class="row">

<div class="col-lg-4">

<div class="card card-stats small-card-body">

<div class="card-header card-header-warning card-header-icon">

67
<div class="card-icon">

<i class="material-icons">content_copy</i>

</div>

<p class="card-category">Total Potholes</p>

<h3 class="card-title" id="total-potholes">Loading...</h3>

</div>

<div class="card-footer">

<div class="stats">

<i class="material-icons text-danger">warning</i>

<a href="#pablo">Get More Space...</a>

</div></div> </div> </div>

<div class="col-lg-4">

<div class="card card-stats small-card-body">

<div class="card-header card-header-info card-header-icon">

<div class="card-icon">

<i class="material-icons">schedule</i>

</div>

<p class="card-category">Potholes Detected in Last 24 Hours</p>

<h3 class="card-title" id="potholes-last-24h">Loading...</h3>

</div>

<div class="card-footer">

<div class="stats">

<i class="material-icons">access_time</i> Last updated: <span id="last-


updated">N/A</span>

</div></div></div></div>

68
<div class="col-lg-4">

<div class="card card-stats">

<div class="card-header card-header-success card-header-icon">

<div class="card-icon">

<i class="material-icons">assessment</i>

</div>

<p class="card-category">Pothole Severity</p>

<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">

<i class="material-icons">info_outline</i> Safe: <span id="safe-count">0</span>,


Intermediate: <span id="intermediate-count">0</span>, Danger: <span id="danger-
count">0</span></div></div> </div> </div></div>

<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) {

throw new Error(`Network response was not ok (status ${response.status})`);

69
}

return response.json();

})

.then(data => {

if (data && data.values && data.values.length > 0) {

const totalPotholes = data.values.length - 1; // Subtracting 1 to exclude header row

document.getElementById('total-potholes').textContent = totalPotholes;

const potholesLast24h = calculatePotholesLast24h(data.values);

document.getElementById('potholes-last-24h').textContent = potholesLast24h;

const { safeCount, intermediateCount, dangerCount } =


calculatePotholeSeverity(data.values);

document.getElementById('safe-count').textContent = safeCount;

document.getElementById('intermediate-count').textContent = intermediateCount;

document.getElementById('danger-count').textContent = dangerCount;

createPotholeSeverityChart(safeCount, intermediateCount, dangerCount);

document.getElementById('last-updated').textContent = new Date().toLocaleString();

} else {

console.error('Error: No data returned from the Google Sheets API');

}})

.catch(error => console.error('Error fetching pothole data:', error)); }

// Function to calculate number of potholes detected in last 24 hours

function calculatePotholesLast24h(potholesData) {

const currentDate = new Date();

const twentyFourHoursAgo = currentDate - (24 * 60 * 60 * 1000); // Subtracting milliseconds


for 24 hours

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

const timestamp = new Date(potholesData[i][0]);

if (timestamp >= twentyFourHoursAgo && timestamp <= currentDate) {

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

const depth = parseInt(potholesData[i][3]);

if (depth < 30) {

safeCount++;

} else if (depth >= 30 && depth < 60) {

intermediateCount++;

} else {

dangerCount++;

return { safeCount, intermediateCount, dangerCount };

71
function createPotholeSeverityChart(safeCount, intermediateCount, dangerCount) {

const ctx = document.getElementById('pothole-severity-chart').getContext('2d');

const potholeSeverityChart = new Chart(ctx, {

type: 'pie',

data: {

labels: ['Safe', 'Intermediate', 'Danger'],

datasets: [{

label: 'Pothole Severity',

data: [safeCount, intermediateCount, dangerCount],

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

Figure 8.1.1 File Structure

75
Python manage.py run server

Figure 8.1.2 Server

LOGIN.HTML:

Figure 7.7.2 login page

76
DASHBOARD:

Figure 8.1.3 Dashboard

REPORT A POTHOLE:

Figure 7.7.5 Report Pothole

77
UPDATE POTHOLE :

Figure 7.7.6 Update Pothole

POTHOLE DATA:

Figure 8.1.4 Pothole Data

78
MAP VIEW:

Figure 8.1.5 Map View


Robot Control App:

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)

2. Development and Analysis of Pothole detection and Alert based on NodeMCU

3. Etukala Jaswanth Reddy, Padhuri Navaneeth Reddy,Govindula Maithreyi, M. Bharath


Chandra Balaji, Santanu Kumar Dash, K. Aruna Kumari ( 2020 )

4. GPS. NMEA Data. [Online]. Available: http://www.gpsinformation.org/ dale/nmea.htm,


accessed Oct. 19, 2014.

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

You might also like