Artificial intelligence Project Report (ultrasonic sensor automatic arduino car parking system project)
Artificial intelligence Project Report (ultrasonic sensor automatic arduino car parking system project)
ALLAHABAD
ARTIFICIAL INTELLIGENCE
PROJECT REPORT
TOPIC : Ultrasonic Sensor
Automatic Arduino Car Parking
System Project
becoming a necessity.
Buzzer Pin 7
6.Software Implementation
The Arduino programming environnment (|DE) is used to
write and uploadthe program to the Arduino board.
Below is tthe detailed
d code for thc project:
#include Servo.h>
Servo myServo;
const int trigPin 9:
const int echoPin 10:
const int ledGreen 5:
const int ledRed e 6:
const int buzzer 7:
void setup() {
pinMode(trig Pin,OUTPUT);
pinModelechoPin, INPUT);
pinMode(led Green,OUTPUT):
pinMode(ledRed,OUTPUT);
pinMode(buzzer, OUTPUT);
myServo.attach(3);
start
myServo. write(0); //Gate closed at
Serial.begin(9600);
void loop0{
long duration;
int distance;
digitalWrite(trig Pin,LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trig Pin, LoW);
If (distance <10){
digitalWritelledGreen, LOW);
digitalWritelledRed, HIGH);
digitalWrite(buzzer, HIGH);
myServo.write(90); // Gate opens
else {
digitalWritelled Green, HIGH);
digitalWrite(led Red, LOW);
digitalWrite(buzzer, LoW);
myServo.write(0): //Gate closes
}
delay(500);
7. Advantages of the System