Sie sind auf Seite 1von 35

Parking assistant lot using arduino

Project report submitted in partial fulfilment of the requirements


for the award of the degree of
Bachelor of technology in electrical engineering

Department of electrical engineering


Delhi technological university

By:
Anmol narang
pooja chopra
Rashi gupta
Riya singla

2k13/ee/023
2k13/ee/089
2k13/ee/099
2k13/ee/109

Under the guidance of


Bhavnesh jaint
(asst. Professor)

Delhi technological university rohini, delhi

Department of electrical engineering


Certificate

This is to certify that the project entitled parking assistant lot using
arduino, submitted by anmol narang , pooja chopra, rashi gupta
and riya singla in partial fulfilment of the requirements for the award of
bachelor of technology in electrical engineering during session 2015-16 at
delhi technological university, delhi. A bonafide record of research
work carried out by her under my supervision and guidance. The candidate

has fulfilled all the prescribed requirements. The project which is based on
candidates own work, has not submitted elsewhere for a degree/diploma.
In my opinion, the project is of standard required for the award of a
bachelor of technology degree in electrical engineering.

Internal guide
Bhavnesh jaint

Acknowledgements

On the submission of my project report of parking assistant lot using


arduino, i would like to extend my gratitude & my sincere thanks to my
supervisor bhavnesh jaint, asst. Professor, department of electrical
engineering for her constant motivation and support during the course of
my work in the last semester. I truly appreciate and value her esteemed
guidance and encouragement from the beginning to the end of this thesis.
Her knowledge and company at the time of crisis would be remembered
lifelong.
Last but not least i would like to thank my parents, who taught me the
value of hard work by their own example. I would like to share this moment
of happiness with my father and mother. They rendered me enormous
support during the whole tenure of my stay in dtu.

anmol narang
(2k13/ee/023)
pooja chopra (2k13/ee/089)
Rashi gupta (2k13/ee/099)
Riya singla (2k13/ee/109)

Abstract
Arduino board based system keeps track of the number of cars parked (16 being
the max number), shows the number of slots unoccupied, automatically raises the
gate arm to allow cars into the parking lot or leave it. Other functions include keeping
track of how much time a car has been parked and the time when a driver leaves the
parking lot.
in the arduino version, a seven segment display module is used to record the
entrance of a car into the parking lot as opposed to microcontroller based which
detects the parking slot number by checking which limit switch is depressed when any
designated car is parked at that slot. The schematic diagrams of all hardware circuits
used in these. The program written in arduino software is interfaced with
arduino kit. The external sensors are connected together with cables.
Arduino is a fusion of three critical elements:

Hardware
Software
Community.
Arduino contains a receiver module so we dont even need the display unit
at all and gain far more control over the data. Many weather station
sensors are available individually, also gaining the flexibility of managing
the data through an arduino.

Index
Certificate
Acknowledgments
Abstract
1. Introduction
1.1
1.1
.1
1.2

Introduc
tion
Future
expansio
n
Motivati
on of

7
8

work
Applicatio
ns
Literature
overview
2. Temperature monitoring and motion sensing system and arduino
1.2
.1
1.3

2.1

2.2
2.2.
1
2.2.
2
2.2.
3
2.2.
3
2.3

4.1
(a)
4.1
(b)
4.2
4.2
(a)
4.2
(b)

Temperatur
e receiver
station
Arduino
Hardware

13

Software

18

Power

18

Pin
description
Shields

19

3. Procedure
4. Codes
5. Simulation results
4.1

Observa
tion
table
Graph
Graph
interpret
ation
Receiver
output
Circuit
design
Monitor
screen
output

6. Purpose
7. Conclusion
8. References

14
17

20
28
29
3
4
3
6
3
6
3
7
3
7
3
8
39
39
40

Introduction

A parking lot (australian and british english: car park), also known as a car lot, is a
cleared area that is intended for parking vehicles. Usually, the term refers to a
dedicated area that has been provided with a durable or semi-durable surface. In
most countries where cars are the dominant mode of transportation, parking lots are a
feature of every city and suburban area. Shopping malls, sports stadiums, megachurches and similar venues often feature parking lots of immense area.
Parking lots tend to be sources of water pollution because of their
extensive impervious surfaces. Most existing lots have limited or no facilities to control
runoff. Many areas today also require minimum landscaping in parking lots, which
means that their paved surfaces contribute to heat islands.
Many municipalities require a minimum number of parking spaces, depending on the
floor area in a store or the number of bedrooms in an apartment complex. In the
united states, each state's department of transportation sets the proper ratio for
disabled spaces for private business and public parking lots. Various forms of
technology are used to charge motorists for the use of a parking lot. Modern parking
lots use a variety of technologies to help motorists find unoccupied parking spaces,
retrieve their vehicles, and improve their experience.

