0% found this document useful (0 votes)
75 views15 pages

Report of C Microproject

The document discusses a micro project on vehicle parking management. The objectives are to avoid congestion in parking areas and demonstrate hazard-free parking for 32 cars across two floors using infrared sensors and microcontrollers. Parking charges would be automatically deducted using RFID technology. The project aims to guide drivers to vacant slots and allow safe parking with ultrasonic sensors. It would also log vehicle entry/exit details. The actual procedure followed developing the program using C language to implement the parking management system. Resources used include Turbo C software and Windows operating system. Key outputs include functions for adding and removing vehicles, displaying parking information, and tracking parking occupancy levels.

Uploaded by

girish desai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views15 pages

Report of C Microproject

The document discusses a micro project on vehicle parking management. The objectives are to avoid congestion in parking areas and demonstrate hazard-free parking for 32 cars across two floors using infrared sensors and microcontrollers. Parking charges would be automatically deducted using RFID technology. The project aims to guide drivers to vacant slots and allow safe parking with ultrasonic sensors. It would also log vehicle entry/exit details. The actual procedure followed developing the program using C language to implement the parking management system. Resources used include Turbo C software and Windows operating system. Key outputs include functions for adding and removing vehicles, displaying parking information, and tracking parking occupancy levels.

Uploaded by

girish desai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

MICRO PROJECT REPORT

ON
VEHICLE PARKING
1.0 Brief Description

This website is all about the parking industry. But what is parking and what do people in
the parking industry actually do? This page is all about parking and everything around that
subject. It's created as an ongoing process: This page is never finished and we will keep
adding more and more information to it. Now, let's talk about parking. On Wikipedia the
word ‘parking’ is defined as:
In this case, we’re talking about car parking. You can park your car at a parking space. These
parking spaces can be on several locations: In a parking lot, a parking garage, on the side of the
street, and so on. In every city and on every street there are rules for parking. For example, often
you are allowed to park your car on the side of the street, but sometimes you have to pay for
parking, are only allowed to park for a short period of time or are not allowed to park at all. These
rules are called parking restrictions.

Parking spaces are very important to cities. A city must have enough parking spaces to provide their
residents and their visitors a place to park their car. Since cars are a main factor in transportation, a
city must meet the needs of the drivers. If people can’t find a place to park, or if they have to pay
too much for parking, these people probably won’t come back to your city to do some more
shopping, dining or spending money in any other way. Also residents must have enough place to
park their car nearby their house and workplace.

2.0 Aim of Micro Project:-


The main objective of this project is to avoid the congestion in the car parking area by implementing a
parking management system. Normally at public places such as multiplex theaters, market areas,
hospitals, function-halls, offices and shopping malls, one experiences the discomfort in looking out for a
vacant parking slot, though it’s a paid facility with an attendant/ security guard. The parking
management system is proposed to demonstrate hazel free parking for 32 cars, with 16 slots on each of
the two floors. The proposed system uses 32 infrared transmitter-receiver pairs that remotely
communicate the status of parking occupancy to the microcontroller system and displays the vacant
slots on the display at the entrance of the parking so that the user gets to know the availability
/unavailability of parking space prior to his/her entry into the parking place. In this system the users are
guided to the vacant slot for parking using Bi-colored LEDs and the ultrasonic sensors enable the drivers
to park the vehicle safely. The parking charges are automatically deducted from the user’s account using
RFID technology. From security point of view a daily log-book of entry/exit along with the vehicle details
is also registered in the computer’s memory.Implementation of concept of green communication and
exception handling facility make the system concept unique and innovative.

3.0 Course Outcomes Integrated

1. Parking can take considerable street space leading to the lowering of the road capacity.
2. Hence speed will be reduced, journey time & delay will also subsequently increase.

4.0 Actual Procedure Followed.

First we discussed in group about to find the subject related to project After discussion
finally, we selected the topic as Vehicle parking. Then we collect information related to
subject. Afterwards, according to the standard format we started to do the work on
project. The three group members decided to do work separately in ways like collecting
information, making proposal and report. Mr. M. Rokade Sir guide us how to
develop/build a program and also with he told how to solve the errors.
According to his guidance we followed the rule and we build the program after solve the
errors. Then we run the program and it run successfully. As per the decision the all
members completed the given work.
From these the c language software program using different function and also with we
studied how to solve the errors.

5.0 Actual Resources Used

Sr. No Name of Specifications Quantity Remarks


