Naan Mud Hal Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

OBJECT DETECTION BY USING ESP32-CAM

Department of Electronics and Communication Engineering

Submitted by

NAME REGISTER
NUMBER
PRAVEEN T 71772214138
RANJANI V 71772214139
RAVISANKAR V 71772214140
REVATHI J K 71772214141
SABRIN S 71772214142

GOVERNMENT COLLEGE OF TECHNOLOGY


COIMBATORE - 641013

Guided by

Mr. G. Sivaramalingam - M. Tech Mr.


K. Gopal Ram AP/ECE
Stella Mary’s College of Engineering
BONAFIDE CERTIFICATE
Certified that this project report on “IOT IN SMART CITIES AND URBAN
PLANNING” is the bonafide record of work done by Praveen T (71772214138),
Ranjani V (71772214139), Ravisankar V (71772214140), Revathi J K (71772214141),
Sabrin S (71772214142) from the Department of Electronics and Communication
Engineering by Government College of Technology, Coimbatore.

Internal Guide Head of the Department

Internal Examiner External Examiner


TABLE OF CONTENTS:
1. ABSTRACT

2. INTRODUCTION

3. PROBLEM STATEMENT

4. PROPOSED SYSTEM

5. COMPONENTS REQUIRED

6. BLOCK DIAGRAM

7. PIN DIAGRAM

8. WORKING

9. CODES

10. CONCLUSION
1. ABSRACT
In recent years, the increasing number of vehicles has resulted in
significant challenges related to parking, especially in urban areas. This paper
presents an IoT-based Smart Parking system designed to improve parking
management efficiency, reduce traffic congestion, and minimize the time spent
searching for parking spaces. The system employs Internet of Things (IoT)
technologies, including sensors, microcontrollers, and cloud-based applications, to
monitor and manage parking availability in real-time. Vehicles are detected using
sensors placed in parking spots, and the data is transmitted to a cloud-based
server. A mobile application allows users to check for available parking spaces,
reserve them, and receive navigation assistance. The smart parking system not
only optimizes the use of available parking spaces but also provides a more
convenient and environmentally friendly solution to urban parking problems by
reducing fuel consumption and emissions associated with parking searches. The
proposed solution demonstrates a scalable and cost-effective approach to
managing parking in smart cities, contributing to better traffic flow and enhanced
urban mobility.

2. INTRODUCTION
As urbanization continues to accelerate, cities face numerous challenges,
including traffic congestion and the growing demand for parking spaces.
Traditional parking systems are often inefficient, leading to frustration for drivers,
increased fuel consumption, and environmental pollution. Drivers spend a
significant amount of time searching for available parking, which contributes to
traffic congestion and wasted resources. This inefficiency calls for innovative
solutions to optimize parking management and improve urban mobility.
A smart parking lot is an innovative solution that leverages emerging
technologies such as the Internet of Things (IoT), cloud computing, and mobile
applications to create a more efficient, user-friendly parking experience. In a smart
parking system, sensors are installed in parking spaces to detect the presence of
vehicles, and this data is communicated in real-time to a central management
system. This system can then provide users with up-to-date information on
available parking spaces via mobile apps or digital displays.
The primary goals of a smart parking lot are to reduce the time and effort
drivers spend looking for parking, optimize the use of available parking spaces,
and reduce traffic congestion and emissions. By integrating technology with
existing infrastructure, smart parking systems have the potential to revolutionize
urban mobility, making cities more sustainable and enhancing the overall quality
of life for residents.
This introduction sets the stage for understanding the impact and
benefits of smart parking solutions in modern urban environments.
3. PROBLEM STATEMENT:

Urbanization and the rapid increase in vehicle ownership have led to significant
parking challenges in cities worldwide. Drivers often struggle to find available
parking spaces, leading to excessive time spent searching, increased traffic congestion,
and higher fuel consumption, which in turn contributes to air pollution. Traditional
parking systems lack the ability to provide real-time information on space availability,
resulting in inefficient use of parking facilities and user frustration.

A smart parking lot, powered by IoT technology, addresses these issues by offering
real-time data on parking space availability, enabling drivers to quickly locate and
reserve spots. This system not only optimizes space utilization but also reduces traffic,
lowers fuel consumption, and contributes to a more sustainable and efficient urban
environment. Such a solution is essential for improving urban mobility, enhancing
user convenience, and promoting environmental sustainability.

4. PROPOSED SYSTEM:

The proposed IoT-based smart parking system aims to provide real-time parking
availability, improve space utilization, and enhance user convenience. The system
consists of three key components:

1. Sensors: Each parking spot is equipped with sensors (e.g., ultrasonic or


infrared) that detect whether a space is occupied or vacant.

2. Communication Network: Data from sensors is transmitted via wireless


networks (Wi-Fi, Zigbee, LoRa) to a cloud-based server for real-time
processing.

3. User Interface: A mobile app or web portal allows users to view available
spaces, reserve spots, and make payments.

The system offers features like real-time parking updates, navigation to available
spots, cashless payments, and automated entry/exit using license plate recognition
(ALPR). All data is stored on a cloud platform for monitoring and optimization.
By reducing search time and traffic congestion, this system enhances parking
management, improves user experience, and supports sustainability efforts by
lowering fuel consumption and emissions.
5. COMPONENTS REQUIRED

5.1 HARD WARE COMPONENTS


For object detection, we need ESP32CAM and TTL to USB converter

5.1.1. ESP32-CAM AND TTL USB CONNECTER

The ESP32-CAM is a small-sized camera module with the ESP32-S chip at


