You are on page 1of 20

Document

title Project Document Oscar part 4 final 28 may.pdf


Submit date Thu 06 Jun 2019 12:26:59 PM CEST

1%
1% Microcontroller-Based Experimental Setup and Experiments for SCADA Education
1% https://docplayer.net/55596038-Strategies-and-processes-for-implementing-financial-analysis-for-business-succes…

UNIVERSITY OF ZIMBABWE

FACULTY OF ENGINEERING DEPARTMENT OF ELECTRICAL ENGINEERING

…in partial fulfilment of BSC. Hons in Electrical Engineering LEVEL IV

CANDIDATE

: OSCAR MUTIZWA

REG NUMBER

: R159016X

SUPERVISOR

: ENG. G KAPUNGU

PROJECT TITLE: MICROCONTROLLER BASED AUTOMATIC BOTTLE FILLING SYSTEM WITH A CONVEYOR MODEL
AND SCADA MONITORING

Email: oscarmutizwa@gmail.com
1|Page

Abstract

The aim of this project is to design a low cost microcontroller based bottle filling system used is SMEs. The system consumes
over 40watts but it uses a 12V DC supply which is rated 35Watts since all devices are not on at the same time. The design
consists of a conveyor model, a power supply, sensors, SCADA display interface and a control box. The designed system
emphasizes on cost reduction and use of readily available materials. The system is supplied power from the mains, but also has
a back up battery in the event of power cuts. The system uses a Nano V3.0 microcontroller which is connected to a computer by
use of a USB V3.0 cable to realise continuous communication. The designed system combines concepts of control engineering,
electrical machines and software development.

2|Page

Declaration

I present this project report in partial fulfilment of the requirements of the Bsc Honours degree in Electrical Engineering at the
University of Zimbabwe. I Declare that the contents of this research project is entirely my work, where other sources have been
consulted, sources have been acknowledged and cited. Copying or publication of this document without my consent is not
allowed.

Department of Electrical Engineering University of Zimbabwe P.O Box MP 167 Mt Pleasant Harare Zimbabwe

Mutizwa Oscar (R159016X) Signature: ……………………………. Date: …………………………….........

3|Page

Acknowledgements

First and foremost I would like to thank the almighty God for giving me strength to tackle this project. I would like to thank my
Supervisor Eng G. Kapungu for his guidance throughout the course of this project. I would also like to thank the Mechanical
Engineering workshop team for their overwhelming support in realising the hardware implementation of the design. Special
thanks to the Electrical Engineering laboratory technicians for their immense contributions who sometimes extended their
working hours on request. Special thanks as well to my parents for their unwavering financial support during the entire course of
this project.

4|Page

3
1 1 2 3

Table of Contents
Abstract ........................................................................................................................................... 2 Declaration
...................................................................................................................................... 3
Acknowledgements......................................................................................................................... 4 Table of Contents
............................................................................................................................ 5

4 .............................................................................................................................................................. 6 5 Table of
Figures ............................................................................................................................... 7

1 .............................................................................................................................................................. 7 1 Chapter
1: Introduction .................................................................................................................. 8 1.1 1.2 1.3 1.4 1.5
Background ............................................................................................................................. 8 Problem Statement
................................................................................................................. 9 Aim
........................................................................................................................................ 10
Objectives.............................................................................................................................. 10
Methodology......................................................................................................................... 10 Proposed Block
diagrams .............................................................................................. 11 Proposed Flow Chart
..................................................................................................... 12

1.5.1 1.5.2 1.6 2

Justification ........................................................................................................................... 13

Chapter 2: Literature Review ........................................................................................................ 14 2.1 2.2 Introduction


.......................................................................................................................... 14 Control Systems
.................................................................................................................... 14 Open Loop Control Systems
.......................................................................................... 14 Closed Loop Control Systems
........................................................................................ 14

2.2.1 2.2.2 2.3

Programmable Logic Controls ............................................................................................... 15 PLC general


Architecture............................................................................................... 16

2.3.1 2.4

MICROCONTROLLERS vs PLCs ............................................................................................... 17 Microcontroller’s


Architecture ..................................................................................... 17 Von Neumann
architecture....................................................................................... 17 Harvard Architecture
................................................................................................ 18

2.4.1 2.4.1.1 2.4.1.2 2.5 2.6

The ARDUINO Nano Microcontroller .................................................................................... 18 SCADA with


microcontrollers ................................................................................................ 19 Problems associated with SCADA
systems ................................................................... 20

2.6.1 3

Chapter 3: Design and Prototype Realisation ............................................................................... 21 3.1 3.2 3.3 Overview
............................................................................................................................... 21 Functional Requirements
...................................................................................................... 21 Hardware Design
................................................................................................................... 22 Conveyor
System........................................................................................................... 22

3.3.1 5|Page

3.3.1.1 3.3.1.2 3.3.1.3 3.3.1.4 3.4

12V DC Wiper motor ................................................................................................. 23 Water Pump


.............................................................................................................. 24 Solenoid Valve
........................................................................................................... 25 Ultrasonic Sensor
...................................................................................................... 26

Software Design .................................................................................................................... 27 Programming


WonderWare InTouch ........................................................................... 28 SCADA interface display
................................................................................................ 29 Microsoft Excel as a communication
channel........................................................... 31 Nano V3.0 microcontroller
programming................................................................. 31

3.4.1 3.4.2 3.4.2.1 3.4.2.2 3.5 3.6 4

Control Box Block diagram .................................................................................................... 32 Overall Prototype


.................................................................................................................. 33

Chapter 4: Tests and Results ......................................................................................................... 34 4.1 4.2 4.3 Filling


success rate test ......................................................................................................... 34 Bottle final stopping position
test......................................................................................... 35 Bottle filled volume trend
..................................................................................................... 36

Chapter 5: Recommendations and Conclusion ............................................................................. 38 5.1 5.2 Conclusion


............................................................................................................................. 38 Recommendations/Future Work
.......................................................................................... 38

6 7

References .................................................................................................................................... 40 Appendix A:


Scripts for InTouch graphics (SCADA) display ........................................................... 41 On Show
............................................................................................................................................ 41 While Showing
.................................................................................................................................. 41

