You are on page 1of 90

Higher Technological Institute

10th Of Ramadan City

Electrical and Computer Engineering


Department
Graduation Project
Intelligent Car Parking Systems Using PLC

Under Supervision of
Dr: Shahira Elfeky
By
1. Mohamed Hossam Fathy 20160782
2. Samir Magdy El Shahat 20160413
3. Mahmoud salah Mahmoud 20160964
4. Youssef shaban mohamed 20170966
5. Shimaa Samy El gohary 20170376
6. Mohamed Anas Hammad 20170628
Acknowledgments
Every project huge or small is successful largely due to the effort of a
number of wonderful people who have always given their valuable
advice or lent a helping hand. I sincerely appreciate the inspiration;
support and guidance of all those people who have been instrumental in
making this project a success.

Our deepest gratitude to Allah for holding our hands and guiding us
throughout our lives. We would also like to express our gratitude to
Dr: Shahira Elfeky supervisor of our project for his expert and for his
time.

I would also like to thank all the faculty members of our college for their
critical advice and guidance without which this project would not have
been possible.

Project Team

I
Abstract

This project work presents the study and design of PLC based intelligent car
parking.

Smart car parking is a place that allows entry and exit of cars in an orderly and
tidy manner, which achieves the largest internal capacity that helps in parking the
car, as the garage works automatically and is allowed to enter it provided that
there is one of the empty places inside the parking.

For making this arrangement in a real plan very high technological instruments
are required. In this project a prototype of such a model is made. This prototype
model is made for accommodating six cars at a time

The availability of a parking space is detected by the photocell sensor, and the
sensors are controlled and vacancies are checked by the PLC, in addition to an
external screen placed outside the garage to see if there are empty spaces inside
the garage or not, specifying the exact empty place.
The presence of these elements within the project is a means of assistance to car
owners that helps them to see the location of empty spaces inside the garage with
ease of entry and exit from it. Total comfort and flexibility for car owners.
Due to these advantages, this system can be used in hotels, railway stations,
airports where crowding of car is more.

II
List of Contents
Chapter 1 (Introduction)
1.1 Introduction …………………………………………………………………… 2
1.2 Improper parking ……………………………………………………………... 3
1.3 Project Idea …………………………………………………………………..... 5
1.4 Why Intelligent Car Parking? ………………………………………………... 6
Chapter 2 (Hardware)
2.1 Introduction……………………………………………………………………. 9
2.2 List of Component……………………………………………………………...10
2.3 Introduction to PLC……………………………………………………………10
2.3.1 History of PLC ……………………………………………………………10
2.3.2 Introduction to PLC……………………………………………………......11
2.3.3 Architecture of PLC ………………………………………………………12
2.3.4 Types of PLC …………………………………………………………......14
2.3.5 Manufacturers of PLCs …………………………………………………...16
2.3.6 Applications of PLC ……………………………………………………...16
2.3.7 Working of PLC ………………………………………………………….19
2.3.8 PLC used in project ……………………………………………………....22
2.4 Human Machine Interface (HMI)…………………………………………....24
2.4.1 Introduction……………………………………………………………….24
2.4.2 What is HMI?..............................................................................................25
2.4.3 HMI USES………………………………………………………………..25
2.4.4 Connection between PLC and HMI………………………………………28
2.4.5 SCADA vs HMI ………………………………………………………….29
2.5 Relay…………………………………………………………………………...30
2.5.1 Relay components…………………………………………………………31
2.5.2 Types of relay……………………………………………………………..33
2.5.3 Choosing the right relay…………………………………………………..34
2.5.4 A way to check the relay………………………………………………….34
III
2.6 Switches………………………………………………………………………35
2.6.1 Types of push buttons…………………………………………………...35
2.7 DC Motor…………………………………………………………………….36
2.7.1 Device installation………………………………………………………36
2.7.2 Main Types of DC Motors………………………………………………37
2.8 Sensor………………………………………………………………………...39
2.8.1 What is a sensor?......................................................................................39
2.8.2 Why We Use Sensors?.............................................................................40
2.8.3 Types of Sensors………………………………………………………..41
2.8.4 Types of proximity sensor………………………………………………44
Chapter 3 (Software)
3.1PLC Programming Languages……………………………………………..46
3.1.1Programming by ladder diagram………………………………………..47
3.2 Boolean logic design by ladder program……………………………………
3.3 PLC Counter……………………………………………………..
3.4 PLC TIMER ……………………………………………………………….
3.4.1 TIMER INSTRUCTIONS………………………………………………..
3.4.2 Types of PLC timers………………………………………………………
3.5 PLC Software of Project……………………………………………………
3.5.1 S 7200 wiring diagram ……………………………………………………
3.5.2 Plc Software of the project…………………………………………………
3.6 HMI in our project …………………………………………………………….
3.6.1 How we select the screen………………………………………………….
Conclusion…………………………………………………………………………
Reference…………………………………………………………………………..

IV
List of Figure
Fig(1) Improper parking…………………………………………………………………
Fig(2)Increase the number of cars……………………………………………………….
Fig(3)Car park entry……………………………………………………………………..
Fig(4) Parking inside……………………………………………………………………..
Fig(5) Our project……………………………………………………………………….
Fig(6) PLC SIEMENS…………………………………………………………………..
Fig(7) Architecture of PLC……………………………………………………………..
Fig(8) Mitsubishi Compact PLC ………………………………………………………………
Fig(9) Modular PLC…………………………………………………………………………………
Fig(10) Smart Relay ……………………………………………………………………………………
Fig(11) PLC Block Diagram………………………………………………………………………….
Fig(12) PLC Scan Cycle……………………………………………………………………………
Fig(13) PLC used in project………………………………………………………………………..
Fig(14) PLC Datasheet…………………………………………………………………
Fig(15) HMI forms…………………………………………………………………
Fig(16) screen and plc connection………………………………………………….
Fig(17) example of HMI……………………………………………………………
Fig(18) Connection between PLC, HMI, and PC …………………………………
Fig(19) Relay ……………………………………………………………………………
Fig(20) Relay Component……………………………………………………………….
Fig(21) Relay Contact points types……………………………………………………..
Fig(22) Types of push buttons………………………………………………………..
Fig(23) Device installation…………………………………………………………….
Fig(24) Permanent Magnet DC Motors…………………………………………………..
Fig(25) Compound DC Motors……………………………………………………………
Fig(26) Compound DC Motors………………………………………………………….
Fig(27) Series DC Motors………………………………………………………………..
Fig(28) Analog and Digital signals………………………………………………………