Angled parking model

Technology

Sensors above each lot in this indoor parking lot determine if a car has already taken
the lot
Modern parking lots use a variety of technologies to help motorists find unoccupied
parking spaces using parking guidance and information system, retrieve their
vehicles, and improve their experience. This includes adaptive
lighting, sensors, indoor positioning system (ips) and mobile payment options. The
santa monica place shopping mall in california has cameras on each stall that can
help count the lot occupancy and find lost cars.
In outdoor parking lots, gps can be used to remember the location of a vehicle (some
apps saves location automatically when turning off the car when a smartphone breaks
communication with a vehicle's bluetooth connection. In indoor parking lots, one
option is to record one's wi-fi signature (signal strengths observed for several
detectable access points) to remember the location of a vehicle.
online booking technology service providers have been created to help drivers find
long-term parking in an automated manner, while also providing significant savings for
those who book parking spaces ahead of time. They use real-time inventory
management checking technology to display parking lots with availability, sorted by
price and distance from the airport.

There are mobile apps providing services for the reservation of long term parking lot
spaces similar to online or aggregate parking facility booking services. Some long
term parking mobile apps also have turn-by-turn maps to locate the parking lot.

From parking guidance and information (pgi) systems, or car park guidance systems,
present drivers with dynamic information on parking within controlled areas. The
systems combine traffic monitoring, communication, processing and variable message
sign technologies to provide the service.
Modern parking lots utilize a variety of technologies to help motorists find unoccupied
parking spaces, car location when returning to the vehicle and improve their
experience. This includes adaptive lighting sensors and parking space led
indicators (red for occupied, green for available and blue is reserved for the disabled;
above every parking space), and indoor positioning system (ips).
Pgi systems are a product of the worldwide initiative for the development of intelligent
transportation system in urban areas. Pgi systems can assist in the development of
safe, efficient and environmentally friendly transportation network.[1]
Pgi systems are designed to aid in the search for vacant parking spaces by directing
drivers to car parks where occupancy levels are low. The objective is to reduce search
time, which in turn reduces congestion on the surrounding roads for other traffic with
related benefits to air pollution with the ultimate aim of enhancement of the urban
area.