8 9 10

Appendix B: Nano V3.0 microcontroller code .............................................................................. 45 Appendix C: Gallery


....................................................................................................................... 50 Appendix D: Budget of
project.................................................................................................. 51

6|Page

Table of Figures

Figure 1-1: standard Siemens Programmable Logic Control .................................................................. 8 Figure 1-2:SCADA
monitoring system for a PLC controlled bottle filling system ................................... 9 Figure 2-8:Open loop control system
................................................................................................... 14 Figure 2-9:Closed loop control system
................................................................................................. 15 Figure 2-
1:PLCs...................................................................................................................................... 16 Figure 2-12: PLC
architecture................................................................................................................ 16 Figure 2-10: Von neumann
architecture ............................................................................................... 18 Figure 2-11: Havard architecture
.......................................................................................................... 18 Figure 3-1: Solid Works Conveyer design
............................................................................................. 22 Figure 3-2:Conveyor
model................................................................................................................... 23 Figure 3-3: DC motor attached to V
belt............................................................................................... 24 Figure 3-4: JT 800 water pump
............................................................................................................. 24 Figure 3-5: Solenoid valve 0-0.01Mpa
.................................................................................................. 25 Figure 3-6:Ultrasonic sensor
................................................................................................................. 26 Figure 2-7: Creating an access name in
InTouch................................................................................... 29 Figure 3-7: SCADA interactive display
................................................................................................... 29 Figure 3-8: Tagname dictionary
............................................................................................................ 30 Figure 3-9:Excel active
page.................................................................................................................. 31 Figure 3-10: Overall design
................................................................................................................... 33 Figure 4-1: Bottle8 after missing the
nozzle ......................................................................................... 35 Figure 4-2: filled bottles on a conveyer belt
......................................................................................... 37

7|Page

1
1.1

Chapter 1: Introduction
Background The evolution of the field of control engineering has resulted in reduction in human intervention (automation) in
various important industrial processes, not sparing the bottle filling industry. Automation has become backbone of the industrial
revolution as it significantly improves essential factors such as productivity and profitability in large industries. However, this has
not necessarily been the case in small industries (SMEs), with exceptions. The latter is however vital in the economy of a country
like Zimbabwe since around 80% or more of todays thriving industry in the country are SMEs. These small enterprises suffer
from lack of financial support; hence they are constantly in search of low cost production methods. Automation in bottle filling
usually employ devices called Programmable Logic Controllers (PLCs) (DheerajPongallu, 2014). The advent of PLCs dates back
to early 1970s and has gained popularity in industry (Siemens, 2000). Normally these PLCs come in handy where control of a
heavy machine with pin point accuracy is required. However, the same operation can be achieved (at a smaller scale) by use of
today’s widely available microcontrollers such as raspberry pi, ATMEGA, PIC etc.

Figure 1-1: standard Siemens Programmable Logic Control

Automation means control of a process with minimal or no human intervention, this means that any automated process has to at
least have a display interface for operators to
8|Page

control or at minimal monitor various processes in the plant without actually getting into the plant. This is where the concept of
SCADA technology rail in. Supervisory Control and Data Acquisition (SCADA) systems are systems that provide real time data
acquisition; this data can then be transferred onto a graphical user interface on PCs, phones or even the internet for easy
accessibility with operators. To realise an efficient SCADA system there need to be an effective communication channel
between the plant and the control interface. In context of this paper a SCADA system is required to monitor the bottle filling
system.

Figure 1-2:SCADA monitoring system for a PLC controlled bottle filling system

1.2

Problem Statement There already exist automatic bottle filling systems in today’s large industries; however the same cannot be
said for most small growing enterprises. Most of these processes employ Programmable Logic Controls (described earlier) for
automation. However, these devices are;  quite expensive (an CROUZET XD26, 16 digital input, 10 relay output PLC
currently costs around USD$218 whilst an ATMEGA168 which performs almost similar functionality costs around US$3 on ebay)
 to maximise PLC flexibility, a number of option modulus must be added

9|Page

Also PLC was designed for relay ladder logic hence it has complications with interfacing with some smart devices.

So there is need to design and implement a cheaper and reliable system for the bottling process.

1.3

Aim To design and develop an automatic bottle filling system and conveyer system that uses a microcontroller and process
monitoring using SCADA.

1.4

Objectives        To design, simulate and then fabricate a variable conveyer model. Android programming of the
override control interface. Realisation of a SCADA system on PC, phone, or even on the web. Proper interfacing of controller
with developed SCADA system. Building a bottle removing rotating shaft. To decrease cost of popular SCADA software. To
express the concept of monitoring a filling process.

1.5

Methodology The following methods are aimed at coming up with the best implementable solution for the aim and objectives of
the design.    Will do an intensive literature review on already existing filling plants. Consultation of experts in bottle filling
industry such as Pepsi. Design of a conveyer system and simulation using SolidWorks simulation software and then realisation of
the design at the UZ mechanical engineering workshop.  Simulation of circuit using Proteus simulation software and building of
the control circuit and interface circuits to motors, pump and sensors.

10 | P a g e


Design of a SCADA graphical user interface on PC and/or android using Visual Basic.net software then interfacing of control
circuit to the SCADA system using RS-232 communication channel or wireless communication.

1.5.1

Proposed Block diagrams


Android phone

Conveyer Belt

Rotating Bottle removing shaft

Bluetooth module

DC motors

LCD Display (attached on conveyer frame)

Microcontroller

IR sensors and liquid level sensors

Buzzer

RS 232 Bus or wireless module (for SCADA monitoring)

Submersible pump

Empty container Status signals

tank

11 | P a g e

1.5.2

Proposed Flow Chart

Yes
Idle state
Start (Insert bottle)

Is bottle removed?

Remove bottle

No

Is bottle inserted?

Finish process

Yes
Start conveyer

Start conveyer
Yes

Motion of bottle
Stop conveyer
Is bottle filled up to set point level?

No

Is bottle authentic?

No
Start pump (filling the bottle)

Yes
Is bottle detected?

Start conveyer

Yes

Stop conveyer

12 | P a g e

1.6