V
Fig(29) Sensor…………………………………………………………………………
Fig(30) types of sensors………………………………………………………………
Fig(31) proximity sensor………………………………………………………………
Fig(32) proximity sensor….……………………………………………………………
Fig(33) PNP proximity sensor………………………………………………………….
Fig(34) NPN proximity sensor…………………………………………………………..
Fig(35) Ladder Diagram………………………………………………………………..
Fig(36) AND logic ladder diagram ......................................................................................
Fig(37) OR logic ladder diagram .........................................................................................
Fig(38) NOT logic ladder diagram ......................................................................................
Fig(39) NAND logic ladder diagram ...................................................................................
Fig(40) NOR logic ladder diagram ......................................................................................
Fig(41) XOR logic ladder diagram ......................................................................................
Fig(42) X-NOR logic ladder diagram ..................................................................................
Fig(43) Counter function block with up, down, and reset counter instructions……………
Fig(44) PLC Timer………………………………………………………………………….
Fig(45) Timer Instruction…………………………………………………………………….
Fig(46) on-delay timer……………………………………………………………………
Fig(47) On-delay timer applications……………………………………………………..
Fig(48) Off-delay timer applications……………………………………………………
Fig(49) S 7200 wiring diagram……………………………………………………………
Fig(50)Network 1 of PLC program ....................................................................................
Fig(51)Network 2 of PLC program ....................................................................................
Fig(52)Network 3 of PLC program ....................................................................................
Fig(53)Network 4 of PLC program ....................................................................................
Fig(54) Network 5 of PLC program ....................................................................................
Fig(55) Network 6 of PLC program………………………………………………………
Fig(56) Network 7 of PLC program ....................................................................................
Fig(57)Network 8 of PLC program ....................................................................................

VI
Fig(58) Network 9 of PLC program ....................................................................................
Fig(59) Network 10 of PLC program ..................................................................................
Fig(60) select HMI…………………………………………………………………………
Fig (61) communication setting…………………………………………………………….
Fig (62) screen1…………………………………………………………………………….
Fig(63) screen1…………………………………………………………………………….
Fig (64) screen2……………………………………………………………………………
Fig(65) write address screen2……………………………………………………………..
Fig (66) read address in screen2…………………………………………………………..
Fig (67) parking in screan3………………………………………………………………..

VII
List of Tables
Table (1) Difference between Microcontroller and PLC…………………………………
Table (2) Counter instructions…………………………………………………………….

VIII
List of Abbreviations

PLC: Programmable Logic Control

HMI: Human Machine Interface

SPST: A switch has one input and one output.

SPDT: The switch has one input and two outputs.

DPST: A switch has two inputs and one output for each input

DPDT: A switch has two inputs and two outputs

PIR: Passive Infrared

IX
Ch1: Introduction

1
1. Introduction
- Car parking systems have been around almost since the time cars were
invented. In any area where there is a significant amount of traffic, there are
car parking systems. Car Parking systems were developed in the early 20th
century in response to the need for storage space for vehicles.

- With the rapid proliferation of vehicle availability and usage in recent


years, finding a vacant car parking space has become more and more
difficult, resulting in a number of practical conflicts. Parking problems are
becoming ubiquitous and ever growing at an alarming rate in every major
city. Wide usage of wireless technologies with the recent advances in
wireless applications for parking manifests that digital data dissemination
could be the key to solve emerging parking problems.

- There are several advantages of employing a car park system for urban
planners, business owners and vehicle drivers. They offer convenience
for vehicle users and efficient usage of space for urban-based companies.
Automated car park systems save time, money, space and simplify the
often tedious task of parking.

2
1.2 Improper parking
Improper car parking is, when a car is not parked correctly in allocated
parking area. Due Improper car parking the space allocated for parking will
not be used in proper manner. This may create traffic congestion.

3
Fig(2)Increase the number of cars

- With the increase in the number of cars and the need for car owners for
parking spaces, this went with the direction of the owners of institutions and
public and private establishments to provide parking spaces, taking into
account providing comfort for car owners, facilitating entry and exit
processes or finding places inside the garage while saving time for owners of
these cars in finding places inside the garage.

4
1.3 Project Idea
- With the development in all areas of technology and the great development
in all branches, smart garages have begun to appear

- smart garages provide all means of safety and comfort that allow car owners
to be able to park their cars easily and conveniently, in addition to saving
time in searching for empty places to park.

- The idea of the project revolves around the practical application of the idea
of smart garages, where the project contains entry and exit gates for the entry
and exit of cars. The gates open if there are parking spaces inside and do not
allow opening at all if the number of places in cars inside is complete with
the availability of a screen to display if there are free places inside Or the
places are complete and with the vacant space specified specifically to make
it easier for car owners to find parking spaces.

- From the inside, there are sensors in every parking space that sense when the
car is parked in the specified place and are connected to the external HMI via
a PLC device.

5
1.4 Why Intelligent Car Parking?
 Efficiency

The car parking system provides car parking solutions that accommodate
the maximum number of cars in the least space by organizing the parking
spaces in contrast to the random parking spaces

 Saves Time

Smart garages save time, as organizing parking spaces in an organized


manner works to save time in reaching parking spaces, in addition to
providing an external screen that car owners can see precisely in empty
places, which saves time and effort for car owners.

 Easy

Informing car owners of the empty spaces and organizing the parking spaces
in an orderly manner that makes it easier for visitors to reach and move
easily, which saves effort and makes it easier for car owners.

 Car Safety

Providing safety systems and guards to protect cars inside the garage that
provides safety for cars

 Safer for drivers

Organizing the places from the inside appropriately with the organization of
the way of entering and leaving the garage, providing places for cars and
maintaining them, and avoiding cars colliding with each other.

6
Fig(3)Car park entry

7
Fig(4) Parking inside

8
Chapter2: Hardware

2.1 Intoduction
The car parking system is implemented on Siemens S7-200 PLC, this PLC also has integrated
HMI screen. HMI is an electronic device that connects the operator to the machine. It is
designed to make this project user friendly and easy to access.

Fig(5) Our project