Parking guidance system (pgs)[

ultrasonic sensors above each lot in this indoor car park determine if a car has
already taken the lot and indicate using leds; and some can send a
bluetooth/sms message with the parking space number or code.
A parking guidance system (pgs) have different elements:[2]

Detectors

Led indicators

Zone controllers

Data / intermediate controllers

Central control system

Signs

Detectors

Operation of vehicle detection sensor and available space indicator. The indicator
turns from green to red when the space becomes unavailable.
Detectors can use different technologies, such as:

ultrasonic detectors

forward mounting sensors.

Camera based detectors.

Infrared based detectors.

Magnetic sensors that detect vehicles via changes in earth's magnetic field.

Some use combinations of above technologies to detect vehicles.


Led indicators
led indicators. Some manufacturers use led indicators per space, while others either
don't provide any or use one led indicator for few spaces. The purpose of an led
indicator is to provide guidance to parkers up to the last empty space.
Zone controllers
The zone control unit (zcu) (aka node controller), is the middle layer of parking
ultrasonic detector, which is to manage a group of ultrasonic detectors, detects then
loops the information of the detectors and send the relevant information to a higher
element or directly to central controller. One zone / node controller can support
between 16 to 100 detectors depending on the manufacturer of parking guidance
system.
Data / intermediate controllers

Some manufacturers use a kind of intermediate controllers, to accumulate data and


then channel it to the central control unit and others connect their zone controllers to
connect directly to the central control unit.

Central control system


Parking guidance system management software, an electronic map of the parking
space is embedded in the software, which can directly reflect the usage situation of
the carpark in real time. The operators can monitor the carpark situation according to
the electronic map. As for the wrongly parked vehicles, the system supports manual
rewriting its parking spaces to adjust the real occupied situation of the parking space.
Database supporting is usually sql server/access.
Signs

Indoor and outdoor led displays are used to inform drivers of the available parking spaces and guide
them to empty ones.

slot finder intelligent parking guidance system

Total solution for optimum utilization of parking lots

Ideal for fully covered & paid parking lots with over 300 car parking slots

For malls, super markets, railway stations, airport, bus terminals, public parking lots

Can handle multiple entry & exit gates

Sensor control system: 1 per slot

Led lights: 1 per slot

Led color statuses: red when a car is parked, green when the slot is vacant. blue for slots
reserved for physically challenged drivers and yellow for reserved slots.

Display units: main and bay level, 7 segment led, lcd shows the number of vacant slot in each floor /
bay / level / segment

Our project:-

Thus far we have learnt that there is definitely a need to have a parking assistance
system, although in some countries there are completely automated systems installed

but the price rage is very high for that and the parking lots already in existence cannot
be modified into an automated system.
However we can convert a parking system already in being into a parking assistance
system which is somewhat better than nothing at all. With the ever increasing
population in the world and especially in india and the cars growing cheaper and
becoming more easily available to the people, there is an immediate need to
somewhat lessen the burden of carrying a car.
The parking lots in existence are pretty cumbersome as one has to get a ticket from a
person then move inside a basement like space and look for an empty space to park
your car.
In a parking assistance system, the user would get an automatically generated ticket,
a barrier to the parking lot opens and the person can know how many spaces are
occupied and how many spaces are empty. In our project we have implemented a
barrier which automatically opens and closes by sensing the car. The parking lot could
be segmented in divisions such that there is an lcd display outside every such division
to show how many spaces are occupied and how many are vacant, this eliminates the
cumbersome problem of entering the parking lot and leaving it after not finding a
space.

Circuit diagram

Arduino
Circuit diagram

The important part of our project is arduino. Arduino is hardware-software


equipment which has an inbuilt micro-controller.
The uno is a microcontroller board based on the atmega328p. It has:

Z14 digital input/output pins (of which 6 can be used as pwm outputs)

6 analog inputs

A 16 mhz quartz crystal, a usb connection

A power jack

An icsp header

A reset button.
Program is written in arduino software and dumped to the arduino kit so that graphs can be
displayed in a software called matlab. By using these graphs we can predict the weather.
Block diagram showing connections and graphs using arduino:

Datasheet
Microcontrolle
r
Operating
voltage
Input voltage
(recommende
d)
Input voltage
(limit)
Digital i/o pins
Pwm digital i/o
pins
Analog
input
pins
Dc current per
i/o pin
Dc current for
3.3v pin
Flash memory
Sram

atmega328p
5v
7-12v
6-20v
14 (of
provide
output)

which 6
pwm

6
6
20 ma
50 ma
32
(atmega328p)
of which 0.5
used
bootloader
2

kb
kb
by
kb

Eeprom
Clock speed
Length
Width
Weight

(atmega328p)
1
(atmega328p)
16 mhz
68.6 mm
53.4 mm
25 g

kb

Arduino is an open source tool for making computers that can sense and
control more of the physical world than your desktop computer. It's an
open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for
the board. Arduino can be used to develop interactive objects, taking
inputs from a variety of switches or sensors, and controlling a variety of
lights, motors, and other physical outputs. Arduino projects can be standalone, or they can communicate with software running on your computer
(e.g. Flash, processing, maxmsp). The boards can be assembled by hand or
purchased pre-assembled; the open-source ide can be downloaded for free.

Programming
The uno can be programmed with the arduino software (ide). Select
"arduino/genuino uno" from the tools > board menu (according to the
microcontroller on your board). The atmega328 on the uno comes
preprogrammed with a bootloader that allows you to upload new code to it
without the use of an external hardware programmer. It communicates
using the original stk500 protocol (reference, c header files).you can also
bypass the bootloader and program the microcontroller through the icsp
(in-circuit serial programming) header using arduino isp .

2.2.1 hardware:
An arduino board consists of an 8-bit atmel avr microcontroller with complementary components to
facilitate programming and incorporation into other circuits. An important aspect of the arduino is
the standard way that connectors are exposed, allowing the cpu board to be connected to a variety
of interchangeable add-on modules known as shields. Some shields communicate with the arduino
board directly over various pins, but many shields are individually addressable via an ic serial bus,
allowing many shields to be stacked and used in parallel. Official arduinos have used the megaavr
series of chips, specifically the atmega8, atmega168, atmega328, atmega1280, and atmega2560.
A handful of other processors have been used by arduino compatibles. Most boards include a 5 volt
linear regulator and a 16 mhz crystal oscillator (or ceramic resonator in some variants), although
some designs such as the lilypad run at 8 mhz and dispense with the onboard voltage regulator
due to specific form-factor restrictions. An arduino's microcontroller is also pre-programmed with a
boot loader that simplifies uploading of programs to the on-chip flash memory, compared with
other devices that typically need an external programmer.
The arduino board exposes most of the microcontroller's i/o pins for use by other circuits. The
diecimila, duemilanove, and current uno provide 14 digital i/o pins, six of which can produce pulsewidth modulated signals, and six analog inputs. These pins are on the top of the board, via female
0.1 inch headers. Several plug-in application shields are also commercially available.

Arduino and arduino-compatible boards uses of shields, which are printed circuit boards that sit
atop an arduino, and plug into the normally supplied pin-headers. These are expansions to the

base arduino. There are many functions of shields, from motor controls, to breadboarding
(prototyping).

2 . 2 . 2 S O F T WA R E
The arduino integrated development environment (ide) is a crossplatform application written in java, and derives from the ide for
the processing programming language and the wiring projects. It is
designed to introduce programming to artists and other newcomers
unfamiliar with software development. It includes a code editor with
features such as syntax highlighting, brace matching, and automatic
indentation, and is also capable of compiling and uploading programs to
the board with a single click. A program or code written for arduino is called
a "sketch".
Arduino programs are written in c or c++. The arduino ide comes with
a software library called "wiring" from the original wiring project, which
makes many common input/output operations much easier. The users need
only to define two functions to make an executable cyclic
executive program:

Setup(): a function that runs once at the start of a program and that can initialize settings.

Loop(): a function called repeatedly until the board powers off.

2.2.3

power

The uno board can be powered via the usb connection or with an external
power supply. The power source is selected automatically.
External (non-usb) power can come either from an ac-to-dc adapter (wallwart) or battery. The adapter can be connected by plugging a 2.1mm
center-positive plug into the board's power jack. Leads from a battery can
be inserted in the gnd and vin pin headers of the power connector.
The board can operate on an external supply from 6 to 20 volts. If supplied
with less than 7v, however, the 5v pin may supply less than five volts and
the board may become unstable. If using more than 12v, the voltage
regulator may overheat and damage the board. The recommended range is
7 to 12 volts.

2.4 pin description:


Arduino can be powered using power jack, usb port. Apart from this it can also be
powered by using a external battery or ac to dc adaptor through pin vin.
5v, 3.3v: there is a inbuilt regulator on the board. Through this regulator a constant dc
supply of 5v, 3.3v is provided.
Reset: this pin enables to reset the micro controller.
Ioref: this pin acts as reference to the inputs given to the arduino board.
There are 6 pins a0 a5 through which analog input can be given to the arduino
board.
There are 14 digital pins 0-13. Among these (3,5,6,9,10,11) are pwm pins(pulse
width modulation) from which analog output can be taken from the arduino board.
There is a inbuilt led on pin 13.
Aref- this pin acts as reference to the analog inputs.
Rx,tx are used for receiving and transmitting serial data.
Icsp- (in circuit serial programming)- these pins enable the user to programme the
chips on the circuit.
Examples of arduinos

Arduino diecimila in
stoicheia

Arduino mega 2560 r3


(front side)[a]

Ar
d

ui
no
d
ue
mi
la
no
ve
(r
ev
2
0
0
9
b)

Arduino mega 2560 r3


(back side)[a]

Arduino uno
Arduino nano

Arduino leonardo
Arduino due (arm-based)

Arduino mega
Lilypad arduino (rev
2007)

Arduino and arduino-compatible boards use printed circuit expansion


boards called "shields", which plug into the normally supplied arduino pin
headers. Shields can provide motor controls, gps, ethernet, lcd,
or breadboarding (prototyping). A number of shields can also be made diy.

Example arduino
shields

Screw-terminal breakout
shield in a wing- screwterminal breakout shield
in a wing-type format
Multiple shields can be
stacked. In this example
the top shield contains
a solderless
breadboard.

Adafruit motor shield with


screw terminals for
connection to motors

Adafruit datalogging
shield with a secure
digital (sd) card slot and
real-time clock (rtc) chip

hackarobot fabric
shield designed for
arduino nano to
hook up motors and
sensors such as
gyroscope or gps, and other breakout boards
such as wifi, bluetooth, rf, etc.

The maximum length and width of the Uno PCB are 2.7 and 2.1
inches respectively, with the USB connector and power jack extending
beyond the former dimension. Three screw holes allow the board to be
attached to a surface or case. Note that the distance between digital pins
7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of
the other pins.

1)