Justification The desire to develop a system that monitors and automatically controls the process of bottle filling, without putting
human life at risk during operation. The proposed system will require minimal human intervention since most of the processes
such as removal of container after authentication is done by machine, which will be remotely linked to a mobile device. This
bottle filling system unlike other bottle filling techniques is relatively cheaper to implement. The SCADA system used in
monitoring will be designed using software VB.net which is freely available on the internet.

13 | P a g e

2
2.1

Chapter 2: : Literature Review


Introduction

This chapter looks in depth into already existing bottle filling plants and their basic principles of operation. Automatic bottle filling
is an area of study which combines control, mechanical and electrical engineering. The filled of control engineering has evolved
evolved over time and this has led to the advent of Programmable Logic Controllers (PLCs) and microcontrollers. These
controllers have become the backbone of the manufacturing industry especially bottle filling plants. Most of the already existing
bottle filling filling plants use PLCs and this paper is going to dwell on their replacements with microcontrollers.

2.2 2.2.1

Control Systems Open Loop Control Systems

It starts with an input transducer which converts the input variation into an electrical signal which can be further processed by the
controller (Nice, 2000). . The controller drives the plant/process. The input is the reference and the output is the control variable.
When disturbances are introduced to the open loop control system they they add to the overall error of the output.

Figure 2-1:Open loop control system

The distinguishing and undesirable characteristic of an open loop control system is that it cannot compensate/remove an
unwanted disturbance introduced in the system. The output will be the algebraic sum of the inputs and the introduced
disturbances. So generally open loop control systems are simply commanded by the inputs and they do not compensate for any
disturbances.

2.2.2

Closed Loop op Control Systems

14 | P a g e

These systems overcome the disadvantages of open loop control systems i.e they can compensate for disturbances. They
have an output transducer which is capable of measuring output response and converting into a form suitable for processing by
the controller

Figure 2-2:Closed loop control system

The first junction sums up the input/reference to the feedback from the output transducer. The output is subtracted from the
input since they will be anti-phase. The result is the actuating signal. However, in systems where both the input and output
transducer gain is unity, the actuating signal is equal to the difference the input and output; the actuating signal will be called the
error. Closed loop systems compensate for disturbances by measuring output response and feeding back a portion of it to a
summing junction for comparison with the input. If there are any differences between the two the system drives the plant by use
of the actuating signal to make corrections. If there are no differences, the systems will not drive the plant since it will be
operating at the desired response. Closed loop systems have an obvious advantage of greater accuracy, less noise in
comparison with open loop systems. Steady state and transient response errors can be gotten rid of easily (Morris, 2005).

2.3

Programmable Logic Controls

A PLC is a digital processor used for computerization of industrial processes such as products on an assembly line (Siemens,
2000). These devices operate by use of the concept of ladder logic and allow many inputs and many outputs. These
programmable devices have gained the industrial floor over the past years and this is attributed to some of the listed
advantages below:   Flexible since they can be readjusted to meet system requirements easily. More sophisticated control
can be achieved.

15 | P a g e

 

They have troubleshooting aids making programming more simple. They have reduced downtime and can operate for years
without failure.

The figure below shows a typical PLC

Figure 2-3:PLCs

The three types of programming methods/languages used for PLCs namely:- Ladder logic, which is the most common, Boolean
and Grafcet

2.3.1

PLC general Architecture

They are made up of a power supply, I/O modules and processor module. The processor module has the CPU and memory.
CPU contains a programming interface (Ethernet, RS232, and USB) and also communication networks. The power supply can
be a separate module and I/O modules are linked to the processor. I/O modules allow both analog and discrete signals.
Figure 2-4: PLC architecture

16 | P a g e

I/O modules can either be inside the PLC or in a separate enclosure depending on their numbers. There is however a certain
class of PLCs referred to as micro/nano PLCs and these come with all the parts and modules on the same circuit board/same
enclosure.

2.4

MICROCONTROLLERS vs PLCs

Microcontrollers are small computing devices integrated on a chip containing a processing core, memory registers and I/O ports.
They are bare and therefore are usually interfaced to various modules for useful applications. PLCs and microcontrollers are
designed for targeting different kinds of end-users. Microcontrollers are usually used by developers who design industrial
equipment such as panel meters, transducers, actuators, sensor modules (Asutkar, 2013). PLCs are usually designed for
system integrators who assemble products developed by various companies to make an entire assembly line. PLCs are
designed to withstand harsh industrial environments hence they are sometimes referred to as “industrial microcontrollers”
(Omron, 2001). The major difference between the two is the way of programming; PLCs are programmed by use of Ethernet
and USB cables and consists of modules and a processor with large memory all in one. A Microcontroller is an integrated
chip/circuit whilst a PLC is a finished product consisting of various chips. One could easily use a microcontroller to build a
Programmable Logic Controller.

2.4.1

Microcontroller’s Architecture

The 8051 microcontroller was one of the earlier versions of microcontrollers and operates with 8 bit data bus. They have both
external data memory and program memory of up to 64K. They have two different types of architectures namely:   The
Harvard Architecture Von Neumann architecture

2.4.1.1 Von Neumann architecture In this type only one data bus exists for data and instructions and results in CPU making one
operation at a time. A data operation and fetching of an instruction cannot occur at once. Von Neumann is compatible with
simple hardware.

17 | P a g e

Figure 2-5: Von neumann architecture

2.4.1.2 Harvard Architecture Offers separate buses for instructions and data. Data is entirely stored in the CPU and this
architecture allows access to both data and instructions simultaneously.

Figure 2-6: Havard architecture

2.5

The ARDUINO Nano Microcontroller

This is a microcontroller of the ATMEGA family equipped board equipped with a USB connection. The Arduino Nano carries an
ATMEGA 328 microcontroller chip. It is a 30 pin microcontroller with special libraries for robotics and automation and this is made
it very useful in this project. The Nano has more analog pins compared to other boards like Arduino Uno. It can be powered
through a V3 USB cable or a 6 to 20V unregulated power supply at pin 30. During receiving and transmitting of data, this
microcontroller lights 2 red LEDs. It

18 | P a g e

has a 1KB EEPROM for temporary storage and a flash memory of 32KB. This microcontroller was a suitable choice for this
project due to its many digital I/O pins (14).

