Sei sulla pagina 1di 5

OUR LADY OF FATIMA UNIVERSITY

PAMPANGA CAMPUS
COLLEGE OF COMPUTER STUDIES

A RESEARCH PROJECT IN FREE ELECTIVE 1

“SIMULATED ANTI - COLLISION SENSOR”

Submitted By:
De Leon, Timothy Abner A.
Guimaras, Leonard F.
Nakashima, Katsuyoshi S.
Umangay, Joanne F.

Submitted To:
Kenichiru L. Morioka
PURPOSE OF THIS RESEARCH:
Our Group have conducted a research on how helpful the anti-collision sensor is
on our modern-day vehicles and how it prevents vehicular accidents since these
events have become more prevalent nowadays.
To be able to help with our Community, we have Built a Simulation of an Anti-
Collision Sensor on a remote controlled vehicle to see how the sensor works, and
to be able to provide the said device to the people who are in need of this and to
be able to contribute in the I.T community.

GOAL OF THIS RESEARCH:


To be able to provide a budget- friendly device that could help prevent vehicle
owners and drivers from being involved in any car accidents.

2
CODES:

#define trigPin 12

#define echoPin 13

#define buzz 11

#define trigPin1 10

#define echoPin1 9

void setup() {

// declared functions of declared variables

Serial.begin (9600);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(buzz,OUTPUT);

void loop() {

//looping function of codes ( varies depending on the distance)

long duration, distance;

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin,HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

3
duration = pulseIn(echoPin, HIGH);

distance = (duration/2)/29.1;

if (distance < 15 && distance > 12)

tone (buzz, 1000);

delay (1000);

noTone(buzz);

if (distance < 12 && distance >9)

tone (buzz, 1250);

delay (750);

noTone(buzz);

delay (750);

if (distance < 9 && distance >6)

tone (buzz, 1750);

delay (500);

noTone(buzz);

delay (500);

if (distance < 6 && distance >3)

4
tone (buzz, 2000);

delay (250);

noTone(buzz);

delay (250);

if (distance < 3 && distance > 0)

tone (buzz, 2500);

delay (50);

noTone(buzz);

delay (50);

Potrebbero piacerti anche