9
2.2 List of Component

 Programmable Logic Controllers (PLC)

 Human Machine Interface (HMI)

 Relay

 Switches

 Photo Sensor

2.3 Introduction to PLC:

2.3.1 History of PLC

In the 1960's PLC were first developed to replace relays and relay control systems. Relays,
while very useful in some applications, also have some problems. The primary reason for
designing such a device was eliminating the large cost involved in replacing the complicated
relay based machine control systems for major U.S. car manufacturers. These controllers
eliminated the need of rewiring and adding additional hardware for every new configuration of
logic. These, along with other considerations, led to the development of PLCs. PLC was more
improved in 1970‟s. In 1973 the ability to communicate between PLCs was added. This also
made it possible to have the controlling circuit quite a ways away from the machine it was
controlling. However, at this time the lack of standardization in PLCs created other problems.
This was improved in the 1980's. The size of PLC was also reduced then, thus using space
even more efficiently. The 90's increased the collection of ways in which a PLC could be
programmed.

10
2.3.2 Introduction to PLC:

- PLC (Programmable Logic Controller) is a device that was invented to replace the
necessary sequential relay circuits for machine control.

- The PLC works by looking at its inputs and depending upon their state, turning on/off its
outputs.

- The user enters a program, usually via software, that gives the desired results.

- PLCs are used in many "real world" applications. If there is industry present, chances are
good that there is a PLC present. If you are involved in machining, packaging, material
handling, automated assembly or countless other industries you are probably already
using them. If you are not, you are wasting money and time.
Almost any application that needs some type of electrical control has a need for a PLC.

Fig(6) PLC SIEMENS

11
2.3.3 Architecture of PLC

The PLC gives output in order to switch things on or off. The PLC‟s output is proportionally
activated according on the status of the system‟s feedback sensors and input terminal which is
connected to PLC. The decision to activate output is based on logic program. The logic
program stored in RAM or ROM memory. The PLC also have same as computer, a CPU, data
bus and address bus to communicate with external devices such as programmers, display
monitor. The next diagram shows a simplified diagram of PLC‟s structure. The central
processing unit control everything according to a program stored in a memory (RAM/ROM).
Everything is interconnected by two buses, the address bus and data bus. The system must be
able and A/D converter.

Fig(7) Architecture of PLC

12
Advantages of PLC:

- Flexibility (in case of system function modification, the circuit need not to be rewired
but the modification will be done in the S/W program)
- Compact
- Easy to fault diagnostics and maintenance
- Decrease installation time
- Most modern PLC can be linked to SCADA system and HMI
- No need for additional auxiliary contacts, timers, counters and auxiliary contactors (or
relays)

Disadvantages of PLC:

- Expensive (so relays are preferable in simple and small systems)


- Need to be programmed
- Incompatibility of S/W for different PLC manufactures

13
2.3.4 Types of PLC

1- Compact PLC

A Compact PLC is the more simple type of controller, and contains all of the basic system
components within a single housing, or box. These components typically include the
processor, which runs the software program, in addition to ports for input and output
connections. Unitary PLCs are typically attached directly to the device or application that is
being controlled.

Fig(8) Mitsubishi Compact PLC

A commonly used example of a unitary PLC type is the MicroLogix 1000, built by Allen
Bradle6y. The MicroLogix 1000 includes on-board memory for storing programs, 32 digital
input and output ports, and a communications port used to program the unit. This setup is
typical of many unitary systems.

14
2- Modular PLC
A modular PLC shown in Fig 10 contains several different modules that can be coupled
together to build a customized controller. Typically, a base module contains core functions
such as electrical power regulation, the computer processor, and input connections. Additional
modules, including analog to digital signal converters or additional outputs, can be added to
this core unit as needed. This modular design allows a PLC to be customized and changed
easily.

Fig(9) Modular PLC

The Allen Bradley MicroLogix 1200 is a commonly used example of the modular PLC type.
This unit is able to handle between 23 and 40 inputs and outputs. The actual number of
connections can be expanded easily by adding modules. This provides a wide range of
flexibility and is typical of a modular PLC.

15
2.3.5 Manufacturers of PLCs
Allen Bradley PLCs (AB)

Bosch Rexroth PLCs

ABB(Asea Brown Boveri) PLCs

Siemens PLCs

Omron PLCs

Mitsubishi PLCs

Hitachi PLCs

Delta PLCs

2.3.6 Applications of PLC


1. The PLC can be programmed to function as an energy management system for boiler

control for maximum efficiency and safety.

2. In automation of blender recliners

3. In automation of bulk material handling system at ports.

4. In automation for a ship unloaded.

5. Automation for wagon loaders.

6. For blast furnace charging controls in steel plants.

7. In automation of brick molding press in refractory.

8. In automation for galvanizing unit.

9. For chemical plants process control automation.

10.In automation of a rock phosphate drying and grinding system.

16
11. Modernization of boiler and turbo generator set.

Differences between PLC and smart relay

- Smart relay usually cheaper than PLC

- Smart relay usually can be programmed from the face plate

- Number contacts per rung and number of rungs are limited in smart relay

- Smart relay usually can’t be linked with HMI or SCADA system

Fig(10) Smart Relay

17
Difference between Microcontroller and PLC

Table (1) Difference between Microcontroller and PLC

18
2.3.7 Working of PLC

PLC Block Diagram

Fig(11) PLC Block Diagram

Input module
• Digital input
• Analog input

Central Processing Unit (CPU)

The CPU is the brain of the system. The CPU is a very microprocessor-based system that
replaces control relays, counter, timers and sequencers. A processor appears only once in a plc
and it can be either a one bit (or) a word logic operation. PLCs with word processors are used
when processing text and numerical data, calculations, gauging, controlling and recording as
well as the simple processing of signals in binary code are required. The CPU accepts (reads)
input data from various sensing devices, executes the stored user program from memory and
sends appropriate commands to control device. A direct current (dc) source is required to
produce the flow level voltage used by the processor and the inputs and outputs modules. The
processor memory module is a major part of the CPU housing. Memory is where the control
plan or program is held or stored in the controller the information stored in the memory relates
to the way the input and output data should be processed
19
PLC Scan Cycle

Fig(12) PLC Scan Cycle

20
Damage of PLC:

- from device supply terminals:


 Supply over voltage
 Supply under voltage

-From input module terminals:

 Over voltage in input module supply.