2-7: Arduino Nano V3 with ATMEGA 168P 2.6 SCADA with microcontrollers

SCADA is abbreviation for Supervisory Control and Data Acquisition, the four experimental terms describes the architecture of
SCADA, their interfacing to control hardware and functionality which they provide (Gomez, 2000). It can regulate the overall
operation of a system in a plant. It processes the inputs from sensors in the plant and controls the process by use of its outputs.
The output and input data constitutes what is termed Logic. Many logic combinations will make up a program. The program is
stored in processor memory and is regularly changed as per the needs of the command given by an operator. The operator
usually runs various programs in preset order for the SCADA system. Industrial standards are also taken into consideration
during realisation of such systems.

SCADA Systems have evolved over years in terms of scalability, performance, functionality and flexibility and they are the
backbone of most complex control systems in industry (Talamini, 1997). The abbreviation itself implies there is need for a display
interface/computer, which collects real time data, processes it and further analyzes it. SCADA is a software package that
reflects the performance of the hardware which it interfaced. Nowadays it can be realised by many software platforms like
Wonderware
19 | P a g e

Intouch, InduSoft etc. SCADA systems are used to monitor and regulate plants in industries such as energy, gas, oil, water,
communications etc. They gather information for instance where a fault has occurred and transfer the information to the control
room, alerting operators of fault condition. They can also go further to tell whether the fault is critical or minor (Talamini, 1997).
These systems can also be used not only in industrial setups but also experimental setups such as nuclear plants where there
will be several thousand input/output channels. SCADA systems can be as simple as a system that continuously monitors
temperature in an office building or even large as those being employed in nuclear plants.

2.6.1    

Problems associated with SCADA systems Quite expensive and bulky. They require frequent maintenance. Weak encryption
and more power requirements SCADA systems are more complex to make compared to the sensor to panel type systems.

 

Operator can only see what the controller sees. Since they use the general public air space and telephone lines for
communication, they are vulnerable to hacking.

20 | P a g e

3
3.1

Chapter 3: Design and Prototype Realisation


Overview

This chapter outlines the functional requirements of the design, the correlation between various components to achieve the
stated functional requirements. All necessary procedures required to meet the project objectives are also clearly outlined in this
chapter. The researcher designed and prototyped a bottle filling plant with a conveying and pumping mechanism. This project
was realised in four major stages

3.2

Functional Requirements

The designed system should be capable of:   Filling bottles with equal volumes of liquid. Pump liquid into main tank when
empty i.e. automatically start and stopping the pump when tank is full.     SCADA system on PC should display current
states of valve, pump and motor. System should automatically start and stop. Operator should have full control of the pump.
SCADA display should show status signals such as when the bottle should be removed from the conveyer.   The system
has to detect faulty conditions The system should fill as much number of bottles as possible.

21 | P a g e

3.3

Hardware Design

The Hardware part of the design saw the conveyor model, ultrasonic sensors, pump and valve being assembled together.

3.3.1

Conveyor System

This was realised through a steel frame of length 1.1m being suspended by 40cm long legs, also having a tank stand on top of
height 30cm. The conveyor belt was extracted from a tyre rubber and has a thickness of 2mm and total length of 2.3m to allow
for overlap. Rollers were made from hollow cylindrical bars which were stacked with wooden blocks for stud rods to make tight
fit. Each Roller was uniquely fitted at each end of the conveyer frame and the conveyor belt was stretched between the two
rollers. One of the rollers being the drive roller was coupled to a wiper 12V DC motor through a Vee-belt and pulleys. The figure
below shows the conveyor belt frame before the stretching of the belt and coupling of the motor. The steel frame was made
from hollow and angle iron bars and bearings for smooth roller movement.

Figure 3-1: Solid Works Conveyer design

The above designed frame was realised in the UZ mechanical engineering workshop. Several challenges were faced during the
crafting process such as belt slipping, bearings stopping to
22 | P a g e

function due to heat from welding, stud rods not tightly fitting in rollers. Hence a lot of improvising had to come in place and this
saw a lot of the stuff previously designed on paper being altered. The figure below shows the completed conveyer system.

Figure 3-2:Conveyor model

Calculation of the torque required to drive the filled bottles: T= ( +μ ) where T-torque, D-Roller diameter, W –mass of load (kg)

T= (0.04)(39.2 + μ(0.4)(9.81)) T= 0.823Nm (assuming µ=0.5) 3.3.1.1 12V DC Wiper motor A wiper motor is an electric motor
which is used in motor vehicles to power windscreen wipers. It normally contains plastic gears for speed regulation. A wiper
motor has three output wires, a blue wire which is the neutral, a red wire for a moderate speed of rotation and a brown wire for a
faster speed (at 12V) N.B. varying the input voltage to a DC motor also varies the speed. Since only two wires are needed, the
red and blue wires were used and gave a suitable belt speed of around 0.4m/s. reversing the terminals to supply will result in
change in direction of rotation of motor. At no load the motor draws around 1A current rising to around 10A at full load but
however in the designed system the motor draws in excess of 1.4A. It has a minimum torque of 29Nm. Due to its relative
availability and cheaper cost; it was best suited for this design. The figure below shows a closer view of the wiper motor used in
the design press fitted to a pulley of radius 5cm. Power drawn by motor = V*I
23 | P a g e

= 12V * 1.4A = 16.8 Watts (when carrying filled bottles)

Figure 3-3: DC motor attached to V belt

The motor was bolted to the conveyor frame by use of 6mm bolts and nuts and its relative position is adjustable to meet the
requirements of the tensioned V-belt.

3.3.1.2 Water Pump Since the Main liquid tank on top of the conveyor tank stand is relatively small, this meant that it quickly
empties so a larger Reservoir tank was put in place and to pour water from the reservoir tank into the main tank when it empties,
a JT800 6-24V, 14W JT800 submersible pump came in handy.
Figure 3-4: JT 800 water pump

24 | P a g e

The pump has a maximum head of 800cm if powered with 24V and 80cm if powered with 6V, a 12V DC supply was used in the
design hence it was capable of pumping liquid a height of 70cm through 25mm diameter PVC pipes.

