Bluetooth Parking Project: Complete Guide to Building an Arduino-Based Smart Parking System

Looking to create an innovative parking management solution? Our Bluetooth parking project combines Arduino technology with wireless communication to deliver a sophisticated yet accessible smart parking system. This comprehensive guide walks you through building a complete parking monitoring solution using the HC-05 Bluetooth module and Arduino.

Bluetooth Parking Project: Complete Guide to Building an Arduino-Based Smart Parking System

Introduction to the Bluetooth Parking Project

The Bluetooth parking project represents a significant step forward in DIY parking management solutions. By leveraging Arduino’s versatility and Bluetooth communication, this project enables real-time monitoring of parking spaces through an intuitive mobile interface. Whether you’re a hobbyist or a professional developer, this Bluetooth parking project offers valuable insights into IoT implementation.

Components Required for the Bluetooth Parking Project

Hardware Components

  • Arduino UNO board
  • HC-05 Bluetooth module
  • 6× IR sensors (for parking space detection)
  • SG90 Servo motor
  • Connecting wires
  • Breadboard
  • 5V power supply

Software Requirements

  • Arduino IDE
  • BlueBot Controller app
  • Required Arduino libraries

Technical Implementation

Setting Up the Bluetooth Parking Project

Code

#include <SoftwareSerial.h>
#include <Servo.h>

// Initialize software serial for Bluetooth communication (RX, TX)
SoftwareSerial BTSerial(2, 3); // RX, TX pins for Bluetooth module

// Pin configuration for the 6 parking sensors
const int sensor1Pin = A0;
const int sensor2Pin = A1;
const int sensor3Pin = A2;
const int sensor4Pin = A3;
const int sensor5Pin = A4;
const int sensor6Pin = A5;

// Servo configuration
Servo myServo;         // Create a servo object
const int servoPin = 9; // Pin connected to the servo

void setup() {
  // Start serial communication with Bluetooth and the Serial Monitor
  BTSerial.begin(9600); 
  Serial.begin(9600);

  // Initialize sensor pins
  pinMode(sensor1Pin, INPUT);
  pinMode(sensor2Pin, INPUT);
  pinMode(sensor3Pin, INPUT);
  pinMode(sensor4Pin, INPUT);
  pinMode(sensor5Pin, INPUT);
  pinMode(sensor6Pin, INPUT);

  // Attach the servo to the specified pin
  myServo.attach(servoPin);

  // Set the initial position of the servo to 0 degrees
  myServo.write(0);

  Serial.println("Parking Sensor System Initialized");
}

void loop() {
  // Check if data is received from the Bluetooth module
  if (BTSerial.available()) {
    char receivedCommand = BTSerial.read(); // Read one character
    Serial.print("Received Command: ");
    Serial.println(receivedCommand); // Print the received command

    // Rotate servo to 90 degrees if the command is '0'
    if (receivedCommand == '0') {
      myServo.write(90); // Rotate the servo to 90 degrees
      Serial.println("Servo rotated to 90 degrees");
    }
  }

  // Sensor 1 (A0)
  int sensor1State = digitalRead(sensor1Pin);
  if (sensor1State == LOW) {
    BTSerial.println("A"); // Sensor 1 occupied
    Serial.println("Sending: Occupied (Sensor 1 - A0)");
  } else {
    BTSerial.println("X"); // Sensor 1 free
    Serial.println("Sending: Free (Sensor 1 - A0)");
  }

  // Sensor 2 (A1)
  int sensor2State = digitalRead(sensor2Pin);
  if (sensor2State == LOW) {
    BTSerial.println("B"); // Sensor 2 occupied
    Serial.println("Sending: Occupied (Sensor 2 - A1)");
  } else {
    BTSerial.println("X"); // Sensor 2 free
    Serial.println("Sending: Free (Sensor 2 - A1)");
  }

  // Sensor 3 (A2)
  int sensor3State = digitalRead(sensor3Pin);
  if (sensor3State == LOW) {
    BTSerial.println("C"); // Sensor 3 occupied
    Serial.println("Sending: Occupied (Sensor 3 - A2)");
  } else {
    BTSerial.println("X"); // Sensor 3 free
    Serial.println("Sending: Free (Sensor 3 - A2)");
  }

  // Sensor 4 (A3)
  int sensor4State = digitalRead(sensor4Pin);
  if (sensor4State == LOW) {
    BTSerial.println("D"); // Sensor 4 occupied
    Serial.println("Sending: Occupied (Sensor 4 - A3)");
  } else {
    BTSerial.println("X"); // Sensor 4 free
    Serial.println("Sending: Free (Sensor 4 - A3)");
  }

  // Sensor 5 (A4)
  int sensor5State = digitalRead(sensor5Pin);
  if (sensor5State == LOW) {
    BTSerial.println("E"); // Sensor 5 occupied
    Serial.println("Sending: Occupied (Sensor 5 - A4)");
  } else {
    BTSerial.println("X"); // Sensor 5 free
    Serial.println("Sending: Free (Sensor 5 - A4)");
  }

  // Sensor 6 (A5)
  int sensor6State = digitalRead(sensor6Pin);
  if (sensor6State == LOW) {
    BTSerial.println("F"); // Sensor 6 occupied
    Serial.println("Sending: Occupied (Sensor 6 - A5)");
  } else {
    BTSerial.println("X"); // Sensor 6 free
    Serial.println("Sending: Free (Sensor 6 - A5)");
  }

  // Delay to avoid flooding Bluetooth with too many commands
  delay(1000); // Adjust delay time as needed
}