Seven Segment Display

Here we have used a common cathode &


segment display LT543

7- SEGMENT D ISPLAY
An LED or Light Emitting Diode, is a solid state optical PNjunction diode which emits light energy in the form of
photons when it is forward biased by a voltage allowing
current to flow across its junction, and in Electronics we call
this process electroluminescence.
The actual colour of the visible light emitted by an LED,
ranging from blue to red to orange, is decided by the spectral
wavelength of the emitted light which itself is dependent
upon the mixture of the various impurities added to the
semiconductor materials used to produce it.

7-segment Display
Light emitting diodes have many advantages over traditional
bulbs and lamps, with the main ones being their small size,
long life, various colours, cheapness and are readily
available, as well as being easy to interface with various
other electronic components and digital circuits.
But the main advantage of light emitting diodes is that
because of their small die size, several of them can be
connected together within one small and compact package
producing what is generally called a 7-segment Display.
The 7- SEGMENT DISPLAY , also written as seven segment
display, consists of seven LEDs (hence its name) arranged
in a rectangular fashion as shown. Each of the seven LEDs is
called a segment because when illuminated the segment
forms part of a numerical digit (both Decimal and Hex) to be
displayed. An additional 8th LED is sometimes used within
the same package thus allowing the indication of a decimal
point, (DP) when two or more 7-segment displays are
connected together to display numbers greater than ten.
Each one of the seven LEDs in the display is given a
positional segment with one of its connection pins being
brought straight out of the rectangular plastic package. These
individually LED pins are labelled from a through
to g representing each individual LED. The other LED pins
are connected together and wired to form a common pin.