3.3.1.3 Solenoid Valve This is an electromechanically controlled valve used to regulate liquid flow. They come in various voltage
rating but in the design, a 12V DC normally closed valve was employed. The basic operating principle of this device is that when
the internal coil is energized, the coil inside magnetises and opens the plunger. For the valve to return to closed state a spring
comes into play. Solenoid valves have specified pressure ratings written on them and this will show the minimum and maximum
pressure allowable for the valve to operate efficiently. In this design a valve with a pressure rating of 0-0.01Mpa was used since
the liquid in the main tank will have to fall under gravity.

Figure 3-5: Solenoid valve 0-0.01Mpa

The figure above shows the employed solenoid valve (the picture was taken when the valve was in operation). Since the valve is
being gravity feed, the liquid dispensing is only controlled by the timing of the controller and very little pressure is required (Rajesh
G. Khatod, 2012). Since the solenoid valve operates through a coil which is energized, the coil will heat with time and proper
ventilation is required since continuous heating may cause a coil burnout. To go around the issue of heat dissipation in the
realised design, the solenoid valve was brought in contact with the entire design frame and this acted as a heat sink. During
assembly, since the valve has 15mm openings which are too small for the piping
25 | P a g e

system, 15/25mm threaded union sockets had to be attached at both ends of the valve for a tight fit. 3.3.1.4 Ultrasonic Sensor

Figure 3-6:Ultrasonic sensor

These are transducers which measure distance of an object or a surface by use of ultrasonic signals. An ultrasonic sensor emits
an ultrasonic signal through the trig pin and receives it back via the echo pin. It then measures the distance by using the time
between reception and emission. The distance is then given by: Distance, L= where T is time between emission and reception ,
C speed of an EM wave This project employed the ultrasonic sensors for: 1. Position sensing of the bottle throughout the
conveyer model. Here three ultrasonic sensors where used, one at the starting position, the other at the filling position and finally
one at the finishing position where the conveyor belt stops. 2. Liquid level sensing in the Main tank above the tank stand. Here
the principle of distance (earlier discussed) was utilised and the ultrasonic sensor continually updates the liquid level to the
SCADA system. All in all a total of four ultrasonic sensors where in cooperated in the design for various functions. They are a
perfect replacement for Infrared Sensors. An ultrasonic sensor draws a maximum of 20mA at 5V and its ultrasonic waves are of
frequency 40 kHz with a range of 2cm to 400cm.

26 | P a g e

3.4

Software Design

The Software part of this project was developed by use of three development environments namely: 1. Arduino IDE
environment. 2. Microsoft Excel. 3. WonderWare InTouch. Basically the Arduino IDE was used to program the Nano V3.0
microcontroller, Microsoft Excel was used for communication/transfer of data bits and InTouch is where the SCADA system was
realised i.e. the display and interactive interface was programmed using InTouch.

Flow Chart

no

Idle state

yes
Is bottle removed?

Remove bottle

Start(insert bottle)

Stop conveyer if sensor3 is 1

Start conveyer

no

Is bottle inserte d?

yes

yes
Start conveyer

no

Is bottle filled to set point?

no

Is bottle detected by sensor2?

Stop conveyer

Fill bottle if tank has liquid

yes

27 | P a g e

3.4.1

Programming WonderWare InTouch

Wonderware InTouch uses what are called tags for defining external variables or variables in local memory. I/O tags are tags
that accepts data from external devices such as PLCs or microcontrollers. Tags that receive internal data from the SCADA
system are called memory tags (Igor Nai Fovino A. C., 2012). Tags are stored in a tag directory with a specific name and called
in any part of the program. Below are the various types of tags found in InTouch:  Memory Integer: accepts a 32 bit integer
between -2 147 483 648 and +2 147 483 647  Memory Discrete: discrete tagname in internal memory with a value of either 0
(false) or 1 (true).  Memory Real: Decimal point tagname in memory with floating point value between -3.4e38 and 3.4e38.
Float calculations are performed in 64 bit resolutions and result stored in 32bit.  Memory Message: String of up to 131
characters.

Tagnames are assigned to specific alarm groups and if no alarm group is provided, InTouch assigns the root group, $System.
Read/Write option should be selected for I/O tags to have the read/write capability in runtime. All I/O tags should have an access
name for communication. For InTouch to communicate with an external application such as Microsoft Excel, the following
procedure is followed to create an access name:    Click access names on menu bar Go to add access name In Access
names textbox type the preferred name for the access name. Each access name directs to an I/O address which contains a
Topic, Node and application.  In application name text box, provide the actual name of the application (as recognized by
Windows) which data is acquired. Extensions are not required.   In topic name textbox type the application subgroup you
want to access Select advice all items for server to poll for all data regardless of whether it is in visible windows, alarmed,
logged or used in a script. Select advice only active items for better performance. Figure below shows how to properly create an
Excel access name for an Excel page called Book created in documents folder.

28 | P a g e

Figure 3-7: Creating an access name in InTouch

3.4.2

SCADA interface display

Figure 3-8: SCADA interactive display

The figure above shows the interactive display to the operator. This is the runtime environment which hich the operator can use
to see the status of devices. devices Currently it is showing that the motor is off, rollers are stationary, sensors are not
detecting anything, valve is off, pump is off and there is no bottle placed p on the conveyor r belt, otherwise these would change
29 | P a g e

colour after detecting a status change. To develop this interface or make any additions, the Development environment has to
be used.

The development environment is where all the animations like bottle movement, liquid filling and bottle filling are programmed
through the windows scripts tab. To access this tab right click mouse>select windows scripts>select while showing N.B On
show selection is for initializing variables in the system. Now for the interface to communicate with an external application ( in this
case Excel), an access name has to be first created. To create an access name click Special (on menu bar)>select access
names >select add> follow steps discussed in earlier chapter. Also for the tags to be able to send and receive data from Excel,
the “item:” text field of the Tagname dictionary should specify the row and column for example in figure below the ‘Motor’ tag is
set to Row 8 Column 2 (R8C2).

Figure 3-9: Tagname dictionary

30 | P a g e