-from output module terminals:

 Over voltage in output module supply (which supplies loads connected with PLC output
module)

 Over current because of connecting large loads directly with PLC output module
Short circuit (SC) in output module Fast output (in the range that relay contacts can sense it)
for long period (only if PLC is relay output) causes mechanical damage in the internal relay of
output module

2.3.8 PLC used in project


21
SIMATIC S7-200 SMART PLC is designed to suit the needs of developing markets that have
higher pressures of price and demands on performance. Providing an excellent performance-to-
price ratio, SIMATIC S7-200 SMART PLC when combined with other SMART drive
products from Siemens helps in building extremely cost effective efficient automation
solutions. The perfect combination of Siemens SIMATIC automation products and
SINAMICS drive products, has created new micro automation solutions that are economical,
reliable and easy to use.

Fig(13) PLC used in project

22
Fig(14) PLC Datasheet

23
2.4 Human Machine Interface (HMI)

2.4.1 Introduction:
We use HMIs in industry to control and monitor machines. A very common
HMI that you all encounter on a regular basis would be an ATM machine. The
screen and push buttons allow you to operate the machine to dispense a certain
amount of money, or to deposit money.

Fig (15) HMI forms

- It would be hard to have a good, automated process in industry without an


HMI. Many times, an HMI will be in the form of a screen, kind of like a
computer screen, and more times than not, they are touch screens. Operator or
maintenance personnel can operate and monitor the machine from the HMI. They
may include information like temperature, pressure, process steps, and material
counts. They can also show very precise levels in tanks and exact positioning of
machines. Where machine information used to be viewed on multiple indicators
it can now be viewed on one screen.

- The possibilities are only limited to the software and hardware used.

24
2.4.2 What is HMI?

A Human-Machine Interface (HMI) is a user interface or dashboard that connects a person


to a machine, system, or device. While the term can technically be applied to any screen
that allows a user to interact with a device, HMI is most used in the context of an industrial
process.

Although HMI is the most common term for this technology, it is sometimes referred to as
Man-Machine Interface (MMI), Operator Interface Terminal (OIT), Local Operator Interface
(LOI), or Operator Terminal (OT). HMI and Graphical User Interface (GUI) are similar but not
synonymous: GUIs are often leveraged within HMIs for visualization capabilities.

2.4.3 HMI USES:

HMIs can connect to PLC logic and display it on the screen for troubleshooting
purposes. This can save valuable time compared to connecting a computer or laptop
every time.

Fig(16) screen and plc connection


25
HMI is the fact that plants and other industrial sites can monitor and control
multiple machines or other equipment. A small manufacturing facility could even
monitor the entire plant on one centrally located HMI.
Water and wastewater facilities have utilized this for years by coupling an HMI with a
PLC. They can monitor remote locations, like water pumps, as well as equipment inside
the plant.

In industrial settings, HMIs can be used to:


 Visually display data
 Track production time, trends, and tags
 Oversee KPIs
 Monitor machine inputs and outputs
HMI technology is used by almost all industrial organizations, as well as a wide range
of other companies, to interact with their machines and optimize their industrial
processes.

Industries using HMI include:


 Energy
 Food and beverage
 Manufacturing
 Oil and gas
 Power
 Recycling
 Transportation
 Water and wastewater

The most common roles that interact with HMIs are operators, system integrators,
and engineers, particularly control system engineers. HMIs are essential resources
for these professionals, who use them to review and monitor processes, diagnose
problems, and visualize data.

HMIs communicate with Programmable Logic Controllers (PLCs) and input/output


sensors to get and display information for users to view. HMI screens can be used
for a single function, like monitoring and tracking, or for performing more

26
sophisticated operations, like switching machines off or increasing production
speed, depending on how they are implemented.

HMIs are used to optimize an industrial process by digitizing and centralizing data for
a viewer. By leveraging HMI, operators can see important information displayed in
graphs, charts, or digital dashboards, view and manage alarms, and connect with
SCADA and MES systems, all through one console.

 How does the HMI connect to the machine to be able to control and
monitor it?

HMI is the operating panel and monitoring screen.


First, HMIs use special software so engineers can program them correctly. Different
brands of panels use different software accordingly. The software allows the engineer
to design what the operator will see on the screen, what they can monitor on the
screen, what “buttons” can be pushed, and how the operator can manipulate the
machine.
For example, an HMI may have a large tank displayed on the screen with the level of
a liquid displayed. Next to the tank is a pump to lower the liquid level. An HMI can
also have the start and stop button displayed and usable on the screen next to the
pump. This display would be able to turn the pump on and off.

Fig (17) example of HMI

it is not as easy as just placing a button on the screen or a tank with a level on the
screen. The person programming the HMI must program each indicator and button to
a specific input or output address of a PLC. Engineers can program an HMI to
perform almost any function that can be controlled or information that can be

27
monitored by a PLC. HMIs and PLCs work together to monitor and control the
machine.

2.4.4 Connection between PLC and HMI

PLC could relate to HMI via Ethernet or Wireless

Ethernet Connection:
In the past, it was common for PLC suppliers to limit connectivity to their own hardware and
software, but user demands have forced a move to more open systems. This openness now
allows many PLCs to link to just about any HMI, typically through Ethernet. While this takes
care of hardware connectivity in many instances, there's still the issue of protocol
compatibility. The ability to communicate with multiple protocols simultaneously on a single
network is a big advantage of Ethernet. This allows linking of two or more PLCs from
different suppliers to a single HMI -- all on the same network. If PLC A, B, and C each has an
Ethernet port but uses different communication protocols -- such as Modbus TCP/IP,
Ethernet/IP, and ProfNet -- the HMI can communicate with all three on the same network.

28
Fig (18) Connection between PLC, HMI, and PC

2.4.5 SCADA vs HMI

In large industrial structures, it is impractical or even impossible to control the individual


