# Car Parking Sensor with dnyarduino

0
1711

### INTRODUCTION:

In this paper in our daily lives many times against us to the car parking sensor application made distance measurement with you and applying ultrasonic sensor, Bazzar (whistle) and if the Bazzera by mesefa series or slow play application for we did on dnyarduino set is very simple 2- 3Â  and useful set of connections on the connection will be shared in the diagram.

First, let’s talk about the logic of the ultrasonic distance measuring sensors.

#### ULTRASONIC SENSOR:

Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â  ULTRASONIC SENSOR

Ultrasonic sensors send out sound waves in the range we are certain we multiply the value obtained in dayanÄ±r.bura them when we go back on the principle of detecting objects hit by the sound velocity has achieved the distance. X = V * t

The sound velocity 343m / s are used.

### Â ARDUINO CODE:

`#define trigPin 13`
`#define echoPin 12`
`void setup() {`
`// put your setup code here, to run once:`
`pinMode(trigPin, OUTPUT);`
`pinMode(echoPin, INPUT);`
`pinMode(8, OUTPUT);`
`}`
`void loop() {`
`long duration, distance;`
`digitalWrite(trigPin, LOW);`
`delayMicroseconds(2);`
`digitalWrite(trigPin, HIGH);`
`delayMicroseconds(10);`
`digitalWrite(trigPin, LOW);`
`duration = pulseIn(echoPin, HIGH);`
`distance = (duration/2) / 29.1; ``//29.1 =10000/343 yani 343m/s*t(zaman) yerine m yi cm ye saniyeyide ms Ă§evirdiÄźinde ve Ă§arpmak yerine ters Ă§evirip bĂ¶lersen 29.1Â  elde ediliyor.`
`if``(distance<=5){`
`// put your main code here, to run repeatedly:`
`digitalWrite(8,HIGH);`
`delay(50);`
`digitalWrite(8,LOW);`
`delay(50);`
`}`
`if``(distance>=5 && distance<=10){`
`// put your main code here, to run repeatedly:`
`digitalWrite(8,HIGH);`
`delay(200);`
`digitalWrite(8,LOW);`
`delay(200);`
`}`
`if``(distance>10 && distance<=15){`
`// put your main code here, to run repeatedly:`
`digitalWrite(8,HIGH);`
`delay(500);`
`digitalWrite(8,LOW);`
`delay(500);`
`}`
`if``(distance>15 && distance<= 20){`
`// put your main code here, to run repeatedly:`
`digitalWrite(8,HIGH);`
`delay(50);`
`digitalWrite(8,LOW);`
`delay(50);`
`}}`
SHARE
Previous articleHumiliating DC-DC circuit with Arduino
Next articleFIRE PREVENTION