The heart of our Bluetooth parking project lies in its communication system. Here’s how we establish the connection:

#include <SoftwareSerial.h>
#include <Servo.h>

// Initialize Bluetooth communication
SoftwareSerial BTSerial(2, 3); // RX, TX pins
Servo myServo;

Sensor Configuration in the Bluetooth Parking Project

Our project utilizes six parking sensors, each monitoring a distinct parking space:

const int sensor1Pin = A0;
const int sensor2Pin = A1;
const int sensor3Pin = A2;
const int sensor4Pin = A3;
const int sensor5Pin = A4;
const int sensor6Pin = A5;

System Initialization

The Bluetooth parking project requires proper initialization of all components:

void setup() {
  BTSerial.begin(9600);
  Serial.begin(9600);
  // Initialize all sensor pins
  pinMode(sensor1Pin, INPUT);
  // Additional sensor initializations...
  myServo.attach(servoPin);
  myServo.write(0);
}

Core Functionality

Real-time Monitoring System

The Bluetooth parking project continuously monitors parking spaces through an efficient loop system:

void loop() {
  // Check Bluetooth commands
  if (BTSerial.available()) {
    char receivedCommand = BTSerial.read();
    handleCommand(receivedCommand);
  }

  // Monitor parking spaces
  checkParkingSpaces();

  delay(1000); // Prevent communication overflow
}

Status Communication Protocol

Our Bluetooth parking project implements a straightforward communication protocol:

  • ‘A’ to ‘F’: Indicates occupied parking spaces
  • ‘X’: Signals available parking spaces
  • ‘0’: Triggers barrier control

Mobile App Integration

The BlueBot Controller app serves as the user interface for the Bluetooth parking project, offering:

  1. Real-time parking space visualization
  2. Instant status updates
  3. Remote barrier control
  4. Simple connection management

Advanced Features of the Bluetooth Parking Project

Automated Barrier Control

The project includes an automated barrier system:

if (receivedCommand == '0') {
  myServo.write(90); // Open barrier
  Serial.println("Barrier opened");
}

Error Handling

To ensure reliability, our Bluetooth parking project includes:

  1. Communication verification systems
  2. Sensor state validation
  3. Automated error reporting
  4. Failsafe mechanisms

Installation Process

Hardware Assembly

  1. Connect the HC-05 module:
  • VCC → Arduino 5V
  • GND → Arduino GND
  • TX → Arduino pin 2
  • RX → Arduino pin 3
  1. Install parking sensors:
  • Connect to designated analog pins
  • Ensure stable power distribution
  • Verify all ground connections

Software Setup

  1. Upload the provided code
  2. Install the BlueBot Controller app
  3. Pair with HC-05 module
  4. Configure communication settings

Troubleshooting the Bluetooth Parking Project

Common issues and solutions:

  1. Connection Issues:
  • Check HC-05 pairing status
  • Verify power supply
  • Confirm pin connections
  1. Sensor Problems:
  • Adjust sensor positioning
  • Ensure clean sensor surfaces
  • Check wiring integrity

Future Enhancements

Potential improvements for the Bluetooth parking project include:

  1. Cloud data storage integration
  2. Advanced analytics implementation
  3. Multiple barrier support
  4. Payment system integration

Project Specifications

  • System Voltage: 5V DC
  • Communication: Bluetooth 2.0
  • Sensor Range: 100cm maximum
  • Response Time: <100ms
  • Current Draw: <200mA

Safety Considerations

When implementing this Bluetooth parking project, consider:

  1. Proper voltage regulation
  2. Weather protection for outdoor installations
  3. Regular maintenance requirements
  4. Backup power solutions

Conclusion

This Bluetooth parking project demonstrates the potential of combining Arduino with wireless technology for practical applications. The system offers a scalable, efficient solution for parking management, suitable for various implementations from small lots to larger facilities.

Download BlueBot Controller App and start your journey today!

Home Page