3.4.2.1 Microsoft Excel as a communication channel For InTouch to communicate with an excel page, the page has to be active
and has to be saved in the documents directory of the PC. For this project a page named Book.xlsx was used. For the
extraction of data from the excel sheet to the Nano V3.0 microcontr microcontroller was done through an Excel extension called
PLX-DAQ PLX DAQ which has to be fed with the com port number of the controller and the baud rate.

Figure 3-10:Excel active page

3.4.2.2 Nano V3.0 microcontroller programming This is a microcontroller of the ATMEGA class hence it is programmed by use of
the Arduino IDE environment with use of the Old Bootloader option. The controller has 30 I/O

31 | P a g e

pins. Below is an example of a code extract which transfers a discrete bit for Motor from Excel which is in cell B8: delay(3);
Serial.println("CELL,GET,B8"); Output[0] = Serial.parseInt();//MotorValue if(Output[0]==0){digitalWrite(Motor, HIGH);}
if(Output[0]==1) {digitalWrite(Motor, LOW);} The last two lines of code are for writing the output pins as either high or low
depending on information from InTouch through Excel.

3.5

Control Box Block diagram


From mains supply 230V AC

Power Supply 230V AC/ 12V DC , 35 W


5V Regulator LM7805

12V Distribution board for 12V circuits

2 jumpers (Vcc and gnd)


5V supply to relay channels

5 channels
To motor, valve, pump

5V Distribution Board for Sensors and relays

Relay Panel i.e electromechanical switches

8 channels

Gnd
Nano V3.0 microcontroller

3 output channels, motor, valve and pump status

8 channels To sensors
USB V3 cable to PC 32 | P a g e

3.6

Overall Prototype

Figure 3-11: Overall design

33 | P a g e

Chapter 4: Tests and Results

The realised prototype for automatic bottle filling system was thoroughly tested for proper functionality. Power supply to the
system was initially provided by a 12V, 7AH lead acid battery which had a high rate of discharge thereby compromising the
performance of the system, since with varying battery voltage belt speed varies and this implied continuous adjustments to the
system. Time/min Battery Voltage/V Belt speed/(m/s) 2 13.02 0.1 12 12.88 0.083 22 12.55 0.0625 32 11.98 0.05 42 11.5 0.04
52 10.97 0.036

Voltage vs speed
13.5 13 12.5 12 11.5 11 10.5 0.12 0.1 0.08 0.06 Belt speed/(m/s) 0.04 0.02 0 Battery Voltage/V

The graph above shows a clear decrease in performance, thus the battery was later replaced with a K.L.I led power supply
which converts 230V AC from the mains to provide a constant 12V DC supply. Several tests were performed with the 12V DC
power supply including filling success rate, bottle relative stopping position, and filled liquid level/volume.

4.1

Filling success rate test

The realised bottle filling system was not 100% accurate in positioning of the bottle cans on the filling position. For determining
the success rate of the machine a sample space of 10 bottles was taken and below are the results which were obtained.

34 | P a g e
Bottle1 Bottle2 Bottle3 Bottle4 Bottle5 Bottle6 Bottle7 Bottle8 Bottle9 Bottle10 Bottle11

Successfully filled Successfully filled Successfully filled Successfully filled Successfully filled Successfully filled Successfully filled
Not Successfully filled Successfully filled Successfully filled Successfully filled

The above results were enough to deduce that the filling error rate of the designed machine was 1 in 10 bottles. Since out of 10
bottles allowed to pass through the machine only the 8th bottle couldn’t fill and this was because the machine failed to place the
bottle directly below the nozzle implying sensor2 couldn’t detect it. The figure below shows a picture taken of bottle8.

Figure 4-1: Bottle8 after missing the nozzle

4.2

Bottle final stopping position test

The system was designed such that the bottle stops twice after starting i.e. when the bottle is directly under the dispensing
nozzle and when the bottle has been filled and is close to the
35 | P a g e

end of the conveyer belt. At the end of the conveyor the stopping position is determined by the final ultrasonic sensor position
and a command from the SCADA system, now depending on the strength of the communication path, the bottle may stop at
different positions but either way the bottle must not fall. A test was done to determine the average final stopping distance of
the bottle relative to the first sensor and the following results were obtained: N.B. again a sample size of 10 bottles was used
Bottle # Stopping Distance/cm 1 89.8 2 88.5 3 90.1 4 91 5 89.4 6 89.7 7 87.6 8 88.4 9 87 10 90.4

92 91 Relative distance from Sensor1/(cm) 90 89 88 87 86 85 Bottle1 Bottle2 Bottle3 Bottle4 Bottle5 Bottle6 Bottle7 Bottle8
Bottle9 Bottle10 Bottle #
. . . . . . . .

Average stopping distance=

=89.14cm from Sensor1 Therefore it is safe to say the filling system conveys bottles for a distance of 89.1cm, this is the
distance which the SCADA system is watching the bottles.

4.3

Bottle filled volume trend

The automatic bottle filling system employs bottles which are 330ml metal cans. The system uses the volumetric method of
filling and this is achieved by setting the opening and closing times of the solenoid valve, adjusting this time results in an
adjustment in the filled volume. However since the solenoid valve is an electromechanical switch, some unwanted delays are
always present and thus altering the filled volume (Satry A.S, 2010). An experiment was
36 | P a g e

done with a 10 bottle sample size to see this variation in the filled volume for a preset time of 8 seconds and the following results
were obtained: Bottle # Filled volume/ml
256 254 Volume filled/(ml) 252 250 248 Obtained volumes 246 244 242 Expected 255ml

1 252

2 255

3 247

4 252
5 253

6 248

7 248

8 250

9 252

10 248

Bottle number

The figure below shows some of the filled bottle cans.

Figure 4-2: filled bottles on a conveyer belt

37 | P a g e

5
5.1

Chapter 5: Recommendations and Conclusion


Conclusion

The main aim of this project was to design and implement an automatic bottle filling system using a cheap microcontroller this
was done, also all the stated objectives were successfully achieved as planned. The designed system can find use where high
precision is not required and time limits are not of critical importance. The theory of the realised system is based mainly on the
concepts of control engineering as previously demonstrated. The basic control system and logic diagrams used in this project
can also be scaled up to create more complex industrial automation systems. To be able to realise a fully functional SCADA
system, the concepts of communication and interactive display interface have to be addressed and, in this project the
researcher had to download and learn the software package, InTouch which is a product of Wonderware Company.

