CAM Final Paper
CAM Final Paper
College of Engineering
Lucban, Quezon
Submitted By:
The project aims to create an automated system for detecting vehicles that run red lights at
intersections. Utilizing an Arduino board and a variety of sensors, the system will identify violations and
trigger an alert. A light sensor will determine the color of the traffic light, while an ultrasonic sensor will
detect vehicles approaching the intersection. Additionally, a passive infrared sensor will confirm the
presence of a vehicle. Upon detecting a violation, a buzzer will activate, alerting authorities and nearby
personnel. This system seeks to enhance current manual detection methods, which are often inefficient
and error-prone, offering a more reliable and effective solution that could help reduce accidents and
improve road safety. The development process will proceed in stages, from conceptualization to
prototyping, testing, and evaluation. The goal is to produce a functional prototype that can aid in traffic
safety and enforcement of traffic laws.
II. Introduction
Modern manufacturing relies heavily on automation, benefiting both businesses and consumers.
Automation boosts efficiency and productivity, leading to faster production, fewer errors, and lower costs.
According to RVJ (2023), automation improves quality control by minimizing human error, reduces labor
costs by decreasing the need for manual labor, and enhances workplace safety by automating hazardous
tasks. The result is higher-quality products, increased customer satisfaction, and a stronger brand
reputation. In short, automation is crucial for competitiveness in today's global market.
Problem Statement
The current manual setup for detecting red light violations relies heavily on human observation,
which is prone to errors and inconsistencies. This manual system often results in delayed responses,
making it less effective in deterring violations and ensuring road safety.
Research Objectives:
1. Demonstrate the use of Arduino for automation in Computer-Aided Manufacturing (CAM):
The project will showcase the capabilities of Arduino microcontrollers in automating a real-world
application, highlighting its potential for improving efficiency and productivity in manufacturing
processes.
2. Evaluate the efficiency improvement post-automation: The project will compare the
performance of the automated system with the manual system, quantifying the improvements in
detection accuracy, response time, and overall efficiency.
This project holds significant importance in addressing the challenges of manual red light
violation detection. By developing an automated system, we aim to create a more reliable and efficient
solution that can enhance road safety, reduce accidents, and contribute to a safer driving environment.
This study will benefit the following:
● Quick Alerts: Authorities can act quickly because the system sends real-time alerts when a
violation happens, through a loud sound.
2. For Drivers:
● Safer Roads: Drivers will be deterred from running red lights because they know the system
can detect and alert authorities immediately. This will help reduce accidents.
● Awareness: Knowing that red light violations are being automatically detected may encourage
better driving habits.
● Increased Safety: The system helps prevent accidents by ensuring drivers follow traffic rules,
especially protecting pedestrians and other road users from red light running.
● Quicker Action: When violations are detected, authorities are notified quickly, leading to faster
intervention.
● Educational: Students will learn about sensors, Arduino programming, and real-world
applications like traffic monitoring, which is valuable knowledge for future projects.
Microcontrollers are compact electronic modules containing one or more processors designed to
perform specific tasks and control systems by converting natural analog stimuli into digital signals or vice
versa (Sanchez & Canton, 2018). Acting as a bridge between the physical and digital worlds, they are
embedded systems that manage and govern the operations of devices they are integrated into.
Microcontrollers are widely used in various applications, including medical implants, industrial
equipment, automotive engines, electronic appliances, and toys.
Among the many platforms available, Arduino has become a leading hardware and software
company producing microcontroller-based boards since 2005. Arduino Microcontroller Boards (MCBs)
are increasingly popular, gaining significant attention from researchers worldwide. This surge in interest is
driven by the demand for robotic innovations and advancements in automation, particularly in the context
of the ongoing Fourth Industrial Revolution (Elayyan, 2021; Lee et al., 2018).
IV. METHODOLOGY
● System Description:
The current manual setup for monitoring red light violations predominantly relies on
human observation, often performed by traffic enforcers stationed at intersections. These
personnel are tasked with visually identifying vehicles that breach traffic rules by running red
lights. Once a violation is observed, the enforcer typically documents the incident manually,
either by noting the vehicle's license plate number or by attempting to stop the violator on the
spot.
This system, however, is fraught with challenges. Human observation is inherently prone
to errors due to factors such as limited reaction time, distractions, or obstructed views caused by
environmental conditions like rain, fog, or high traffic density. Additionally, the reliance on
manual record-keeping increases the likelihood of inaccuracies or missed violations.
The process is also inconsistent, as enforcement largely depends on the availability and
attentiveness of traffic personnel. This can lead to delayed responses and ineffective enforcement,
reducing the system's overall deterrence effect. The lack of automation further impedes the
efficient recording and processing of violations, making it challenging to ensure accountability
and road safety comprehensively.
● Automation Plan:
The integration of Arduino into the system will follow a structured design that combines
hardware and software components to automate red light violation detection. Here's an outline of
the integration process based on the provided project details:
○ Arduino Board: Acts as the central processing unit, receiving inputs from
sensors and controlling outputs.
○ Traffic Light Detection: A Light Dependent Resistor (LDR) will detect the color
of the traffic light.
○ Vehicle Detection:
■ Ultrasonic Sensor: Measures the distance of vehicles from the
intersection, determining if they are crossing during a red light.
■ Passive Infrared (PIR) Sensor: Detects vehicle motion for additional
confirmation.
○ Alert System: A buzzer will provide an audible alert when a violation occurs.
○ Power Supply: A USB cable or a 9V battery will power the Arduino and
connected components.
2. Software Implementation
○ Arduino IDE: Used to develop the control code in C++, which will manage
sensor inputs and trigger the alert system based on detected violations.
○ Detection Logic: The software will continuously monitor traffic light status and
sensor data to identify violations in real-time.
3. Workflow Integration
○ When the traffic light is red, the LDR sensor signals the Arduino to start
monitoring vehicle activity.
○ If a vehicle is detected within a specified range by the ultrasonic sensor or PIR
sensor during this time, the Arduino recognizes it as a violation.
○ Upon detection, the Arduino activates the buzzer to alert nearby authorities or
personnel.
4. Testing and Calibration
○ Each component (LDR, ultrasonic sensor, PIR sensor, and buzzer) will be
individually tested for accuracy and response time.
○ Iterative refinements will ensure the system functions effectively under varying
environmental conditions, such as lighting and weather.
This integration of Arduino simplifies the detection process, ensuring accurate, real-time
identification of red light violations while minimizing the potential for human error and
inefficiencies inherent in manual systems.
● Implementation:
● Evaluation Metrics:
Compare the performance of the automated system against the manual system.
Discuss any challenges encountered during implementation and how they were addressed.
VI. CONCLUSION & RECOMMENDATIONS
VII. REFERENCES
How Automation Increases the Efficiency of Manufacturing. (n.d.). Motion Index Drives.
https://motionindexdrives.com/blog/how-automation-increases-manufacturing-efficiency/
Elayyan, S. (2021). The future of education according to the fourth industrial revolution. Journal of
Educational Technology and Online Learning, 4(1), 23-30. https://doi.org/10.31681/jetol.737193.
Sanchez, J., & C anton, M. P. (2018). Microcontroller Programming: The Microchip PIC®. CRC press,
ch.4.
Prabowo, N. K., & Irwanto, I. (2023). The Implementation of Arduino Microcontroller Boards in Science:
A Bibliometric Analysis from 2008 to 2022. Journal of Engineering Education/Journal of
Engineering Education Transformations/Journal of Engineering Education Transformation,
37(2), 106–123. https://doi.org/10.16920/jeet/2023/v37i2/23154
VIII. APPENDICES
Code Documentation: Include the Arduino code with comments for clarity.
//Introduction of materials used in pins
const int redLED = 9;
const int yellowLED = 8;
const int greenLED = 7;
const int buzzer = 3;
const int trigPin = 11;
const int echoPin = 10;
const int pirPin = 2;
int pirStat = 0;
long measureDistance() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
void setup() {
pinMode(redLED, OUTPUT);
pinMode(yellowLED, OUTPUT);
pinMode(greenLED, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(pirPin, INPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(redLED, HIGH); // When the Red light is high, it means that it is on
digitalWrite(yellowLED, LOW); // this code is for LEDs, same as the other code
digitalWrite(greenLED, LOW);
for(int x=0;x<500;x++){ //In this part, while the red light is in high condition, the two sensor will
run based on the given interval
long distance = measureDistance();
pirStat = digitalRead(pirPin);
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
delay(10);
if (distance <= 10) {
Serial.println("Violation Detected"); // this is optional, if you want to monitor the serial in
Arduino IDE and detect a violation, this will appear.
alert();
}
else if (pirStat == HIGH) {
Serial.println("Motion Detected");
alert();
}}
delay(100);
digitalWrite(redLED, LOW);
digitalWrite(yellowLED, HIGH);
digitalWrite(greenLED, LOW);
digitalWrite(redLED, LOW);
digitalWrite(yellowLED, LOW);
digitalWrite(greenLED, HIGH);
digitalWrite(redLED, LOW);
digitalWrite(yellowLED, HIGH);
digitalWrite(greenLED, LOW);
for(int x=0;x<30;x++)
{
digitalWrite(buzzer,HIGH);
delay(150);
digitalWrite(buzzer,LOW);
delay(100);
}
}
Arduino - 312
PIR - 55
Breadboard - 35
Wires - 25
Ultrasonic -49
LED - 6 9V
Battery - 98
Buzzer - 38
Battery holder - 7
Switch - 9