parts of the system because, in most installations, the parts are often located very far from
each other. Thus, the need arises to monitor and control them with SCADA and HMI. The
main difference between SCADA and HMI is their scope. HMI is just a part of the larger
SCADA system. Without SCADA, the HMI would be pretty much useless.
SCADA” stands for “Supervisory Control and Data Acquisition,” which is an integrated
system that is used to control and monitor the workings of the individual parts of the plant.
The SCADA often controls pumps, fans, and other machinery along with their other
characteristics. The controlling mechanisms are electronic circuits known as programmable
logic circuits or PLCs. The PLC controls the machine as well as polls the sensors for data. The
data is then sent to the control room. In the control room, the operator needs to make sense of
the data as well as issue commands like turning the machines on or off. This is where the
HMI, or Human Machine Interface, comes in. The HMI is usually a graphical layout of the
entire system with gauges, lights, and controls situated in the corresponding locations of the
machines. The gauges show the normal range of operation as well as the abnormal range so
that the operator knows if the equipment is within the accepted operating range. The lights
may indicate if the machine is working or not, as well as the occurrence of faults. The controls
send the instructions to the PLC, which in turn control the machine.
The SCADA is the entirety of the system that controls and monitors the operations of a plant.
But in general operation, most of its parts are not really to be dealt with on a regular basis.
Most of the time, only the HMI is visible and interacted with. This makes people think that
SCADA and HMI are the same or are different implementations of the same system when one
is just an integral part of the other.

29
2.5 Relay
 It is one of the most important electrical elements in electronic circuits, and it is a
mechanical switch that is electrically controlled by a voltage applied to the coil inside it.
 The relay is more of a bearing element than an electronic one. It is available in different
sizes and with different endurance capacities starting from 1ampere up to 60ampere.
 It is available in multiple voltages such as 220v 60v 48v 36v 24v 12v 9v 6v.
 The contactor's composition is a normal contactor, but without points Only main
auxiliary points, so it is used in control circuits
 It is an electrical element consisting of a mechanical switch that can be controlled
Electrically by connecting a voltage to its coil
 Relay is widely spread in the industry in different sizes and in different shapes, but All
business ideas have one, and it is used in electronic and electrical circuits Various fields
of industry

Fig(19) Relay

30
2.5.1 Relay components

1. Frame: Heavy-duty frame that contains and supports the relay


parts.

2. Coil: An insulated copper wire wound around an iron core.

3. Spring: Returns the Armature to its original position.

4. Contacts: There are open and closed contact points that open or
close the circuit (N/O - N/C – COMM)

5. Mounting base: The relay is installed on its own mounting base,


and there are some types that are installed on printed electronic
cards.

Fig(20) Relay Component

31
Advantages of relays

1- Cheap and simple


2- Static field and noise don’t affect in it
Disadvantages of relays

1- Large size
2- Noisy
3- Design and installation time is large
4- Difficult in fault diagnostics and maintenance
Relay types according to the type of contact points

1- SPST: A switch has one input and one output.


2- SPDT: The switch has one input and two outputs.
3- DPST: A switch has two inputs and one output for each input
4- DPDT: A switch has two inputs and two outputs

Fig(21) Relay Contact points types

32
2.5.2 Types of relay

1- Reed relay (This is the type of relay used in the project)


It works on the principle of magnetism, where it reaches its contact points when a piece
of magnet is near it.

2- Latching relay
Its principle of operation is based on continuous conduction when pressed.

3- Contactor relay
It is similar to the idea of the relay, but it is used to feed large loads, such as electric
motors

4- Solid-state relay
It does not depend on the connection through mechanical parts and the magnetic coil,
but rather on the connection through an electronic board designed in a certain way to
perform the function of the relay, and this type is high in cost compared to mechanical
relays.

5- Overload protection relays


It is used to protect loads from rising and falling electric current.

6- Mercury-Wetted relay
It works on conduction and separation by a drop of mercury inside a tube, in the case of
the conduction it is in a vertical position, and in the case of the separation it is in a
horizontal position.

33
2.5.3 Choosing the right relay

1- Relay coil voltage value and type, available in (6v, 9v, 12v, 15v, 24v, 36V, 48v).

2- Maximum contact current, ranging from 1A-60A

3- The number and type of contact points, such as (DPDT, SPST, DPST, SPDT).

2.5.4 A way to check the relay

Through the Avo, by placing the Avo indicator on the ohm and measuring the
resistance.

As for petitions, the most important thing in them is that they be clean and measured
between each other as an ohm If you do not read anything, it is oxidized and must be
cleaned.

34
2.6 Switches

One of the most commonly used components in automatic control circuits or PLC are
push button switches.

Its uses: It is used to start or stop one or more engines. It can also be used in other things
according to the application

2.6.1 Types of push buttons

1- Type NO i.e. normally opened: it is always open and when pressed it turns into closed and when the
hand is raised it returns to open

2- NC type i.e. normally closed: it is always closed and when pressed it opens and when the hand is raised
it turns again to closed

3- Double type NO, NC: This type has two points, one of them is NO and the other is NC. When pressed,
it turns the open into closed and the closed into open. When the hand is raised, the original position is returned.

 We use push button (N/O)

Fig(22) Types of push buttons


35
2.7 DC Motor

An electric motor is simply an electromechanical transducer that generates mechanical energy


from electrical energy. The functional principle of the electric motor is based on the
electromagnetic effect.

A DC motor is defined as a class of electrical motors that convert direct current electrical
energy into mechanical energy.

A DC motor or DC motor is an electrical machine that converts electrical energy into


mechanical energy by creating a DC magnetic field.

2.7.1 Device installation:

In its simplest form, the device consists of two magnetic poles, a north pole and a south pole,
separated by a certain distance - called a fixed member - in the middle of which is placed a coil
connected to a battery that supplies it with a constant current. The coil forms the rotor of the
motor.

36
Fig(23) Device installation

2.7.2 Main Types of DC Motors


There are 4 main types of DC motors:

1- Permanent Magnet DC Motors

Fig(24) Permanent Magnet DC Motors

2- Compound DC Motors

Fig(25) Compound DC Motors

3- Shunt DC Motors

37
Fig(26) Compound DC Motors

4- Series DC Motors

Fig(27) Series DC Motors

WE use DC Motor (24V):


We use a DC motor 24 volts because we do not need more effort than this and to reduce the
cost.

 Why we use Series DC Motor?


 It is an easy assembly and simple design.
 Protection is very easy.
 It is an easy assembly and simple design.
 It is cost-effective.
 Vast starting torque.
 Series wound motors can use for AC or DC supply
 Advantages of Using DC Motors
 The cheapest and simplest types of DC motors.
 Easy speed control.
 DC motors are smaller in size
 Seamless operation
 Disadvantages of Using DC Motors
 It needs frequent maintenance.
 Short life span.
 As the speed increases, the shaft gets vibrated and the armature gets damaged.
 DC motors have a high initial cost.