Resource/materia
l
1 Software Turbo. c 1
2 Operating system Window 8.1 2

5.0 Outputs of the Micro-projects


#include <stdio.h>
#include <conio.h>

#define CAR 1
#define SCOOTER 2

/* to store vehicle number, and its


row-col position in an array */
struct vehicle
{
int num ;
int row ;
int col ;
int type ;
};

int parkinfo[4][10] ; /* a 2-D array to store number of vehicle parked */


int vehcount ; /* to store total count of vehicles */
int carcount ; /* stores total count of cars */
int scootercount ; /* stores total count of scooters */
void display( ) ;
void changecol ( struct vehicle * ) ;
struct vehicle * add ( int, int, int, int ) ;
void del ( struct vehicle * ) ;
void getfreerowcol ( int, int * ) ;
void getrcbyinfo ( int, int, int * ) ;
void show( ) ;

/* decrements the col. number by one


this fun. is called when the data is
shifted one place to left */
void changecol ( struct vehicle *v )
{
v -> col = v -> col - 1 ;
}

/* adds a data of vehicle */


struct vehicle * add ( int t, int num, int row, int col )
{
struct vehicle *v ;

v = ( struct vehicle * ) malloc ( sizeof ( struct vehicle ) ) ;

v -> type = t ;
v -> row = row ;
v -> col = col ;

if ( t == CAR )
carcount++ ;
else
scootercount++ ;

vehcount++ ;
parkinfo[row][col] = num ;

return v ;
}

/* deletes the data of the specified


car from the array, if found */
void del ( struct vehicle *v )
{
int c ;

for ( c = v -> col ; c < 9 ; c++ )


parkinfo[v -> row][c] = parkinfo[v -> row][c+1] ;
parkinfo[v -> row][c] = 0 ;

if ( v -> type == CAR )


carcount-- ;
else
scootercount-- ;

vehcount-- ;
}

/* get the row-col position for the vehicle to be parked */


void getfreerowcol ( int type, int *arr )
{
int r, c, fromrow = 0, torow = 2 ;

if ( type == SCOOTER )
{
fromrow += 2 ;
torow += 2 ;
}

for ( r = fromrow ; r < torow ; r++ )


{
for ( c = 0 ; c < 10 ; c++ )
{
if ( parkinfo[r][c] == 0 )
{
arr[0] = r ;
arr[1] = c ;
return ;
}
}
}

if ( r == 2 || r == 4 )
{
arr[0] = -1 ;
arr[1] = -1 ;
}
}

/* get the row-col position for the vehicle with specified number */
void getrcbyinfo ( int type, int num, int *arr )
{
int r, c, fromrow = 0, torow = 2 ;

if ( type == SCOOTER )
{
fromrow += 2 ;
torow += 2 ;
}

for ( r = fromrow ; r < torow ; r++ )


{
for ( c = 0 ; c < 10 ; c++ )
{
if ( parkinfo[r][c] == num )
{
arr[0] = r ;
arr[1] = c ;
return ;
}
}
}
if ( r == 2 || r == 4 )
{
arr[0] = -1 ;
arr[1] = -1 ;
}
}

/* displays list of vehicles parked */


void display( )
{
int r, c ;

printf ( "Cars ->\n" ) ;

for ( r = 0 ; r < 4 ; r++ )


{
if ( r == 2 )
printf ( "Scooters ->\n" ) ;

for ( c = 0 ; c < 10 ; c++ )


printf ( "%d\t", parkinfo[r][c] ) ;
printf ( "\n" ) ;
}
}

