You are on page 1of 9

ARDUINO CAR PARK SENSOR

PROJECT
I'll tell you a fun project that you can do on a low budget. A small
copy of your parking

sensor we have seen in our life. First I will tell you what Arduino is
doing. We can easily

program with Arduino libraries. Using the signals from the sensors,
we can design

robots and systems that interact with the environment. Arduino has
various cards and

modules designed to provide solutions to different needs. We can


develop your projects

using these cards and modules.

NECESSARY MATERIALS
ARDUINO
4 LEDs
5 PCS 220 OHM RESISTANCE
1 PIECE BUZZER
BREAD BOARD
QUANTITY JUMPER CABLE
Scheme showing the links of our Project
Deviation Codes
const int trigger_pin = 12;

const int echo_pin = 13;

const int aled = 2 ;


const int bled = 3;.

const int cled = 4;

const int dled = 5;

const int buzzer = 6;

int sure ;

int mesafe ;

 

void setup() {

pinMode(aled , OUTPUT);

pinMode(bled , OUTPUT);

pinMode(cled , OUTPUT);

pinMode(dled , OUTPUT);

pinMode(buzzer , OUTPUT

pinMode(trigger_pin , OUTPUT);

pinMode(echo_pin , INPUT);

void loop()
{

digitalWrite(trigger_pin , HIGH);

delayMicroseconds(1000); //

digitalWrite(trigger_pin , LOW);

sure = pulseIn(echo_pin , HIGH);

mesafe = (sure / 2) / 29.1;

 

if (mesafe <= 10)

digitalWrite(aled , HIGH);

digitalWrite(bled , HIGH);

digitalWrite(cled , HIGH);

digitalWrite(dled , HIGH);

digitalWrite(buzzer , HIGH);

delay(250);

digitalWrite(buzzer , LOW);

else if (mesafe <= 25)

digitalWrite(aled , LOW);
digitalWrite(bled , HIGH);

digitalWrite(cled , HIGH);

digitalWrite(dled , HIGH);

digitalWrite(buzzer , HIGH);

delay(500);

digitalWrite(buzzer , LOW);

else if ( mesafe <= 50)


{

digitalWrite(aled , LOW);

digitalWrite(bled , LOW);.

digitalWrite(cled , HIGH);

digitalWrite(dled , HIGH);

digitalWrite(buzzer , HIGH);

delay(750);

digitalWrite(buzzer , LOW);

else //alan boş ise bunu yapar

digitalWrite(aled , LOW);
digitalWrite(bled , LOW);

digitalWrite(cled , LOW);

digitalWrite(dled , HIGH);

You might also like