38
 Uses for DC Motors
 Cranes
 Pump Drives
 Ceiling Fans
 Electric Vehicles
 Elevators
 Diesel Electric Locomotives

2.8 Sensor
2.8.1 What is a sensor?

A sensor is a device that measures physical input from its environment and converts it into data
that can be interpreted by either a human or a machine. Most sensors are electronic (the data is
converted into electronic data), but some are simpler, such as a glass thermometer, which
presents visual data. People use sensors to measure temperature, gauge distance, detect smoke,
regulate pressure and a myriad of other uses. 
 
There are two types of electronic sensors: analog and digital. Analog sensors convert physical
data into an analog signal. Analog sensors are much more precise than digital sensors, which
are limited to a finite set of possible values. Below is a chart showing the difference between
analog and digital signals:

Fig(28) Analog and Digital signals

39
Because analog signals are continuous, they can account for the slightest change in the
physical variable (such as temperature or pressure). Digital signals, while following the general
trend of variation, are restricted to fixed data (ones and zeros).

There are a multitude of types of sensors. In the average automobile alone, there are dozens of
different types of sensors. Tire pressure sensors indicate whether a tire is flat or in need of
more air. Self-driving cars such as the Tesla are equipped with ultrasonic sensors that measure
the distance between the vehicle and other objects in its environment using sound waves.
Home security systems use motion sensors, which detect the movement of primarily larger
objects. The most used motion sensor for home surveillance is called a Passive Infrared (PIR)
system, which detects infrared radiation in the sensor’s environment.   
 

Fig(29) Sensor

2.8.2 Why We Use Sensors?

The ability of Sensors is to measure multi various data on the activities taking place within a
system that throws open plenty of use cases.

The data measured by sensors can be used in:

40
1. Operating the system efficiently.
2. Monitoring the operations for any abnormalities.
3. Controlling the operations.
4. Utilizing the resources effectively.
5. Making design changes to improve performance further.
6. Enhancing Future product portfolio.

2.8.3 Types of Sensors:

the following is a list of different types of sensors that are commonly used in various
application. All these sensors are used for measuring one of the physical properties like
temperature, resistance, capacitance, conduction, Heat transfer etc.

1-temperture sensor

2-proximity sensor

3-Infaraed sensor

4-light sensor

5-Accelerometer sensor

6-pressure sensor

7-Ultrasonic sensor

8-touch sensor

9-flow and level sensor

41
10-tilt sensor

Fig(30) types of sensors

 proximity sensor:
The proximity sensor or photoelectric sensor is another type of position sensing
device. Photoelectric sensors use a modulated light beam that is either broken or
reflected by the target. The control consists of an emitter (light source), a receiver to
detect the emitted light, and associated electronics that evaluate and amplify the
detected signal causing the photo electric’s output switch to change state.

42
Fig(31) proximity sensor

Capacitive Proximity Sensors Theory of Operation

Capacitive proximity sensors are like inductive proximity sensors. The main difference
between the two types is that capacitive proximity sensors produce an electrostatic field
instead of an electromagnetic field. Capacitive proximity switches will sense metal as well as
nonmetallic materials such as paper, glass, liquids, and cloth.

43
Fig(32) proximity sensor

The sensing surface of a capacitive sensor is formed by two concentrically shaped metal
electrodes of an unwound capacitor. When an object nears the sensing surface it enters the
electrostatic field of the electrodes and changes the capacitance in an oscillator circuit. As a
result, the oscillator begins oscillating. The trigger circuit reads the oscillator’s amplitude and
when it reaches a specific level the output state of the sensor changes. As the target moves
away from the sensor the oscillator’s amplitude decreases, switching the sensor output back to
its original state

2.8.4 Types of proximity sensor:

1-PNP proximity sensor:


PNP proximity sensors provide an active HIGH output. When an object enters the detecting
range of the sensor, the output of the sensor relates to +24V. When connected to a PLC input,

44
it detects this as a logic HIGH signal. PNP proximity sensors are also known as ‘sourcing’
sensors.

Fig(33) PNP proximity sensor

2-NPN proximity sensor:


NPN proximity sensors provide an active LOW output. This means that when an object enters
the detecting range of the sensor, the output of the sensor relates to the ground. This type of
sensor is also known as ‘sinking’ sensor.

Fig(34) NPN proximity sensor

IN THE PROJECT USED IN PNP:

45
For a PNP type sensor, the PLC needs to be configured as a ‘sinking’ type. Connecting the
input 1M to 0V will configure the PLC as input sinking. With this configuration, the sensor
can ‘source current’ and the PLC will ‘sink current’ to detect sensor output.

For a PNP type proximity sensor, if an input card is used, it must be a ‘ sinking’ type card. The
S7-1200, Digital Input SM 1221 input card for S7-1200 PLCs is a sink/source configurable
input card and it can interface with either type of sensor.

Advantages of proximity Sensors:


 Senses all kinds of Materials.
 Long Life.
 Longest sensing range.
 Very fast response time.

Disadvantages of proximity Sensors


 Lens Subject to Contamination.
 Sensing Range Affected by color and reflectivity of target.

Applications of proximity Sensors


1- Packaging.
2- Material handling.
3- Parts detection.

Ch3: Software
46
3.1 PLC Programming Languages
 Ladder diagram (LD)
 Instruction List (IL)
 Function Block Diagram (FBD)
 Sequential Function Chart (SFC)
 Structured Test (ST)
 Continues Function Chart (CFC)

Ladder Diagram (LD)

The Ladder Diagram is also a graphics oriented programming language which approaches
the structure of an electric circuit. Ladder Diagram consists of a series of networks. Each
network consists on the left side of a series of contacts which pass on from left to right the
condition "ON" or "OFF" which correspond to the Boolean values TRUE and FALSE. To
each contact belongs a Boolean variable. If this variable is TRUE, then condition pass from
left to right. Fig [31] shows the simple ladder logic diagram with normally open, normally
closed and coil.

Fig(35) Ladder Diagram

47
3.1.1 Programming by ladder diagram

Ladder logic is a method of drawing electrical logic schematics. It is now a graphical