So by forward biasing the appropriate pins of the LED


segments in a particular order, some segments will be light
and others will be dark allowing the desired character pattern
of the number to be generated on the display. This then
allows us to display each of the ten decimal digits 0 through
to 9on the same 7-segment display.
The displays common pin is generally used to identify which
type of 7-segment display it is. As each LED has two
connecting pins, one called the Anode and the other called
the Cathode, there are therefore two types of LED 7segment display called: Common Cathode (CC)
and Common Anode(CA).
The difference between the two displays, as their name
suggests, is that the common cathode has all the cathodes of
the 7-segments connected directly together and the common
anode has all the anodes of the 7-segments connected
together and is illuminated as follows.
1. The Common Cathode (CC) In the common cathode
display, all the cathode connections of the LED segments are
joined together to logic 0 or ground. The individual
segments are illuminated by application of a HIGH, or
logic 1 signal via a current limiting resistor to forward bias
the individual Anode terminals (a-g).
C OMM ON C ATHODE 7- SEGMENT D ISPL AY

2. The Common Anode (CA) In the common anode


display, all the anode connections of the LED segments are
joined together to logic 1. The individual segments are
illuminated by applying a ground, logic 0 or LOW
signal via a suitable current limiting resistor to the Cathode
of the particular segment (a-g).
C OMM ON A NODE 7- SEGMENT D ISPL AY

In general, common anode displays are more popular as


many logic circuits can sink more current than they can
source. Also note that a common cathode display is not a
direct replacement in a circuit for a common anode display
and vice versa, as it is the same as connecting the LEDs in
reverse, and hence light emission will not take place.
Depending upon the decimal digit to be displayed, the
particular set of LEDs is forward biased. For instance, to
display the numerical digit 0, we will need to light up six of
the LED segments corresponding to a, b, c, d, e and f. Then
the various digits from 0 through 9 can be displayed using a
7-segment display as shown.
7-S EGM ENT D ISPL AY S EGMENTS
N UM BERS .

FOR ALL

Then for a 7-segment display, we can produce a truth table


giving the individual segments that need to be illuminated in
order to produce the required decimal digit
from 0 through 9 as shown below.

7-segment Display Truth Table

Individual Segments Illuminated

D RIVING

7- SEGM ENT D ISPL AY

Although a 7-segment display can be thought of as a single


