Automatic Car Parking System with 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
- Arduino UNO - Buy Here
- Jumper Wires - Buy Here
- Breadboard - Buy Here
- LCD Display With I2C Module - Buy Here
- Servo Motor - Buy Here
- IR Sensor - Buy Here
- 6V Solar Panels (4x) - Buy Here
- 25V 2200uf Capacitor - Buy Here
- 7.4V Battery - Buy Here
- 2S 20A BMS - Buy Here
- TP5100 Module - Buy Here
3D Model Files
Download the 3D printable files for the solar shed structure and mounting components:
Print these files using JLCPCB's 3D printing service:
Order 3D Prints from JLCPCBAssembly Steps
Open Arduino IDE, copy-paste the provided code, select your Arduino board and port, then click upload.
Use the STL files to print the solar shed structure. We recommend using JLCPCB for high-quality, waterproof prints.
Follow the circuit diagram to connect all components. Double-check BMS and TP5100 connections to the battery.
Connect two 6V panels in parallel to make one pair. Connect both pairs in series to get 12V output. Connect to TP5100 module.
Adjust both IR sensors using a screwdriver for accurate vehicle detection.
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:
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
Post a Comment