The bottle filling industry is constantly evolving with the advent of new technology and more powerful controllers each day. In
Zimbabwe companies such as Delta beverages and Schweppes spend thousands of dollars into research of more efficient and
profit maximizing methods of filling beverages into respective containers.

5.2

Recommendations/Future Work

Though the researcher managed to realise a fully functional automatic bottle filling plant, some modifications to the system are
crucial to improve its efficiency. Firstly, the designer recommends the replacement of the first ultrasonic sensor with a metal
detecting sensor so that the system will only detect metal cans and not all other objects. There is also need for an
authentication system on the conveyer which detect whether or not a bottle can has a cap on top or is already filled. The
volumetric method of filling which was employed had several shortcomings including not filling exactly equal volumes due to
pressure differences in the main tank and to overcome this, the researcher recommends the use of liquid level sensing method,
which uses another sensor to check the liquid level in the bottle during the filling process. However this method can only be used
to fill transparent bottles.

The designer also recommends the replacement of the Nano microcontroller with a Programmable Logic Controller (PLC) or
even a more powerful microcontroller like a

38 | P a g e

Raspberry pie if the system is going to be used in an industrial setup since PLCs are more rigid, in using this approach the issue
of cost and availability should be taken into serious consideration. The designed system can only be used in filling low viscosity
liquids so there is also need to improve the machine so that it also caters for high viscosity liquids such as cooking oil.

39 | P a g e

References

AnupDakre, J. G. (2015). Implementation of bottle filling and ccapping using PLC and SCADA. International Reasearch Journal
of Engineering and Technology . Asutkar, S. M. (2013). Automated bottle filling using microcontroller volume correction.
International journal of Engineering research and Technology . DheerajPongallu. (2014). Automatic multivariate liquid filling
system & conveyor. International Journal of Emerging Technology and Advanced. Gomez, J. A. (2000). Survey of SCADA
Systems and Visualization of a real. Igor Nai Fovino, A. C. (2012). Critical State-Based Filtering System for Securing SCADA
Network Protocols. IEEE transactions on industrial electronics , 3943-3950. Igor Nai Fovino, A. C. (2012). Critical State-Based
Filtering System for Securing SCADA Network Protocols. IEEE transactions on industrial electronics , 3943-3950. Khera, N.
(2008). DESIGN OF MICROCONTROLLER BASED WIRELESS SCADA SYSTEM FOR REAL TIME DATA. International
Journal of Advances in Electonics Engineering , 18-21. Kumar, R. (2010). Recent Advances in SCADA alarm System.
International Journal of International Journal of Smart Home Smart Home Smart Home . Morris, N. M. (2005). Control
Engineering. UK: Mc GRAW-HILL Book Company. Nice, N. S. (2000). Control System Engineering. Pomona: John Wiley &
Son,. Omron. (2001). A Beginner’s Guide to PLC. Manual book. Qiu. (2000). Web-based SCADA display systems (WSDS) for
access via internet. IEEE Trans. Power , 681-686. Rajesh G. Khatod, C. S. (2012). Design and Fabrication of liquid dispensing
machine using automatic control for engineering industry. International journal of innovative technology and exploring engineering
. S. L. Toral, F. B.-T. (2007). Analysis of utility and use of a web-based tool for digital. Comput. Educ., vol. 49 , 957–975. Satry
A.S, K. S. (2010). An automated microcontroller based liquid mixing system. International journal on computer science and
engineering . Siemens. (2000). Basic Of PLCs. Siemens Technical Education Program. Simpson, C. D. (2001). Programmable
Logic Controllers Regents. Prentice hall. Talamini, G. (1997). Operator Interface Design for IndustrialContro. St Lucia:
University of Queensland. Zafer Aydogmus, M. I. (2006). A Web-Based Remote Access. IEEE Transactions On Education ,
498– 506.

40 | P a g e

Appendix A: Scripts for InTouch graphics (SCADA) display


On Show

Pump=0; Valve2=0; Tank_F=0; Tank_C=0; Bottle_Move=0; Bot_Vis=1; Tank_Status=1; Bot_Status=1; Number=0;


Motor=0; P1=0; P2=0; count4=0; count=0; count2=0; count3=0;

While Showing
IF PumpStart==1 THEN Pump=1; Valve2=0; Motor=0; Tank_Status=1; ELSE Pump=0; ENDIF;

IF Tank_F>=101 THEN Tank_F=101; ENDIF; 41 | P a g e

IF Tank_F<=10 AND PumpStart==1 THEN PumpStart=0; ENDIF;

IF Sensor1==1 AND Bottle_Move<=5 AND Bottle_Fill==0 THEN Bot_Vis=0; Motor=1; P1=1; count=count+1; ENDIF;

IF Sensor1==1 AND Bottle_Move<=5 AND Bottle_Fill==0 AND count==1 THEN Bottle_Move=Bottle_Move+1; Motor=1;
P1=1; ENDIF;

IF Bottle_Move>=0 AND Bottle_Move<35 AND Bottle_Fill==0 AND Motor==1 THEN Bot_Vis=0; Motor=1; P1=1;
Bottle_Move=Bottle_Move+1; ENDIF;

IF Bottle_Move>=35 AND Bottle_Move<=37 AND Sensor3==1 AND Tank_F<90 PumpStart==0 THEN Motor=0; P1=0;
Bottle_Move=36; Valve2=1; Bottle_Fill=Bottle_Fill +1; ELSE Valve2=0; ENDIF; 42 | P a g e
AND

IF Tank_F>=90 AND Sensor3==1 AND Bottle_Move>=35 AND Bottle_Move<=37 THEN Bottle_Move=36; Tank_Status=0;
Valve2=0; PumpStart=1; ENDIF;

IF Bottle_Fill>=75 AND Bottle_Move>=36 THEN Bottle_Fill=75; ENDIF;

IF Bottle_Fill>=75 AND Bottle_Move>=36 THEN Valve2=0; count3=count3+1; ENDIF;