display, it is still seven individual LEDs within a single
package and as such these LEDs need protection from over
current. LEDs produce light only when it is forward biased
with the amount of light emitted being proportional to the
forward current.
This means then that an LEDs light intensity increases in an
approximately linear manner with an increasing current. So
this forward current must be controlled and limited to a safe
value by an external resistor to prevent damage to the LED
segments.
The forward voltage drop across a red LED segment is very
low at about 2-to-2.2 volts, (blue and white LEDs can be as
high as 3.6 volts) so to illuminate correctly, the LED
segments should be connected to a voltage source in excess
of this forward voltage value with a series resistance used to
limit the forward current to a desirable value.
Typically for a standard red coloured 7-segment display,
each LED segment can draw about 15 mA to illuminated
correctly, so on a 5 volt digital logic circuit, the value of the
current limiting resistor would be about 200 (5v
2v)/15mA, or 220 to the nearest higher preferred value.
So to understand how the segments of the display are
connected to a 220 current limiting resistor consider the
circuit below.
D RIVING

7- SEGM ENT D ISPL AY

In this example, the segments of a common anode display


are illuminated using the switches. If switch a is closed,
current will flow through the a segment of the LED to the
current limiting resistor connected to pin a and to 0 volts,
making the circuit. Then only segment a will be illuminated.
So a LOW condition (switch to ground) is required to
activate the LED segments on this common anode display.
But suppose we want the decimal number 4 to illuminate
on the display. Then switches b, c, f and would be closed to
light the corresponding LED segments. Likewise for a
decimal number 7, switches a, b, c would be closed. But
illuminating 7-segment displays using individual switches is
not very practical.

2) Servo Motor
A servomotor is a rotary actuator or linear actuator that
allows for precise control of angular or linear position,
velocity and acceleration. It consists of a suitable motor
coupled to a sensor for position feedback. It also
requires a relatively sophisticated controller, often a
dedicated module designed specifically for use with
servomotors.

Servomotors are not a specific class of motor although


the term servomotor is often used to refer to a motor
suitable for use in a closed-loop control system.
Servomotors are used in applications such
as robotics, CNC machinery or automated
manufacturing.
M ECHANISM
A servomotor is a closed-loop servomechanism that
uses position feedback to control its motion and final
position. The input to its control is some signal, either
analogue or digital, representing the position
commanded for the output shaft.
The motor is paired with some type of encoder to
provide position and speed feedback. In the simplest
case, only the position is measured. The measured
position of the output is compared to the command
position, the external input to the controller. If the
output position differs from that required, an error
signal is generated which then causes the motor to
rotate in either direction, as needed to bring the output
shaft to the appropriate position. As the positions
approach, the error signal reduces to zero and the
motor stops.
The very simplest servomotors use position-only
sensing via a potentiometer and bang-bang control of
their motor; the motor always rotates at full speed (or is
stopped). This type of servomotor is not widely used in
industrial motion control, but it forms the basis of the
simple and cheap servos used for radio-controlled
models.
More sophisticated servomotors use optical rotary
encoders to measure the speed of the output shaft and
a variable-speed drive to control the motor speed. Both
of these enhancements, usually in combination with
a PID control algorithm, allow the servomotor to be

brought to its commanded position more quickly and


more precisely, with less overshooting.

S ERVOMOTORS

VS . STEPPER MOTORS

A servomotor consumes power as it rotates to the


commanded position but then the servomotor
rests. Stepper motors run warm to the touch because
they continue to consume power to lock in and hold the
commanded position.
Servomotors are generally used as a high-performance
alternative to the stepper motor. Stepper motors have
some inherent ability to control position, as they have
built-in output steps. This often allows them to be used
as an open-loop position control, without any feedback
encoder, as their drive signal specifies the number of
steps of movement to rotate, but for this the controller
needs to 'know' the position of the stepper motor on
power up. Therefore, on first power up, the controller
will have to activate the stepper motor and turn it to a
known position, e.g. until it activates an end limit
switch. This can be observed when switching on

an inkjet printer; the controller will move the ink jet


