Automatic Car Parking System with Solar Shed

Automatic Car Parking System Using Solar Shed

Automatic Car Parking System Using Solar Shed

Build a smart, self-powered automatic car parking system that charges itself through a solar shed! This project combines renewable energy with automated parking management, complete with rain drainage system and real-time slot monitoring.


Project Overview

This innovative system uses IR sensors to detect vehicle entry/exit, a servo-controlled gate for automated access, and an LCD display for real-time parking slot information. The entire system is powered by a solar shed with 4x 6V solar panels, making it completely energy-independent!


Key Features

  • Solar Powered: 4x 6V solar panels charge the entire system
  • Automatic Gate Control: Servo-controlled gate opens/closes automatically
  • Real-time Display: LCD shows available parking slots
  • Rain Drainage System: Waterproof 3D printed structure
  • Smart Parking Logic: IR sensors detect entry/exit accurately
  • Battery Management: TP5100 + BMS for safe charging
  • Energy Independent: No external power required

Materials Required


3D Model Files

Download the 3D printable files for the solar shed structure and mounting components:

Note: The solar shed structure was designed in Tinkercad and printed using JLCPCB's 3D printing services. The structure is waterproof for the rain drainage system.

Print these files using JLCPCB's 3D printing service:

Order 3D Prints from JLCPCB

Assembly Steps

1
Upload the Code

Open Arduino IDE, copy-paste the provided code, select your Arduino board and port, then click upload.

2
3D Print the Structure

Use the STL files to print the solar shed structure. We recommend using JLCPCB for high-quality, waterproof prints.

3
Circuit Connections

Follow the circuit diagram to connect all components. Double-check BMS and TP5100 connections to the battery.

4
Solar Panel Setup

Connect two 6V panels in parallel to make one pair. Connect both pairs in series to get 12V output. Connect to TP5100 module.

5
Sensor Adjustment

Adjust both IR sensors using a screwdriver for accurate vehicle detection.

6
Final Assembly

Mount all components, connect wiring, and test the system. Red light on TP5100 indicates charging, blue indicates full.


Circuit Diagram Video

The system uses a 12V setup from solar panels, converted to 8.4V by TP5100 for battery charging, with BMS for protection.

Watch the video below for detailed circuit diagram and connections:

Circuit Configuration: Two 6V panels in parallel → Two pairs in series → 12V output → TP5100 → BMS → Battery → Arduino & Components

Arduino Code

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>

#define servoPin 13

Servo myservo;
LiquidCrystal_I2C lcd(0x27, 16, 2);

int IR1 = 3; // Entry sensor
int IR2 = 2; // Exit sensor

int Slot = 4; // Total number of parking Slots
const int MaxSlots = 4; // Maximum number of slots

bool carEntering = false; // Track if a car is entering
bool carExiting = false; // Track if a car is exiting

void setup() {
  Serial.begin(9600);
  lcd.init(); // Initialize the LCD
  lcd.backlight(); // Open the backlight
  pinMode(IR1, INPUT);
  pinMode(IR2, INPUT);
  myservo.attach(servoPin);
  myservo.write(10); // Close the gate initially at 10°
  lcd.setCursor(0, 0);
  lcd.print("    ARDUINO    ");
  lcd.setCursor(0, 1);
  lcd.print(" PARKING SYSTEM ");
  delay(3000);
  lcd.clear();
}

void loop() {
  // Check if a car is entering (IR1 -> IR2)
  if (digitalRead(IR1) == LOW && !carEntering && !carExiting) {
    carEntering = true;
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Car Detected!");
    delay(1000);

    if (Slot > 0) {
      // No RFID check - directly open gate for entry
      myservo.write(120); // Open the gate directly to 120°
      Slot--; // Decrement available slots
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Gate Opened!");
      delay(2000);

      // Wait for the car to pass through IR2
      while (digitalRead(IR2) == HIGH) {
        delay(100);
      }

      // Wait for the car to completely leave IR2
      while (digitalRead(IR2) == LOW) {
        delay(100);
      }

      delay(2000); // Wait 2 seconds before closing the gate
      myservo.write(10); // Close the gate directly to 10°
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Gate Closed!");
      delay(2000);
    } else {
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("    SORRY :(    ");
      lcd.setCursor(0, 1);
      lcd.print("  Parking Full  ");
      delay(3000);
      lcd.clear();
    }
    carEntering = false;
  }

  // Check if a car is exiting (IR2 -> IR1)
  if (digitalRead(IR2) == LOW && !carExiting && !carEntering) {
    if (Slot == MaxSlots) {
      // If all slots are available, show "No Cars Left!" message
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print(" No Cars Left! ");
      delay(3000);
      lcd.clear();
    } else {
      carExiting = true;
      myservo.write(120); // Open the gate directly to 120°
      if (Slot < MaxSlots) {
        Slot++; // Increment available slots
      }
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Car Exiting...");
      delay(2000);

      // Wait for the car to pass through IR1
      while (digitalRead(IR1) == HIGH) {
        delay(100);
      }

      // Wait for the car to completely leave IR1
      while (digitalRead(IR1) == LOW) {
        delay(100);
      }

      delay(2000); // Wait 2 seconds before closing the gate
      myservo.write(10); // Close the gate directly to 10°
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("Gate Closed!");
      delay(2000);
      carExiting = false;
    }
  }

  // Display available slots
  lcd.setCursor(0, 0);
  lcd.print("    WELCOME!    ");
  lcd.setCursor(0, 1);
  lcd.print("Slot Left: ");
  lcd.print(Slot);
}

Code Explanation:

Setup Function:

Initializes LCD, servo motor, and IR sensors. Sets the gate to closed position (10°) and displays welcome message.

Main Loop:

Continuously monitors IR sensors for vehicle entry/exit. When entry is detected and slots are available, opens gate to 120°, updates slot count, and closes gate after vehicle passes. Similar logic for exit detection.

Key Features:

  • Real-time slot tracking with LCD display
  • Prevents multiple car detection conflicts
  • Proper gate timing for safe entry/exit
  • Parking full/empty status messages

Why Choose This System?

  • Eco-Friendly: 100% solar powered, zero electricity bills
  • 🌧️ Weather Resistant: Waterproof design with rain drainage
  • Energy Efficient: Smart power management with BMS
  • 🚗 Automated: No manual intervention needed
  • 📊 Real-time Monitoring: LCD displays available slots
  • 🔋 Reliable: Battery backup for 24/7 operation
  • 💰 Cost Effective: Low maintenance, long lifespan

Project Sponsors

JLCPCB 3D Printing: Used for high-quality, waterproof 3D prints of the solar shed structure. JLCPCB has a 3,000-square-meter factory with over 300 industrial-grade 3D printers, delivering to 180+ countries.

Altium Student Lab: A platform that makes electronics design easier, faster, and more connected. Provides free access to PCB courses and industry-recognized certifications for students with university email.


Troubleshooting Tips

  • Gate not opening: Check servo connections and power supply
  • IR sensors not detecting: Adjust sensitivity with screwdriver
  • Solar not charging: Verify panel connections (parallel then series)
  • LCD not displaying: Check I2C address and connections
  • Battery not holding charge: Verify BMS and TP5100 connections

This system provides an excellent opportunity to learn about renewable energy, automation, and embedded systems. It's perfect for college projects, smart city prototypes, or commercial parking solutions.

Comments

Popular posts from this blog

Arduino Code Car Parking System

Arduino Code

Solar Tracking System