IF Bottle_Fill>=75 AND Bottle_Move>=36 THEN Valve2=0; Motor=1; P1=1; Bottle_Move=Bottle_Move+1; ENDIF; IF


Bottle_Move>=36 AND Bottle_Move<65 AND Bottle_Fill>=75 AND count3==1 THEN Valve2=0; Motor=1; P1=1;
Bottle_Move=Bottle_Move+1; ENDIF;

IF Bottle_Move>=65 AND Bottle_Move<67 THEN Valve2=0; Number=Number+1;

43 | P a g e

Bot_Vis=0; Bottle_Move=Bottle_Move+1; ENDIF;

IF Bottle_Move>=70 AND Sensor4==1 THEN Valve2=0; Motor=0; P1=0; Bot_Vis=0; Bottle_Move=70; Bot_Status=0;
ENDIF;

IF Bottle_Move>=73 THEN Bottle_Move=73; Valve2=0; ENDIF;

IF Sensor4==0 AND Bottle_Move>=70 AND Bottle_Fill>=75 THEN Bot_Vis=1; Motor=0; P1=0; Bottle_Move=0;
Bottle_Fill=0; Bot_Status=1; count=0; count2=0; count3=0; ENDIF;

44 | P a g e

Appendix B: Nano V3.0 microcontroller code

//const int Sensor1 = 2; const int Sensor2 = 2; //const int Sensor3 = 4; //const int Sensor4 = 5; //const int buzzer = 6; const int
trig2 = 7; const int echo2 = 8; const int trig3 = 9; const int echo3 = 10; const int trig4 = 11; const int echo4 = 12; const int
Motor =15; const int Valve2 = 6; const int Start = 17; const int TRIGpin =18; const int ECHOpin =19;

long duration; int distance; long duration2; int distance2; long duration3; int distance3; long duration4; int distance4;

uint8_t Sensor[4]; uint8_t Output[4]; void setup() { 45 | P a g e

Serial.begin(19200); // pinMode(Sensor1, INPUT); pinMode(Sensor2, INPUT); // pinMode(Sensor3, INPUT);


//pinMode(Sensor4, INPUT); pinMode(trig2, OUTPUT); pinMode(echo2, INPUT); pinMode(trig3, OUTPUT); pinMode(echo3,
INPUT); pinMode(trig4, OUTPUT); pinMode(echo4, INPUT); pinMode(Motor, OUTPUT); pinMode(Valve2, OUTPUT);
pinMode(Start, OUTPUT); pinMode(TRIGpin, OUTPUT); pinMode(ECHOpin, INPUT); } void loop() {

delay(3); Serial.println("CELL,GET,B8"); Output[0] = Serial.parseInt();//MotorValue if(Output[0]==0){digitalWrite(Motor,


HIGH);} if(Output[0]==1) {digitalWrite(Motor, LOW);} delayMicroseconds(2); Serial.println("CELL,GET,B21"); Output[1] =
Serial.parseInt();//Valve2Value if(Output[1]==0) {digitalWrite(Valve2, HIGH);} if(Output[1]==1) {digitalWrite(Valve2, LOW);}
delayMicroseconds(2); Serial.println("CELL,GET,B19"); 46 | P a g e

Output[2] = Serial.parseInt();//StartValue if(Output[2]==0) {digitalWrite(Start, HIGH);} if(Output[2]==1) {digitalWrite(Start,


LOW);}

delay(3); /* Sensor[1] = digitalRead(Sensor1); Serial.print("Sensor1 ="); Serial.println(Sensor[1]); if (Sensor[1] == 0) {


Serial.println( "CELL,SET,B12,1" ); } else { Serial.println( "CELL,SET,B12,0" ); } */
/* Sensor[4] = digitalRead(Sensor4); if (Sensor[4] == 0) { Serial.println( "CELL,SET,B15,1" ); } else { Serial.println(
"CELL,SET,B15,0" ); }*/

digitalWrite(trig2,LOW); delayMicroseconds(2); digitalWrite(trig2,HIGH); delayMicroseconds(10);


duration2=pulseIn(echo2,HIGH); distance2=duration2*0.034/2; if (distance2<=7) { Serial.println( "CELL,SET,B12,1" );//sensor1
} else { Serial.println( "CELL,SET,B12,0" ); 47 | P a g e

digitalWrite(trig3,LOW); delayMicroseconds(2); digitalWrite(trig3,HIGH); delayMicroseconds(10);


duration3=pulseIn(echo3,HIGH); distance3=duration3*0.034/2; if (distance3<=8) { Serial.println( "CELL,SET,B14,1" );//sensor3
} else { Serial.println( "CELL,SET,B14,0" ); }

digitalWrite(trig4,LOW); delayMicroseconds(2); digitalWrite(trig4,HIGH); delayMicroseconds(10);


duration4=pulseIn(echo4,HIGH); distance4=duration4*0.034/2; if (distance4<=7) { Serial.println( "CELL,SET,B15,1"
);//sensor4 } else { Serial.println( "CELL,SET,B15,0" ); } digitalWrite(TRIGpin,LOW); delayMicroseconds(2);
digitalWrite(TRIGpin,HIGH); delayMicroseconds(10); duration=pulseIn(ECHOpin,HIGH); distance=duration*0.034/2; 48 | P a g
e

Sensor[0]=distance*4.8;

Serial.print("CELL,SET,B17," ); Serial.print(Sensor[0]); Serial.println(","); int SensorState = digitalRead(1); if (SensorState ==


HIGH) { Serial.println( "CELL,SET,B40,1" ); }

49 | P a g e

Appendix C: Gallery

50 | P a g e

10 Appendix D: Budget of project


Item number 1 2 3 4 5 6 7 8 9 10 11 12 Item description DC wiper motor Bread board Submersible pump JT800 Water
dispenser tanks(buckets) Ultrasonic sensors PVC pipes Microcontroller USB V3 Valve 5V regulator Conveyor Belt Steel for
conveyor frame TOTAL Quantity 1 1 1 2 4 3m 1 1 1 1 1 6m Cost ($) 10 5 10 4 8 4 9 3 8 2 6 7 USD $76

51 | P a g e

You might also like