Atmega32-Based Smart Car Parking Solution Using ATMEL STUDIO

Summary

The article describes an Automatic Car Parking System (APS) controlled by an Atmega32 microcontroller. The system uses sensors to detect vehicle presence in vertically stacked parking slots, optimizing space. Slot status is shown via LEDs (green for free, red for occupied) with relay and transistor switching based on sensor input. The design is implemented and tested in Proteus software, with code provided for reading sensor inputs and controlling LED outputs accordingly. The project aims to automate parking slot management and provide real-time status updates efficiently.

Parts used in the Automatic Car Parking System in Atmega32:

  • Atmega32 microcontroller chip
  • 5-volt VCC power supply
  • Switch buttons or IR Sensors (optional)
  • 10k ohm resistors
  • Ground connection
  • LEDs (green and red)
  • Relay
  • 12-volt DC generator (for relay operation)
  • 2N3904 transistor

The intelligent microcontroller oversees the operation of an automatic car parking system. Utilizing sensors, this project provides real-time feedback through LED displays.

Within the automatic parking system (APS), vehicles are vertically stacked to optimize space. Distinctive system designs facilitate the movement of cars from the entrance to their designated parking slots.

As cars enter the parking area, sensors detect available or occupied slots. The status of these slots is indicated by LED lights or displayed on an LCD screen.

Our project entails crafting an automatic car parking system using Atmega32 via Atmel Studio, subsequently testing its functionality in Proteus.

Firstly, let’s delve into an exploration of the components employed within our project.

Components of Automatic Car Parking System in Atmega32

The project incorporates the following components:

Atmega32 microcontroller chip
5-volt VCC
Switch buttons or optionally IR Sensors for practical implementation
10k ohm resistors
Ground connection
LEDs
Relay
12-volt DC generator for Relay operation
2N3904 transistor for switching operations

Working on Automatic Car Parking System in Atmega32

Within our automatic parking system project, we integrate a sensor. Upon a vehicle’s approach to the parking area, this sensor promptly identifies the vehicle and assesses whether the available slot is occupied or vacant. Should the slot be unoccupied, a green light illuminates, signaling an open space for parking. Conversely, when the slot is occupied, a red light indicates that it’s currently in use.

Now, we proceed with testing our project in Proteus.

To begin, construct the project by pressing the F7 key and accessing the code file stored on your computer. As depicted in the image below, the setup includes four 10k ohm resistors, four switches, green LEDs (representing Free Slots), red LEDs (indicating Filled Slots), and a single relay.

Suppose there are four vacant parking spaces, and a vehicle occupies slot D1. Upon a car’s arrival in a parking spot, the sensor detects this action and transmits a value of 1. Consequently, the LED indicator shifts from green to red, indicating that the particular spot is now reserved.

Moreover, upon a vehicle’s entry into slot D4, the sensor promptly detects its presence, causing the green light to switch off and the red light to illuminate. The relay functions as a switch: triggering the green light when the sensor output reads as 0. Conversely, when the sensor registers a value of 1, the relay engages, activating the red light to signal that the slot is reserved.

Video

Additionally, if you’re interested in executing the Automatic Car Parking System project using Atmega32, kindly refer to the video provided below.

Code

/*
Propose an Automatic Parking System. Whenever a car enters the parking area,
system display the available slots on I/O ports.
*/

.INCLUDE “M32DEF.INC”

CBI DDRA,0
CBI DDRA,1
CBI DDRA,2
CBI DDRA,3

SBI DDRC,0
SBI DDRC,1
SBI DDRC,2
SBI DDRC,3

PARKING1:
SBIS PINA,0
JMP PARKING2
SBI PORTC,0
CALL DelayMEGA
CBI PORTC,0
RJMP PARKING1

PARKING2:
SBIS PINA,1
JMP PARKING3
SBI PORTC,1
CALL DelayMEGA
CBI PORTC,1
RJMP PARKING2

PARKING3:
SBIS PINA,2
JMP PARKING4
SBI PORTC,2
CALL DelayMEGA
CBI PORTC,2
RJMP PARKING3

PARKING4:
SBIS PINA,3
JMP PARKING1
SBI PORTC,3
CALL DelayMEGA
CBI PORTC,3
RJMP PARKING4

DelayMEGA: // function used for delay
ldi R18,byte3(12* 1000 * 100 / 5)
ldi R17,high(12* 1000 * 100 / 5)
ldi R16,low(12* 1000 * 100 / 5)
subi R16,1
sbci R17,0
sbci R18,0
brcc pc-3
ret


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

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

Scroll to Top