void main( )
{
int choice, type, number, row = 0, col = 0 ;
int i, tarr[2] ;
int finish = 1 ;
struct vehicle *v ;

/* creates a 2-D array of car and scooter class */


struct vehicle *car[2][10] ;
struct vehicle *scooter[2][10] ;

clrscr( ) ;

/* displays menu and calls corresponding functions */


while ( finish )
{
clrscr( ) ;

printf ( "\nCar Parking\n" ) ;


printf ( "1. Arrival of a vehicle\n" ) ;
printf ( "2. Total no. of vehicles parked\n" ) ;
printf ( "3. Total no. of cars parked\n" ) ;
printf ( "4. Total no. of scooters parked\n" ) ;
printf ( "5. Display order in which vehicles are parked\n" ) ;
printf ( "6. Departure of vehicle\n" ) ;
printf ( "7. Exit\n" ) ;
scanf ( "%d", &choice ) ;

switch ( choice )
{
case 1 :

clrscr( ) ;
printf ( "\nAdd: \n" ) ;

type = 0 ;

/* check for vehicle type */


while ( type != CAR && type != SCOOTER )
{
printf ( "Enter vehicle type (1 for Car / 2 for Scooter ): \n" ) ;
scanf ( "%d", &type ) ;
if ( type != CAR && type != SCOOTER )
printf ( "\nInvalid vehicle type.\n" ) ;
}

printf ( "Enter vehicle number: " ) ;


scanf ( "%d", &number ) ;

/* add cars' data */


if ( type == CAR || type == SCOOTER )
{
getfreerowcol ( type, tarr ) ;

if ( tarr[0] != -1 && tarr[1] != -1 )


{
row = tarr[0] ;
col = tarr[1] ;

if ( type == CAR )
car[row][col] = add ( type, number, row, col ) ;
else
scooter[row - 2][col] = add ( type, number, row, col ) ; ;
}
else
{
if ( type == CAR )
printf ( "\nNo parking slot free to park a car\n" ) ;
else
printf ( "\nNo parking slot free to park a scooter\n" ) ;
}
}
else
{
printf ( "Invalid type\n" ) ;
break ;
}

printf ( "\nPress any key to continue..." ) ;


getch( ) ;
break ;

case 2 :

clrscr( ) ;
printf ( "Total vehicles parked: %d\n", vehcount ) ;
printf ( "\nPress any key to continue..." ) ;
getch( ) ;
break ;

case 3 :

clrscr( ) ;
printf ( "Total cars parked: %d\n", carcount ) ;

printf ( "\nPress any key to continue..." ) ;


getch( ) ;
break ;

case 4 :

clrscr( ) ;
printf ( "Total scooters parked: %d\n", scootercount ) ;
printf ( "\nPress any key to continue..." ) ;
getch( ) ;
break ;
case 5 :

clrscr( ) ;
printf ( "Display\n" ) ;
display( ) ;

printf ( "\nPress any key to continue..." ) ;


getch( ) ;
break ;

case 6 :

clrscr( ) ;
printf ( "Departure\n" ) ;

type = 0 ;

/* check for vehicle type */


while ( type != CAR && type != SCOOTER )
{
printf ( "Enter vehicle type (1 for Car / 2 for Scooter ): \n" ) ;
scanf ( "%d", &type ) ;
if ( type != CAR && type != SCOOTER )
printf ( "\nInvalid vehicle type.\n" ) ;
}
printf ( "Enter number: " ) ;
scanf ( "%d", &number ) ;

if ( type == CAR || type == SCOOTER )


{
getrcbyinfo ( type, number, tarr ) ;
if ( tarr[0] != -1 && tarr[1] != -1 )
{
col = tarr [1] ;

/* if the vehicle is car */


if ( type == CAR )
{
row = tarr [0] ;
del ( car [row][col] ) ;
for ( i = col ; i < 9 ; i++ )
{
car[row][i] = car[row][i + 1] ;
changecol ( car[row][i] ) ;
}
free ( car[row][i] ) ;
car[row][i] = NULL ;
}
/* if a vehicle is scooter */
else
{
row = tarr[0] - 2 ;
if ( ! ( row < 0 ) )
{
del ( scooter[row][col] ) ;
for ( i = col ; i < 9 ; i++ )
{
scooter[row][i] = scooter[row][i + 1] ;
changecol ( scooter[row][col] ) ;
}
scooter[row][i] = NULL ;
}
}
}
else
{
if ( type == CAR )
printf ( "\nInvalid car number, or a car with such number has not
been parked here.\n" ) ;
else
printf ( "\nInvalid scooter number, or a scooter with such
number has not been parked here.\n" ) ;
}
}

printf ( "\nPress any key to continue..." ) ;


getch( ) ;
break ;

case 7 :

clrscr( ) ;
for ( row = 0 ; row < 2 ; row++ )
{
for ( col = 0 ; col < 10 ; col++ )
{
if ( car[row][col] -> num != 0 )
free ( car[row][col] ) ;
if ( scooter[row][col] -> num != 0 )
free ( scooter[row+2][col] ) ;
}
}
finish = 0 ;
break ;
}
}
}
6.0 Skill Developed/ learning out of this Micro-Project

We build a project Vehicle parking in C. using different condition statement


different different looping statement, function, argument etc.
Thank you

You might also like