Navindu Jayawardhane
Created December 14, 2021

Smart Car Parkcing system | Created NJ

There are many vehicles on the road today. Therefore, traffic can be seen throughout the day. Today there is not enough space on the roads i

BeginnerProtip15
Smart Car Parkcing system | Created NJ

Things used in this project

Hardware components

Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×3
HC-06 Bluetooth Module
×1
Arduino Mega 2560
Arduino Mega 2560
×1
Arduino Nano R3
Arduino Nano R3
×1
Grove - Touch Sensor SKU 101020037
Seeed Studio Grove - Touch Sensor SKU 101020037
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
5 mm LED: Red
5 mm LED: Red
×3
5 mm LED: Green
5 mm LED: Green
×2
Male/Female Jumper Wires
Male/Female Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE
MIT App Inventor
MIT App Inventor

Story

Read more

Schematics

How to connect Ultrasonic sensor

you can plug PWM pins to this ultrasonic sensor and led connect to you like pins and get piza box and cover this use black cover

Code

Code By me

Arduino
you can change your pins and change your times and Bluetooth variables

do yo want download app (apk) file use this link
https://drive.google.com/file/d/1mX3pNZZkBr0zdQdzJiC3Vcy65wxjRlAw/view?usp=sharing

and you want to connect bluebottle module Hc-06 or HC-05 you can watch connect setup in this link
https://youtu.be/5VVxgh-ungQ
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);


#define trig 3
#define echo 5

#define trig1 2
#define echo1 4

#define tri 9
#define ech 8

int timer = 0;
int timer2 = 0;
int timer3 = 0;

SoftwareSerial BT(10, 11);  //tx ,rx
void setup() {

  lcd.init();
  BT.begin(9600);
  pinMode(2, OUTPUT);  //1red
  pinMode(12, OUTPUT);  //1gre
  pinMode(16, OUTPUT);  //2gre
  pinMode(7, OUTPUT);   //2red
  pinMode(18, OUTPUT);  //3gre
  pinMode(19, OUTPUT);  //3red
  pinMode(trig,OUTPUT);
  pinMode(echo,INPUT);
  pinMode(trig1, OUTPUT);
  pinMode(echo1, INPUT);
  pinMode(tri, OUTPUT);
  pinMode(ech, INPUT);
  Serial.begin(9600);
}

void loop() {
  
  digitalWrite(trig, LOW);
  delayMicroseconds(2);
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);

  long z = pulseIn(echo, HIGH);

  long inches = z / 74 / 2;
  long cm = z / 29 / 2;

  Serial.print(inches);  //6 in    15cm
  Serial.print("in \z ");
  Serial.print(cm);
  Serial.println("cm");
  delay(100);

  lcd.begin(16, 2);
  lcd.setCursor(1, 0);
  lcd.print("All part is free");
  lcd.backlight();

  digitalWrite(2, HIGH);

  if (cm < 10 && timer==5) {
    
    digitalWrite(2, LOW);
    digitalWrite(12, HIGH);
    lcd.setCursor(1, 0);
    lcd.print("Part 1 is sold");
    BT.println("Part 1 is sold");
    timer = timer + 1;
    delay(1000);

    if (timer == 15) {
      BT.println("Part 1 car cost");
      BT.println("You charge is Rs 20.00");
      lcd.setCursor(1, 0);
      lcd.print("Part1 car cost");
      lcd.print("Your charge is Rs 20.20");
      lcd.clear();
    }
  timer=0;
  }


  else if (cm > 10){
    digitalWrite(2, HIGH);
    digitalWrite(12, LOW);
    lcd.print("Part 1 is empty");  // part 01
    BT.println("Part 1 is empty");

  }
  digitalWrite(trig1, LOW);
  delayMicroseconds(2);
  digitalWrite(trig1, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig1, LOW);

  long t = pulseIn(echo1, HIGH);

  long inche = t / 74 / 2;
  long cmm = t / 29 / 2;

  Serial.print(inche);  //6 in    15cm
  Serial.print("in1 \t ");
  Serial.print(cmm);
  Serial.println("cm1");
  delay(1000);

  digitalWrite(16, HIGH);

  if (cmm < 10) {
    
    digitalWrite(16, LOW);
    digitalWrite(7, HIGH);
    lcd.setCursor(1, 1);
    lcd.print("Part 2 is sold");
    BT.println("Part 2 is sold");
   
    timer2 = timer2 + 1;
    delay(1000);
    

       if (timer2 == 15) {
      lcd.setCursor(1,0);
      lcd.print("Part 2 car cost");
      lcd.setCursor(1,1);
      lcd.print("Part 2 cost is Rs 20.00");
      BT.print("Part 2 car cost");
      BT.print("Part 2 cost is Rs 20.00");
      lcd.clear();
      
    }
  timer2=0;
  }

  else if (cmm > 10) {
      digitalWrite(7, LOW);
      digitalWrite(16, HIGH);
      lcd.setCursor(1, 0);
      lcd.print("Part 2 is empty");  //part 02
      BT.println("Part 2 is empty");
      lcd.clear();
 
  }
  digitalWrite(tri, LOW);
  delayMicroseconds(2);
  digitalWrite(tri, HIGH);
  delayMicroseconds(10);
  digitalWrite(tri, LOW);

  long e = pulseIn(ech, HIGH);

  long inc = e / 74 / 2;
  long cmt = e / 29 / 2;

  Serial.print(inc);  //6 in    15cm
  Serial.print("in2 \e ");
  Serial.print(cmt);
  Serial.println("cm2");
  delay(100);

  digitalWrite(18, HIGH);

  if (cmt < 10) {
    
    digitalWrite(18, LOW);
    digitalWrite(19, HIGH);
    lcd.setCursor(1, 0);
    lcd.print("part 3 is full");
    BT.println("part 3 is full");
    timer3 = timer3 + 1;
    delay(1000);
    if (timer3 == 15) {
      lcd.setCursor(1, 0);
      lcd.print("Part 3 part cost");
      lcd.setCursor(1,1);
      lcd.print("part 3 cost is Rs 20.00");
    }
  timer3=0;
  }

  else if (cmt > 10) {
    digitalWrite(18, HIGH);
    digitalWrite(19, LOW);
    lcd.setCursor(1, 0);
    lcd.print("Part 3 is empty");  //part 03
    BT.println("Part 3 is empty");

  }
}

Credits

Navindu Jayawardhane
1 project • 3 followers
A well enthusiastic and energetic explorer who is dreaming to be a space traveller and business owner, interested in vlogging,tecching

Comments