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

Republic of the Philippines

Laguna State Polytechnic University


Province of Laguna

COLLEGE OF ENGINEERING
BACHELOR OF SCIENCE IN COMPUTER ENGINEERING

ACCPE
Ultrasonic Tollgate Automation

SUBMITTED BY:
Balajadia, Romuel L.
Dimapilis, Roam Jet L.
Maluping, Kennt Cedric C.
1. Background of the Project: Ultrasonic Tollgate Automation

Introduction:
The implementation of ultrasonic sensors into tollgate automation systems is an important
advancement in the constantly changing field of transportation and traffic management. The goal is to
decrease delays and offering commuters a seamless experience through a contactless and automated
approach with precise distance measurement for accurate vehicle detection.

Citations:
 https://www.researchgate.net/publication/
334742648_AUTOMATED_VEHICLE_TOLL_SYSTEM_FOR_SMART_TRANSPORTATION_MANAGEMENT_
AND_OPERATIONS
 https://www.researchgate.net/publication/367050183_An_IOT-
Based_Automotive_and_Intelligent_Toll_Gate_Using_RFID
 https://projectmaker.in/projects.php?pname=Toll+Tax+System+using+Arduino+Ultrasonic+Sensor

Components and Technology:


Ultrasonic Sensor:
Its primary job is to detect the presence of vehicles and trigger the toll gate system accordingly. The
sensor works by emitting ultrasound waves and receiving the reflected waves from objects in its path.
The time difference between the emission and reception of these waves is used to calculate the
distance to the object.

Arduino Uno:
The main job of the Arduino Uno is to control the operation of the toll gate system, which includes
detecting the presence of vehicles, opening the barrier for vehicles to pass, and closing the barrier once
they have passed.

Servo Motor:
The servo motor's job in an ultrasonic tollgate automation project is to control the physical barrier of
the tollgate. When a vehicle is detected by the ultrasonic sensor, the servo motor is activated to open
the tollgate, allowing the vehicle to pass. Once the vehicle has passed, the servo motor closes the
tollgate. This automated operation based on the input from the ultrasonic sensor enables efficient and
accurate toll collection, reducing the need for manual intervention and minimizing the potential for
errors and fraud.

Key Features:
 Automated traffic management: The system can be used to detect and manage the flow of
traffic, such as at entry or exit points of a parking lot, a restricted area, or a one-way street.
 Increased efficiency: The automated system eliminates the need for manual intervention,
reducing the time required for traffic management and increasing overall efficiency.
 Accurate vehicle detection: The use of an ultrasonic sensor ensures precise distance
measurements, resulting in accurate vehicle detection and management.
 Customizable system: The project can be adapted and expanded to include additional features,
such as an LCD screen for displaying information or a solar panel for powering the system.
 Cost-effective: The use of Arduino and other affordable components makes the project a cost-
effective solution for implementing an automated traffic management system.
 Ease of implementation: The project can be easily assembled and programmed using Arduino
IDE, making it an accessible option for beginners and experienced users alike.
Applications:
 Highways, Bridges, and Tunnels: The project can be used to automate toll collection, increase
efficiency, reduce fraud, and accurately calculate tolls on highways, bridges, and tunnels.
 Traffic Management: By removing the toll collection aspect, the system can be adapted for
traffic management at entry or exit points of parking lots, restricted areas, or one-way streets. It
can efficiently detect and manage the flow of traffic, reducing the need for manual intervention
and increasing overall efficiency.
 Smart Transportation Systems: The project can be integrated into smart transportation
management and operations, offering an automated vehicle toll system for effective vehicle toll
operations.
 Research and Development: The project has also been a subject of research and development,
with studies focusing on its implementation for smart tollgate automation and its utilization in
wireless sensor network (WSN) modules for improved tollgate billing systems.

2. Materials used in project


- Connecting Wires
- Arduino UNO
- PCB
- Servo Motor
- Ultrasonic Sensor

Arduino UNO Connecting Wires

PCB
Servo Motor
Arduino Code

#include<Servo.h>
Servo myservo;
const int trigPin=3;
const int echoPin=5;
long tmeduration;
int distance;

void setup() {
myservo.attach(9);
pinMode(trigPin,OUTPUT);
pinMode(echoPin,INPUT);
Serial.begin(9600);
}

void loop() {
digitalWrite(trigPin,LOW);
delayMicroseconds(2);
digitalWrite(trigPin,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin,LOW);

tmeduration=pulseIn(echoPin,HIGH);
distance=(0.034*tmeduration)/2;

if(distance<=10){

myservo.write(120);
}
else{
myservo.write(30);}

Serial.print("distance:");
Serial.println(distance);

delay(1);

}
Project Overview:
Objective: The project utilizes an ultrasonic sensor (HC-SR04) and a servo motor, controlled by an LM324
op-amp through an Arduino. The aim is to detect the distance of an object using the ultrasonic sensor and
adjust the position of the servo motor based on the detected distance.

Execution Flow:

Library Inclusion and Object Declaration:


#include<Servo.h>: Include the Servo library for servo motor control.
Servo myservo;: Declare a Servo object named myservo for controlling the servo motor.

Pin Configuration and Serial Setup:


const int trigPin = 3; and const int echoPin = 5;: Define digital pins for the ultrasonic sensor.
long tmeduration; and int distance;: Declare variables to store pulse duration and distance.
void setup(): Setup function runs once at the beginning.
myservo.attach(9);: Attach the servo motor to digital pin 9.
Set trigPin as OUTPUT and echoPin as INPUT.
Initialize Serial communication for debugging.

Continuous Loop:
void loop(): Loop function runs continuously.
Ultrasonic Sensor Operation:
Send a short pulse to the ultrasonic sensor to trigger it (digitalWrite(trigPin, HIGH) and
delayMicroseconds(10)).
Measure the duration of the pulse from the ultrasonic sensor using pulseIn (tmeduration = pulseIn(echoPin,
HIGH)).
Calculate the distance based on the speed of sound and the duration of the pulse (distance = (0.034 *
tmeduration) / 2).

Servo Motor Control:


If the calculated distance is less than or equal to 10 units, move the servo motor to a specific angle (e.g.,
120 degrees) using myservo.write(120).
If the distance is greater than 10 units, move the servo motor to a different angle (e.g., 30 degrees) using
myservo.write(30).

Serial Monitoring:
Print the calculated distance to the Serial Monitor for monitoring (Serial.print("Distance: ") and
Serial.println(distance)).

Delay for Stability:


delay(1): Add a short delay for stability and to control the loop execution speed.

Project Flow Summary:

Trigger Ultrasonic Sensor:


Send a short pulse to the ultrasonic sensor and measure the duration of the echo.

Calculate Distance:
Use the pulse duration to calculate the distance of an object from the ultrasonic sensor.
Control Servo Motor:
Adjust the position of the servo motor based on the calculated distance.
If the distance is less than or equal to 10 units, move the servo to a specific angle.
Otherwise, move the servo to a different angle.

Serial Monitoring:
Print the calculated distance to the Serial Monitor for real-time monitoring.

Continuous Loop:
Repeat the entire process in a continuous loop for real-time distance detection and servo motor
adjustment.

This project continuously monitors the distance using the ultrasonic sensor, adjusts the servo motor
position accordingly, and provides real-time distance information through the Serial Monitor. The servo
motor acts as an indicator, changing its position based on the proximity of an object to the ultrasonic
sensor.
Recommendation / Suggestions

You might also like