language very popular for programming Programmable Logic Controllers (PLCs). It was
originally invented to describe logic made from relays. The name is based on the observation
that programs in this language resemble ladders, with two vertical "rails "and a series of
horizontal "rungs" between them. A program in the ladder logic, also called ladder diagram
is similar to a schematic for a set of relay circuits.
The Ladder Diagram is also a graphics-oriented programming language which approaches
the structure of an electric circuit. The Ladder Diagram consists of a series of networks. A
network is limited on the left and right sides by a left and right vertical current line. In the
middle is a circuit diagram made up of contacts, coils, and connecting lines.
Each network consists on the left side of a series of contacts which pass on from left to right
the condition "ON" or "OFF" which correspond to the Boolean values TRUE and FALSE.
To each contact belongs a Boolean variable. If this variable is TRUE, then the condition is
passed from left to right along the connecting line. Otherwise, the right connection receives
the value OFF.

3.2 Boolean logic design by ladder program

1. AND logic: Y0=X0.X1

Fig(36) AND logic

48
OR logic:Y1=X0+X

Fig(37) OR logic

NOT logic: Y3=X0 not

Fig(38) NOT logic

NAND logic: Y0=X0.X1 not

Fig(39) NAND logic

49
NOR logic: Y1=X0+X1 not

Fig(40) NOR logic X-OR logic: Y2=X0 + X1

Fig(41) X-OR logic

X-NOR logic: Y2=X0 + X1

Fig(42) X-NOR logic

50
3.3 PLC Counter
Table(2) Counter instructions

 UP COUNTER
An up counter (CTU) output instruction adds a count, in increments of one,

every time its referenced event occurs. In a control application, this counter

turns a device ON or OFF after reaching a certain count .

Also, this counter can keep track of the number of parts (e.g., filled bottles, machined
parts, etc.) that pass a certain point. An upcounter increases its accumulated value (the
count value in its accumulated register) each time the up-count event makes an OFF-to-
ON transition. When the accumulated value reaches the preset value, the counter turns ON
the output, finishes the count, and closes the contact associated with the referenced output.
After the counter reaches the preset value, it either resets its accumu-lated register to zero
or continues its count for each OFF-to-ON transition, depending on the controller. In the
latter case, a reset instruction is used to clear the accumulated value.
 DOWN COUNTER
A down counter (CTD) output instruction decreases the count value in its accumulated
register by one every time a certain event occurs. In practical use, a down counter is used
in conjunction with an up counter to form an up/down counter, given that both counters
have the same reference registers. In an up/down counter, the down counter provides a
way to correct data that is input by the up counter. Depending on the programmable
controller, the down counter will either stop counting down at zero or at a specified
maximum negative value. In a block format instruction, a down count occurs every time
the down input of the counter transitions from OFF to ON.

 COUNTER RESET
A counter reset (CTR) output instruction resets up counter and down counter accumulated
values to zero. When programmed, a counter reset coil has the same reference address as
the corresponding up/down counter coils. If the counter reset rung condition is TRUE, the
reset instruction will clear the referenced address. The reset line in a block format counter
instruction sets the accumulated count to zero (accumulated register = 0). Figure 9-49
illustrates a typical block-formatted counter rung with up, down, and reset counter
instructions. The counter will count up when contact 10 closes, count down when contact
11 closes, and reset register 1003 to 0 when contact 12 closes. If the count is equal to 15
as a result of either an up or down count, output 100 will be ON. If the contents of register
1003 are greater than 15, output 101 will be ON. Output 102 will be ON if the
accumulated count value is less than 15
Fig(43) Counter function block with up, down, and reset counter instructions
3.4 PLC TIMER

PLC timers are internal PLC instructions that can be used to delay input and output signals
in the PLC program.
These timers operate like relay timers but you cannot hold a PLC timer in your hand and
they do not need to be connected to wires to operate.
PLC timer is an element in ladder logic programming taken from electrical systems.
Timers are devices that count time increments.
The timer creates a delay in both PLC programming and in relay boards on connection or
instantaneous disconnection.
Simply, when the input is activated the timer starts its operation keeping track of the time.
When this time exceeds the programmed time then the timer activates its output.
You could set the PLC timer from millisecond (ms) to an hour (hr) time span in the
programming of

Fig(44) PLC Timer


3.4.1 TIMER INSTRUCTIONS
There are two basic types of counters: those that can count up and those that
can count down. Depending on the controller, the format of these counters
may vary. Some PLCs use the ladder format (output coil), while others use
functional block format. illustrates these two formats .

Fig(45) Timer Instruction


3.4.2 Types of PLC timers

There are three main types of PLC timers:

The on-delay timer


Fig(46) on-delay timer

Next, I will discuss what happens to the PLC on-delay timer when the selector switch gets
turned on and off.

– When you turn on the selector switch, the timer enabled bit and timer timing bit turn on
and the timer’s accumulated value starts accumulating time.
– If you leave the selector switch on, the timer’s accumulated value will reach ten
thousand. When it does, the timer will stop accumulating time, the timer timing bit will
turn off, and the timer done bit will turn on.

– At this point, when you turn off the selector switch the timer accumulated value will
reset back to zero, and the timer enabled and timer done will turnoff.

– If you turn off the selector switch before the timer is done timing, the timer accumulated
value will reset back to zero and all of the timer bits will be off.
On-delay timer applications

On-delay timers are used a lot in PLC programs and in many different ways. For example,
an on-delay timer can be used on a conveyor’s start button.

The timer could be set up so that the start button would need to be pushed and held for
five seconds before the conveyor would start.

Fig(47) On-delay timer applications

Another on-delay timer could also be set up to sound a conveyor start-up warning horn
and light.
Off-delay timer
Next, I will discuss what happens to the PLC off-delay timer when the selector switch gets
turned on and off.

– When you turn on the selector switch, the timer’s accumulated value resets to zero, and
the timer enabled bit and the timer “done bit” turn on.

– When you turn off the selector switch, the timer accumulated value will start
accumulating time, the timer enabled bit will turn off, the timer timing bit will turn on and
the timer done bit will stay on.
– If you leave the selector switch off, the timer’s accumulated value will reach ten
thousand. When it does, the timer will stop accumulating time, the timer timing bit and the
timer done bit will turn off.

– If you turn on the selector switch before the timer is done timing, the timer accumulated
value will reset back to zero, the timer enabled bit will turn on, the timer timing bit will
turn off and the timer done bit will stay on.

Off-delay timer applications