its core. It allows for Wi-Fi and Bluetooth connectivity, making it suitable
for IoT (Internet of Things) projects involving image and video processing.
The camera module usually comes with a built-in OV2640 camera and a
microSD card slot for storing images and videos. A TTL USB connector
is typically used for serial communication with devices like
microcontrollers, GPS modules, or even the ESP32-CAM. It converts
signals between USB and UART (serial) interfaces, allowing you to
connect your device to a computer for programming, debugging, or data
transfer. If you're working with an ESP32-CAM, you might not need a
TTL USB connector unless you're interfacing it with other devices or
platforms that use serial communication. However, if you want to program
or debug the ESP32-CAM via, serial connection, you can use a TTL USB
connecter to connect it to your computers USB port for communication.
5.2. S0FTWARE COMPONENT
5.2.1 EDGE IMPULSE

Edge Impulse provides tools to gather sensor data and other inputs from
the ESP32-CAM, including camera feeds. It also allows you to label this
data to train your machine learning model effectively. and This platform
offers a web-based interface for building and training machine learning
models directly on Edge Impulse. These models are specifically optimized
for running on resource-constrained devices like the ESP32-CAM, ensuring
efficient performance. If Once trained, Edge Impulse helps convert the
model into a format compatible with the ESP32-CAM. This ensures
seamless deployment and on-device execution of the object detection
model. and Edge Impulse boasts integrations with various hardware
platforms, including sensors, microcontrollers (MCUs), and
microprocessors (MPUs) commonly used in edge devices. Edge Impulse
emphasizes a user-friendly experience with low-code functionalities. This
makes it accessible to developers of all levels, allowing them to build and
deploy machine learning models for edge devices without extensive coding
expertise.
6. BLOCK DIAGRAM

Fig : Object detection block diagram

7. PIN DIAGRAM

FIG: Pin diagram for Smart Parking


8. WORKING
An IoT-based smart parking system uses sensors, wireless communication, and cloud
computing to manage parking efficiently in real-time. Sensors in each parking space
detect vehicle presence, sending data to a cloud server that updates space availability.
Users access this information via a mobile app or web portal, where they can find,
reserve, and pay for parking spaces digitally. Navigation assistance guides drivers to
their spots, and technologies like Automatic License Plate Recognition (ALPR)
automate entry and exit.

The system also provides real-time parking updates on digital display boards and
stores data in the cloud for analysis. Parking operators can optimize space usage,
predict demand, and implement dynamic pricing. By reducing search times and fuel
consumption, the smart parking system alleviates traffic congestion and supports
sustainability in urban environments, enhancing both efficiency and convenience .

9. code
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <NewPing.h>

// Define I2C address for LCD and initialize it


LiquidCrystal_I2C lcd(0x27, 16, 2); // Address 0x27 for a 16x2 LCD

// Define ultrasonic sensors pins


#define TRIG_PIN_1 2
#define ECHO_PIN_1 3
#define TRIG_PIN_2 4
#define ECHO_PIN_2 5
#define TRIG_PIN_3 6
#define ECHO_PIN_3 7

// Maximum distance to measure (in cm)


#define MAX_DISTANCE 400

// Initialize ultrasonic sensors


NewPing sonar1(TRIG_PIN_1, ECHO_PIN_1, MAX_DISTANCE);
NewPing sonar2(TRIG_PIN_2, ECHO_PIN_2, MAX_DISTANCE);
NewPing sonar3(TRIG_PIN_3, ECHO_PIN_3, MAX_DISTANCE);

// Servo motor
Servo gateServo;
// Buzzer pin
#define BUZZER_PIN 8

// Servo motor pin


#define SERVO_PIN 9

// Variables for tracking parked vehicles


int parkedVehicles = 0;
int totalParkingSpots = 3;

// Setup function
void setup() {
// Initialize Serial monitor for debugging
Serial.begin(9600);

// Initialize LCD
lcd.begin();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Smart Parking");

// Attach servo motor to the pin


gateServo.attach(SERVO_PIN);

// Set initial position of servo motor (gate closed)


gateServo.write(0);

// Set buzzer pin as output


pinMode(BUZZER_PIN, OUTPUT);
}

// Loop function
void loop() {
// Get distance from each ultrasonic sensor
int distance1 = sonar1.ping_cm();
int distance2 = sonar2.ping_cm();
int distance3 = sonar3.ping_cm();

// Reset parked vehicles count


parkedVehicles = 0;

// Check each sensor and count parked vehicles


if (distance1 > 0 && distance1 < 50) {
parkedVehicles++;
}
if (distance2 > 0 && distance2 < 50) {
parkedVehicles++;
}
if (distance3 > 0 && distance3 < 50) {
parkedVehicles++;
}
// Display parked vehicles on LCD
lcd.setCursor(0, 1);
lcd.print("Parked: ");
lcd.print(parkedVehicles);
lcd.print("/");
lcd.print(totalParkingSpots);

// Check if there are empty parking spots


if (parkedVehicles < totalParkingSpots) {
// Open gate by turning servo motor 90 degrees
gateServo.write(90);
digitalWrite(BUZZER_PIN, LOW); // Turn off buzzer
} else {
// Close gate if no spots are available
gateServo.write(0);
// Activate buzzer if all spots are occupied
digitalWrite(BUZZER_PIN, HIGH);
}

// Small delay before next loop


delay(1000);
}
10. CONCLUSION

In conclusion, an IoT-based smart parking system offers a modern solution


to parking challenges by providing real-time monitoring, efficient space
utilization, and automated entry control. With the integration of sensors,
displays, and connectivity, it reduces parking search time, alleviates
congestion, and enhances user convenience. This technology-driven
approach makes parking management more streamlined, contributing to
smarter, more sustainable urban living.

You might also like