• Sun. Oct 24th, 2021
    • Introduction: A car parking system is a mechanical device that multiplies parking capacity inside a parking lot. Parking systems are generally powered by electric motors or hydraulic pumps that move vehicles into a storage position.

    Car parking systems may be traditional or automated. Automatic multi-story automated car park systems are less expensive per parking slot, since they tend to require less building volume and less ground area than a conventional facility with the same capacity. In the long term, automated car parking systems are likely to be more cost effective than traditional parking garages.

    • Materials:
      • Arduino UNO
      • Breadboard
      • Ultrasonic Sensor – HC-SR05
      • SG90 Micro-servo Motor
      • Jumper Wires
    • Application:
      • Arduino IDE
    • Ultrasonic Ranging Module HC – SR04
      • Ultrasonic ranging module HC – SR04 provides 2cm -400cm non-contact measurement function, the ranging accuracy can reach to 3mm. The modules includes ultrasonic transmitters, receiver and control circuit.
    • Working Principal of Ultrasonic:
      • Using IO trigger for at least 10us high level signal
      • The module automatically sends eight 40 kHz and detect whether there is a pulse signal back.
      • If the signal back, through high level, time of high output IO duration is the time fro sending ultrasonic to returning. Test distance = high level time x velocity of sound (340M/S)/2.
    • SG90 Servo Motor:
      • Tiny and lightweight with high output power. Servo can rotate approximately 180 degrees (90 in each direction), and works just like the standard kinds but smaller. You can use any servo code, hardware or library to control these servos. Good for beginners who want to make stuff move without building a motor controller with feedback and gear box, especially since it will fit in small places. It comes with a 3 horns (arms) and hardware.
    • How to Make:
    Circuit Diagram
    • Ultrasonic Sensor Connection:
      • Connect the Vcc pin to the positive rail on your breadboard.
      • Connect the GND pin to the negative rail on your breadboard.
      • Connect the Trig pin to any digital pin on the Arduion.
      • Connect the Echo pin to any digital pin on the Arduino.
      • Finally, connect the positive rail of the breadboard to 5V pin on the Arduino and the negative rail of the breadboard to the GND pin on the Arduino.
    • SG90 Servo Motor Connection:
      • VCC (Red Wire) – 5V
      • SIG (Yellow/Orange) – D3
      • GND (Black/Brown) – GND

    Code:

    #include<Servo.h>
    Servo Serv1;
    int trig=10; //trig pin of HC-SR04 is connected to pin 10 of Arduino
    int echo=9;  //echo pin of HC-SR04 is connected to pin 9 of Arduino
    int distance;
    int duration;
    void setup() {
    pinMode(trig,OUTPUT);  //trig pin of HC-SR04 is set as Output
    pinMode(echo,INPUT);   //echo pin of HC-SR04 is set as Input
    Serial.begin(9600);
    Serv1.attach(3);       //Servo is attached to pin 3 of Arduino
    }
    
    void loop() {
    digitalWrite(trig,LOW);   //pulse generation started here
    delayMicroseconds(2000);
    digitalWrite(trig,HIGH);
    delayMicroseconds(100);
    digitalWrite(trig,LOW);    //pulse generated 
    duration=pulseIn(echo,HIGH);  //detects the time till the pulse is High
    distance=duration*0.034/2;
    Serial.println(distance);
    if(distance>5 && distance<14)
    {
      Serv1.write(0);
      delay(2000);
    }
    Serv1.write(90);
    delay(100);
    }
    

    And Here You Go….

    Leave a Reply

    Your email address will not be published. Required fields are marked *