Automatic Bottle Filling System Using Arduino
Automatic Bottle Filling System Using Arduino
I hereby certify that the work which is being presented in the Project entitled “AUTOMATIC BOTTLE
FILLING SYSTEM FOR SOFT DRINK INDUSTRY” by “CHANDAN KUMAR, RAHUL KUMAR
& SUBHASH KUMAR” in partial fulfillment of requirements for the award of degree of B.Tech.
authentic record of my own work carried out during a period from July to December 2019. The matter
presented in this project has not been submitted by me or anybody else in any other University / Institute
This is to certify that the above statement made by the candidate is correct to the best of my own
knowledge.
i
ABSTRACT
The field of automation has a notable impact in a wide range of industries beyond manufacturing.
Automation plays an increasingly important role in the world economy. Filling is a task carried out by a
machine that packages liquid products such as cold drinks or water. In past, humans were the main
method for controlling a system. More recently, electricity has been used for control and electrical
control is based on microcontrollers for various purposes like medicines, pharmaceutical plants,
chemical plants etc. There microcontrollers control the complete working of the system. It is common to
use microcontrollers to make simple logical control decision. The automation in bottle filling industry
comes with increased electrical components. Essential requirements of each component in the system is
important to be studied in ordered to understand how each part works in coordination with other parts in
the system. This study mainly includes design, fabrication and control system for automated bottle
filling system. The main part is control system which includes C programming in Arduino
microcontroller to control various components in system. A conveyor system with sensors and
electromagnetic valve is fabricated for this purpose. The entire sequence of operation is controlled by
arduino microcontroller. In small industries bottle filling operation is done manually. The manual filling
process has many shortcomings like spilling of water while filling it in bottle, equal quantity of water
may not be filled, delay due to natural activities of human etc. This problem faced by small industries
compels to design this system. This proposed system is meant for small industries. It aims to eliminate
problem faced by small scale bottle filling system. With this system which operates automatically, every
process can be smooth and the process of refilling can reduce worker cost and operation cost.
ii
ACKNOWLEDGEMENT
It give us immense pleasure to find an opportunity to express our deep gratitude to Dr.Sehijpal Singh
(Principal), Prof. Ameeta Seehra (HOD) of ECE and our Project guide Prof. Kuldeepak Singh(Assistant
Professor) of Electronics and communication engineering, Guru Nanak Dev Engineering College,
Ludhiana for enthusiastic encouragement and useful critiques of this project work we hereby
We would also like to thank to the technician of the laboratory of ECE dept. for help in offering us the
resources in running the Project. We are greatly indebted to all those writers and organizations whose
books, articles and reports we have used as reference in preparing this report.
We thank all our branch teachers and faculties of "Electronics and communication"' for their suggestion
iii
LIST OF FIGURES
iv
CONTENTS
v
CHAPTER-1 INTRODUCTION & PROJECT FORMULATION
1.1Introduction: -
Industrial Automation plays an increasingly important part in the global economy and also in
daily experience. At present, for companies, the purpose of automation has shifted from growing
productivity and reducing costs to broader issues. This work takes the idea of automatic sorting
and bottle filling. The control system uses microcontroller. Sorting of bottles is done on the
conveyer belt via IR sensors and then these bottles are filled by actuating the solenoid valves.
The conveyors are used in many automated industries for moving parts from one place to
another. The second concern is the bottle filling. Once the bottle is sorted, conveyer belt transfers
1.2 Description: -
Industrial Automation plays an increasingly important part in the global economy and also in
daily experience. At present, for companies, the purpose of automation has shifted from growing
productivity and reducing costs to broader issues. This work takes the idea of automatic sorting
and bottle filling. The control system uses microcontroller. Sorting of bottles is done on the
conveyer belt via IR sensors and then these bottles are filled by actuating the solenoid valves.
The conveyors are used in many automated industries for moving parts from one place to
another. The second concern is the bottle filling. Once the bottle is sorted, conveyer belt transfers
1. Arduino UNO
2. Stepper Motor
1
3. Stepper Motor Driver
4. 2*16 LCD
5. Buzzer
6. Water Pump
1. Arduino IDE
Above mentioned software/applications are easily available. Google Assistant comes pre-
installed in Android Smartphones. And the other two softwares Blynk and IFTTT are open-
Bottle filling and sealing using Arduino is used beverage and bottling industries. Other
machines of filling found in the market is very high price because of PLC. And it requires
complex changes in hardware and program configuration if varied liquid volume is required to
Solving by using Arduino So the purpose of this project is to develop the bottle filling and
sealing using Arduino. Arduino is used as the controller to control the Automatic operation of
2
this project. Arduino is selected as the controller because it is easier to learn and the compact size
market it easier to attach it with system. The bottle filling using Arduino is developed to be lower
in price compare to the other filling using machine in market. Bottles placed on the conveyer belt
will be filled with a predetermined amount of liquid automatically. The flow of the project will
be something like this- liquid from tub A, tub B and Tub C will be brought by a predetermined
amount to tub D which is the dispensing tub. The conveyer will then start and the bottle placed
on it will be detected by a bottle detector section. This will stop the conveyer and the bottle will
be filled to predetermined level. The brief description of the hardware is as given below. Flexible
and can be reapplied control other system quickly and easily. Trouble shooting aids make
programming and reduce downtime. Reliable components make these likely to operate for year
before future. This modal used in small industries and dairy for the liquid or milk filling.
3
CHAPTER-2 PROJECT DESIGN
Arduino Uno: Arduino is a controller which will receive the signals from the frequency receiver
and sending element and compare them and give a control signal.
Motor: An electric motor is an electrical machine to that convert electrical energy into
mechanical energy.
Conveyor Belt: The dimension of model is approximately 2.5fit of length and 4 Inch of wide.
4
2.3 Circuit Diagram of Project: -
5
6
Fig 2.2: - Circuit Diagram of Project
This project is an automatic bottle filling machine. Bottles placed on the conveyer belt will be
filled with a predetermined amount of liquid automatically. The flow of the project will be
something like this- liquid from tub A, tub B and Tub C will be brought by a predetermined
amount to tub D which is the dispensing tub. The conveyer will then start and the bottle placed
on it will be detected by a bottle detector section. This will stop the conveyer and the bottle will
be filled to predetermined level. The brief description of the hardware is as given below.
Proximity Sensor are used to detect objects and obstacles in front of sensor. Sensor keeps
transmitting infrared light and when any object comes near, it is detected by the sensor by
monitoring the reflected light from the object. It can be used in robots for obstacle avoidance, for
automatic doors, for parking aid devices or for security alarm systems, or contact less tachometer
by measuring RPM of rotation objects like fan blades. Here we have used it to sense the position
of the bottle. When the bottle comes in front of the sensor, the reflected light activates it and a
command is sent to the microcontroller board which in turn stops the conveyer belt motor. The
heart of the sensor is the LM358 dual op amp. Sensing is done by a black photodiode which is
only sensitive to IR light. An IR LED is kept adjacent to it which glows continuously via a 560
ohm resistor. The photodiode is biased by a 10k resistor that produced a voltage drop
proportional to the no reflection condition. Now when an object (in our case, a bottle) comes in
front of it, light from the LED is reflected back on to the photodiode. This decreases the
resistance of the photodiode drastically causing the voltage across it to drop. This voltage drop is
7
connected to the inverting input of op amp LM358 whose non inverting input is fed a reference
voltage from a variable resistor. As soon as the voltage on the inverting pin goes higher than the
voltage at the reference, the output of the opamp switches from low to high indicating the
presence of a bottle. This output is given to the pin D9 of the arduino nano. THE MAIN
CONTROLLER SECTION: the controller board used here is the Arduino nano. It has similar
functionality to the Arduino Uno, but in a DIP module package and works with a Mini-B USB
cable. The Mini-B USB cable is included. This board is a Arduino clone which is perfectly
compatible with the Arduino IDE and examples provided in it. The microcontroller it uses is the
Atmega 328 which is the same as the Arduino Uno. The Atmel Atmega 328 which is an 8 bit
high performance RISC microcontroller. The controller possesses 32 KB ISP flash memory with
1KB EEPROM and 2KB SRAM. This 28 pin DIP microcontroller with 23 Input output lines
(programmable) and 32 general purpose registers for its internal work. It also has 3
timers/counters and internal external interrupt sources. It also supports a programmable USART
and a serial 2 wire interface. It has 6 channel onboard 10 bit Analog to digital converter thus
making it capable of handling analog inputs and manipulating them. It also boasts a
programmable watchdog timer with 5 different software controlled power saving modes. The
most flexible thing about the controller is that it can be powered from 1.8 V to 5.5 V. The
connections to the controller board have been made as shown in the circuit diagram. As the nano
has onboard regulator for 5V, no separate regulator circuit has been used.
This section has been constructed of 6 relays and their associated driving circuits. The output of
the controller is obtained pins that are mentioned in the diagram. The port outputs are then fed to
the ULN122 darlington driver chip. The driver used here is the ULN122, a chip which contains 8
8
Darlington pairs on it. The darlington pairs provide the necessary current amplification for
driving the relays. The chip also has internal freewheeling diodes that are necessary for driving
inductive loads like the relay coils in this case. Inductive loads such as relays, motors, solenoids
etc tend to produce large back emfs when suddenly switched on and off. This back emf is
proportional to the rate of change of current and is thus sufficiently large to destroy the driving
semiconductor device. If we were to drive non inductive or resistive loads like LEDs or buzzers,
we can leave the pin 10 of the ULN (which is actually the common cathode of all 8 freewheeling
diodes of the 8 driver pairs). Each relay coil has a resistor of 10k and a 3mm red LED connected
to it such that whenever a particular relay is energized, the LED parallel to that relay coil also
lights up thus producing a indication of that relay being switched on. The first 4 relays control
the solenoid valves and thus they are used to switch on and off a 24 V supply that the valves
require. The remaining two relays are used to control 12V dc motors, one for the conveyor belt
The system power requirement is considerably large by electronic circuit standards owing to the
6 relays operating in the system. Instead of building a discrete power supply using a transformer
etc., we have opted for a 12V 1A ready made SMPS power supply. To accommodate the
connector of the power supply, the mother board has been fitted with a DC jack socket. A
readymade bridge rectifier has been used after the DC socket. The power supply itself is a dc
power supply but the bridge is used as a polarity correcting device in case if the power supply
connections are opposite to what we have connected on the board. The 12V supply thus obtained
is directly applied to the Vin pin of the microcontroller board as it contains an onboard 5V
regulator. The relays are driven by 12V unregulated supply directly from the SMPS.
9
2.5 Component Used
Arduino is an open-source microcontroller-based kits for building digital devices and interactive
objects that can sense and control the physical world. The Nano is a microcontroller board based
on the atmega 328p. It has 14 digital input/output pins (of which 6 can be used as PWM outputs),
6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack and a reset button. It
contains everything needed to support the microcontroller; simply connect it to a computer with
a USB cable or power it with an AC-to-DC adapter or battery to get started. For programming
(IDE) based on the Processing project, which includes support for C, C++ and Java
10
programming languages.
11
Fig 2.3 : - Arduino UNO
2.5.2 Motor: -
An electric motor is an electrical machine to that convert electrical energy into mechanical
energy. The reverse of this process would be the conversion of mechanical energy into electrical
energy and is done by the an electric generator. In normal motoring mode most electric motor
operate through the interaction between an electric motor magnetic field and winding currents to
generate force within the motor. The largest of the electric motors are used for ship propulsion,
pipelines compression and pumped storage applications with ratings reaching 100 megawatt.
Stepper Motor: -
A Stepper motor is any of the class of electrical machine that convert direct current electrical
power into the mechanical power. All types of Stepper motor have some internal mechanism
either electromechanical and electronic to periodically change the direction of current flow in the
part of the motor. Most types produce rotary motion a linear motor directly produces force and
motion in the straight line. Stepper motors was the first type widely used since they could be
12
Fig 2.4 : -Nema 17 Stepper Motor
current through a solenoid. A two-port valve is switched on or off. It is timer operated and is
used to control the amount of liquid to be filled. Its switching is controlled by the
microcontroller. It can be operated at the maximum pressure of 10 bar. Material used for the
solenoid valve is brass. The following figure shows the solenoid valve.
13
Fig 2.5: -Water Pump
The A4988 is a complete micro stepping motor driver with built-in translator for easy operation.
It is designed to operate bipolar stepper motors in full-, half-, quarter-, eighth-, and sixteenth-step
modes, with an output drive capacity of up to 35 V and ±2 A. The A4988 includes a fixed off-
time current regulator which has the ability to operate in Slow or Mixed decay modes. The
translator is the key to the easy implementation of the A4988. Simply inputting one pulse on the
STEP input drives the motor one micro step. There are no phase sequence tables, high frequency
control lines, or complex interfaces to program. The A4988 interface is an ideal fit for
operation, the chopping control in the A4988 automatically selects the current decay mode, Slow
or Mixed. In Mixed decay mode, the device is set initially to a fast decay for a proportion of the
fixed off-time, then to a slow decay for the remainder of the off-time. Mixed decay current
control results in reduced audible motor noise, increased step accuracy, and reduced power
dissipation.
14
Fig 2.6: - A4988 Stepper Motor Driver
Hitachi’s HD44780 based 16×2 character LCD are very cheap and widely available, and is an
essential part for any project that displays information. Using the LCD backpack, desired data
can be displayed on the LCD through the I2C bus. In principle, such backpacks are built aorund
PCF8574 (from NXP) which is a general purpose bidirectional 8 bit I/O port expander that uses
the I2C protocol. The PCF8574 is a silicon CMOS circuit provides general purpose remote I/O
expansion (an 8-bit quasi-bidirectional) for most microcontroller families via the two-line
bidirectional bus (I2C-bus). Note that most backpack modules are centered around PCF8574T
(SO16 package of PCF8574 in DIP16 package) with a default slave address of 0x27. If your
backpack holds a PCF8574AT chip, then the default slave address will change to 0x3F. In short,
your backpack is based on PCF8574T and the address connections (A0-A1- A2) are not bridged
15
Fig 2.6: - I2C LCD Module
In electronics, the Darlington transistor (often called a Darlington pair) is a compound structure
consisting of two bipolar transistors (either integrated or separated devices) connected in such a
way that the current amplified by the first transistor is amplified further by the second one.
16
2.5.7 Printed Circuit Board
Printed circuit boards are used in all but the simplest electronic products. They are also used in
popular but now rarely used. PCBs require additional design effort to lay out the circuit,
cheaper and faster than with other wiring methods, as components are mounted and wired
in one operation. Large numbers of PCBs can be fabricated at the same time, and the layo
A basic PCB consists of a flat sheet of insulating material and a layer of copper foil,
laminated to the substrate. Chemical etching divides the copper into separate conducting
lines called tracks or circuit traces, pads for connections, vias to pass connections
between layers of copper, and features such as solid conductive areas for EM shielding or
other purposes. The tracks function as wires fixed in place, and are insulated from each
other by air and the board substrate material. The surface of a PCB may have a coating
that protects the copper from corrosion and reduces the chances of solder shorts between
traces or undesired electrical contact with stray bare wires. For its function in helping to
17
A printed circuit board can have multiple copper layers. A two-layer board has copper on both
sides; multi-layer boards sandwich additional copper layers between layers of insulating
material. Conductors on different layers are connected with vias, which are copper-plated holes
that function as electrical tunnels through the insulating substrate. Through-hole component
leads sometimes also effectively function as wires. After two-layer PCBs, the next step up is
usually four-layer. Often two layers are dedicated as power supply and ground planes, and the
other two are used for signal wiring between components, but only has to be done once. PCBs
2.6 Programs
Program in ArduinoUNO
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Set the LCD address to 0x27 for a 16 chars and 2 line display
int buttonPin;
int r;
int m = 8;
18
void setup()
r = 12;
pinMode(buttonPin, INPUT_PULLUP);
pinMode(r, INPUT);
lcd.begin();
lcd.backlight();
lcd.clear();
lcd.print("Press Start");
pinMode(stepPin,OUTPUT);
pinMode(dirPin,OUTPUT);
pinMode(m,OUTPUT);
while(digitalRead(r) == LOW)
19
digitalWrite(dirPin,LOW); // Enables the motor to move in a particular direction
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
if(digitalRead(r) == HIGH)
break;
void loop()
if(digitalRead(buttonPin) == HIGH) //functions based off of button pulling input pin LOW
tone(buzzer, 800);
delay(1000);
noTone(buzzer);
lcd.clear();
20
lcd.setCursor(0,0); // column, row
lcd.print("Start Filling");
delay(500);
lcd.print("Bottle 1/6");
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
tone(buzzer, 1000);
delay(200);
noTone(buzzer);
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
21
}
delay(500);
lcd.print("Bottle 2/6");
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
tone(buzzer, 1000);
delay(200);
noTone(buzzer);
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
delay(500);
22
lcd.print("Bottle 3/6");
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
tone(buzzer, 1000);
delay(200);
noTone(buzzer);
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
delay(500);
lcd.print("Bottle 4/6");
digitalWrite(m,HIGH);
delay(1850);
23
digitalWrite(m,LOW);
tone(buzzer, 1000);
delay(200);
noTone(buzzer);
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
delay(500);
lcd.print("Bottle 5/6");
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
tone(buzzer, 1000);
24
delay(200);
noTone(buzzer);
digitalWrite(stepPin,HIGH);
delayMicroseconds(2000);
digitalWrite(stepPin,LOW);
delayMicroseconds(2000);
delay(500);
lcd.print("Bottle 6/6");
digitalWrite(m,HIGH);
delay(1850);
digitalWrite(m,LOW);
lcd.clear();
25
lcd.setCursor(2,1); // column, row
lcd.print("New Bottles");
tone(buzzer, 1500);
delay(300);
noTone(buzzer);
delay(100);
tone(buzzer, 1500);
delay(300);
noTone(buzzer);
delay(100);
tone(buzzer, 1500);
delay(300);
noTone(buzzer);
delay(100);
tone(buzzer, 1500);
delay(300);
noTone(buzzer);
delay(100);
tone(buzzer, 1500);
delay(300);
noTone(buzzer);
delay(100);
26
CHAPTER-3 DEVELOPMENT AND IMPLEMENTATION
The Arduino is a fantastic single-board microcontroller solution for many DIY projects, and,
in this blog, we will look at the Integrated Development Environment, or IDE, that is used to
program it
The Arduino IDE is incredibly minimalistic, yet it provides a near-complete environment for
most Arduino-based projects. The top menu bar has the standard options, including “File”
(new, load save, etc.), “Edit” (font, copy, paste, etc.), “Sketch” (for compiling and
programming), “Tools” (useful options for testing projects), and “Help”. The middle section
of the IDE is a simple text editor that where you can enter the program code. The bottom
section of the IDE is dedicated to an output window that is used to see the status of the
compilation, how much memory has been used, any errors that were found in the program,
Projects made using the Arduino are called sketches, and such sketches are usually written in
a cut-down version of C++ (a number of C++ features are not included). Because
are a number of device-specific libraries (e.g., changing pin modes, output data on pins,
reading analog values, and timers). This sometimes confuses users who think Arduino is
27
Fig 3.1: -The Arduino IDE in its default state
3.2.1The 6 Buttons
While more advanced projects will take advantage of the built-in tools in the IDE, most
projects will rely on the six buttons found below the menu bar.
1. The check mark is used to verify your code. Click this once you have written your code.
28
4. The upward arrow is used to open an existing Arduino project.
6. The far-right button is a serial monitor, which is useful for sending data from the
29
CHAPTER-4 CONCLUSION AND FUTURE SCOPE
4.1 CONCLUSION
This was created as fully automatic liquid filling system. The system meets the demand of high-speed
The system has proved to work effectively avoiding unnecessary spill or wastage of liquids. This was to
develop a liquid filling and capping system based on certain specifications. This was successfully
implemented. A lot of additional features like user defined volume specification etc. were added in the
different stages in our work and the desired results were obtained. More features can be added to this
system as follows: depending on the size, shape and weight of the containers, filling and capping
By the installation of jet nozzle and strong solenoid valve can reduce the time to fill bottles and can
A capping section could also be introduced. The nozzle positioning must be given more care and
concenteration. The system could be redesigned for increased bottle size and productivity.
30
REFERENCES
[1] https://www.academia.edu/10099004/AUTOMATED_LIQUID_FILLING_SYSTEM-EP_2014
[2] IoT:
https://internetofthingsagenda.techtarget.com/definition/IoT-device
[3] Webhooks
https://webhooks.pbworks.com/w/page/13385124/FrontPage
31