carrier to the extreme left and right to establish the end
positions. A servomotor will immediately turn to
whatever angle the controller instructs it to, regardless
of the initial position at power up.
The lack of feedback of a stepper motor limits its
performance, as the stepper motor can only drive a
load that is well within its capacity, otherwise missed
steps under load may lead to positioning errors and the
system may have to be restarted or recalibrated. The
encoder and controller of a servomotor are an
additional cost, but they optimise the performance of
the overall system (for all of speed, power and
accuracy) relative to the capacity of the basic motor.
With larger systems, where a powerful motor
represents an increasing proportion of the system cost,
servomotors have the advantage.
There has been increasing popularity in closed
loop stepper motors in recent years. They act like
servomotors but have some differences in their
software control to get smooth motion. The top 3
manufacturers of closed loop stepper motor systems
employ magnetic encoders as their feedback device of
choice due to low cost, and resistance to vibration. The
main benefit of a closed loop stepper motor is the cost
to performance ratio. There is also no need to tune
the PID controller on a closed loop stepper system
saving time.[5]
Many applications, such as laser cutting machines,
may be offered in two ranges, the low-priced range
using stepper motors and the high-performance range
using servomotors.

The Code:
#include <Servo.h>
Servo myservo; // create servo object to control a servo
#define ServoM
#define Bright
9 and 10.
#define Exit
#define In

12
11

//Connected to the servo motor.


//servo library disable PWM on pins

9
8

//Pin connected to the EXIT button.


//Pin connected to the IN button.

#define
#define
#define
#define

177
95
8
80

//Low position of the barrier.


//Up position of the barrier.
//Capacity of the parking lot.
//Display intensity %

BarLow
BarUp
CAPACITY
INTEN

//Pins conections to segments (cathodes).


#define segA 0
#define segB 1
#define segC 2
#define segD 3
#define segE 4
#define segF 5
#define segG 6
//Array with the segments to represent the decimal numbers (09).
byte segments[10] = {
// pgfedcba <--- segments
B00111111, // number 0
B00000110, // number 1
B01011011, // number 2
B01001111, // number 3
B01100110, // number 4
B01101101, // number 5
B01111101, // number 6
B00000111, // number 7
B01111111, // number 8
B01101111 // number 9
};
void setup(){
myservo.attach(ServoM);
pinMode(Exit, INPUT);
input
pinMode(In, INPUT);
input
digitalWrite(Exit, HIGH);
digitalWrite(In, HIGH);
pinMode(segA,OUTPUT);
pinMode(segB,OUTPUT);

// attaches the servo.


// set "EXIT" button pin to
// set "IN" button pin to
// Connect Pull-Up resistor.
// Connect Pull-Up resistor.

pinMode(segC,OUTPUT);
pinMode(segD,OUTPUT);
pinMode(segE,OUTPUT);
pinMode(segF,OUTPUT);
pinMode(segG,OUTPUT);
pinMode(Bright,OUTPUT);
analogWrite(Bright,255*INTEN/100);
myservo.write(BarLow);
//Barrier in the low position
// delay(1000);
}
int Available= 9;
available.

// Number of places

//=============================================================
===
void loop(){
Display(Available);
if(digitalRead(In)==0)
{
if(Available != 0){
Available--;
myservo.write(BarUp);
delay(3000);
myservo.write(BarLow);
}
}
if(digitalRead(Exit)==0)
{
if(Available != CAPACITY){
Available++;
myservo.write(BarUp);
delay(3000);
myservo.write(BarLow);
}
}
}
/
*-----------------------------------------------------------------Put the segments according to the number.
-------------------------------------------------------------------*/
void Display(int number){
byte segs = segments[number];
digitalWrite(segA,
digitalWrite(segB,
digitalWrite(segC,
digitalWrite(segD,
digitalWrite(segE,

bitRead(segs,
bitRead(segs,
bitRead(segs,
bitRead(segs,
bitRead(segs,

0)
1)
2)
3)
4)

);
);
);
);
);

digitalWrite(segF, bitRead(segs, 5) );
digitalWrite(segG, bitRead(segs, 6) );
}

Future Scope:
With the ever increasing population ,
there is a huge scope of this project
in future. Some countries like
Singapore and Germany have already
implemented these systems in some
of their places and so far it is pretty
effective however the cost is a major
factor and also the maintanence of
these systems doesnt come very
cheap , however with increasing
advancements in semiconductors
and power electronics technology,
there is no reason why these systems
cannot be implemented in future
unless some better system replaces
it in future. In India this system is
much needed since people are very
much sentimental about their cars
here and there has been a lot of
fights over parking in the near past.
So lets hope parking assistance

system will bring a change in that in


the near future.

References:
Wikipedia
https://en.wikipedia.org/wiki/Intelligent_Parking_Assist_System

Arduinoplayground
www.parkassist.com/

Das könnte Ihnen auch gefallen