Off-delay timers are used when you need something to stay running longer than
everything else. For example, cooling fans and pumps might continue to run after a
machine pauses from doing work.
Fig(48) Off-delay timer applications
Retentive on-delay timer
Retentive on-delay timers are a lot like on-delay timers. They get set up the same way and
the bits react in the same way.

The only major difference with retentive on-delay timers is how the timer accumulated
value acts when you turn the selector switch on and off and that it needs a reset bit.

– For an retentive on-delay, when the selector switch is turned on, the retentive on-delay
timer accumulated value starts accumulating time, the timer enabled bit turns on, and the
timer timing bit turns on.

– If the selector switch is left on, the accumulated value will reach ten thousand, the timer
will stop accumulating time, the timer enabled bit will stay on, the timer timing bit will
turn off, and the timer done bit will turn on.
– At this point, if the selector switch is turned off, the accumulated value will stay ten
thousand, the timer enabled bit will turn off, the timer timing bit will stay off, and the
timer done bit will stay on.
– If the selector switch is turned back on, only the timer “enabled bit” will turn on,
everything else will stay the same.

To reset the accumulated value of a retentive on-delay timer, a timer reset bit will need to
be added to the PLC program. I will use a momentary push button to trigger this reset bit.

– When the selector switch is off and the timer reset button is pushed, the timer
accumulated value will reset to zero and the timer done bit will turn off.

Retentive on-delay Applications

Retentive on-delay timers can be used to track the runtime of equipment. They can be set
up to trigger an indicator light to let someone know the equipment has run long enough
and requires maintenance to inspect and clean it.
3.5 PLC Software of Project
3.5.1 S 7200 wiring diagram

Fig(49) S 7200 wiring diagram

We have 8 points for input and 6 points for output In project we have 8 inputs and 4
outputs
Input Output
Push button for I0.0 Relay for open enter gate Q0.0
enter
Sensor 1 I0.1 Relay for close enter gate Q0.1
Sensor 2 I0.2 Relay for open exit gate Q0.3
Sensor 3 I0.3 Relay for close enter gate Q0.2
Sensor 4 I0.4
Sensor 5 I0.5
Sensor 6 I0.6
Push button for exit I0.7

3.5.2 Plc Software of the project


Network 1
The enter push button (I0.0) is connected with a up counter ( c0) With a reset enter gate
opening (Q0.0) and It has 1 time to be 1

Fig(50) Network 1 of PLC program

Network 2
The exit push button (I0.7) is connected with a up counter ( c1) With a reset exit gate
opening (Q0.3) and It has 1 time to be 1

Fig(51) Network 2 of PLC program


Network 3
We connect sensors ( I0.1 - I0.7 ) that sensing parking locations series to a Marker
( M0.1) and that condition make us confirm that when garage is complete no car can enter
it

Fig(52) Network 3 of PLC program

Network 4
Through the following network when C0 is 1 and motor for closing gate is 0 and M0.1 is 0
M0.0 will be 1

Fig(53) Network 4 of PLC program


Network 5
Through the following network we put on delay timer (T32)will operate with Q0.0 and
time for 0.2 seconds and off delay timer for 3 seconds to hold movement but after
configure timers we connect c0 as 1 and t32 is 0 for .2 sec and M0.1 is 0 (garage has an
empty location )after that gate will open for .2 sec till t32 is off

Fig(54) Network 5 of PLC program


Network 6
Through the following network Q0.1 (close enter gate ) will operate a timer (t 96) for
0.2 sec
After that M0.0 with t 36 as 0 and t 96 as 0 and m0.1 as 0 will operate closeing (Q0.1) till

t 96 is 1 (after 0.2 sec )

Fig(55) Network 6 of PLC program

Network 7
Through the following network when C1 is 1 and motor for closing gate (Q0.2)is 0 and
M0.2 will be 1

Fig(56) Network 7 of PLC program


Network 8
Through the following network we put on delay timer (T33)will operate with Q0.3 and
time for 0.2 seconds and off delay timer for 3 seconds to hold movement but after
configure timers we connect c0 as 1 and t33 is 0 for .2 sec and after that gate will open
for .2 sec till t33 is off and hold movement for 3 sec

Fig(57) Network 8 of PLC program


Network 9
Through the following network Q0.2 (close exit gate ) will operate a timer (t 97) for 0.2
sec
After that M0.2 with t 37 as 0 and t 97 as 0 and m0.1 as 0 will operate closing (Q0.2) till t
97 is 1 (after 0.2 sec )

Fig(58) Network 9 of PLC program


Network 10
Through the following network I connect the sensor by a location at HMI

Fig(59) Network 10 of PLC program


3.6 HMI in our project

3.6.1 How we select the screen

Fig(60) select HMI


Fig (61) communication setting

1. We press to add a new device.


2. Click at HMI.
3. Choose “SIMENS” from manufacturers.
4.Type selection PLC
Choose “s7 200” From series
5. select finish
Screen “1”

Fig (62) screen1

Fig(63) screen1

select “momentary” from button


Screen “2”

Fig (64) screen2

Write address
Fig(65) write address screen2

Reade address

Fig (66) read address in screen2

Screen “3”
Fig (67) parking in screan3

Conclusion
Reference
1- Tubbs, Stephen P. Programmable Logic Controller (PLC) Tutorial, Siemens Simatic
S7-200: Circuits and Programs for Siemens Simatic S7-200 Programmable
Controllers: For Electrical Engineers and Technicians. First ed., Stephen P. Tubbs,
2007.

2- Wright, A. J. Ladder Logic Programming Fundamentals: Learn Ladder Logic Concepts


Step by Step to Program Plc's on the RSLogix 5000 Platform. Second ed., AB
Prominent Publisher, 2019

3- ANTONSEN, TOM MEJER. PLC Controls with Ladder Diagram (LD): IEC 61131-3 and
Introduction to Ladder Programming. First ed., BOOKS ON DEMAND, 2021.

4- “Products - Touch Panel HMI - Human Machine Interfaces.” Delta,


https://www.deltaww.com/en-us/products/Touch-Panel-HMI-Human-Machine-
Interfaces/ALL/.

5- “Simatic S7-200 Smart: Simatic Controllers: Siemens India.” Siemens India Website,
https://new.siemens.com/in/en/products/automation/systems/industrial/plc/
simatic-s7-200-smart.html.

Our Greetings
Project Team

You might also like