Automatic bottle filling with Arduino UNO and KY-032 sensor

Arduino UNO 19-11-24
23 0

Tutorial plan

1- Presentation of Automatic bottle filling

2- How does Arduino UNO controls the system ?

3- Necessary components of system

4- Circuit setup of system

5- Programming the Arduino

 

 

Presentation of Automatic bottle filling

An Automatic Bottle Filling System is a modern industrial setup designed to automate the process of filling liquid products into bottles of varying sizes and capacities. It is widely used in industries such as beverages, pharmaceuticals, cosmetics, and chemicals to ensure precision, efficiency, and hygiene during production.

Objective

The primary goals of an automatic bottle filling system are:

Efficiency: To speed up the bottle-filling process compared to manual methods.

Accuracy: To ensure consistent and precise quantities in each bottle.

Hygiene: To minimize human contact and reduce contamination risks.

Cost-Effectiveness: To reduce labor costs and optimize production.

 

An automatic bottle filling system typically consists of the following:

1- Conveyor System:

Moves bottles to the filling station.

Ensures continuous and smooth operation.

2- Sensors:

Detects the presence of bottles on the conveyor belt.

Ensures alignment and proper positioning for filling.

3- Filling Mechanism:

Pump-Based: Uses pumps for liquid transfer.

Gravity-Based: Utilizes gravity for liquids like water.

Piston-Based: For viscous liquids such as syrup or shampoo.

4- Control Unit:

Often powered by a PLC (Programmable Logic Controller) or microcontroller.

Manages the filling process, conveyor movement, and sensors.

5- Nozzles:

Dispense the liquid into bottles.

Designed to prevent spillage and control flow rate.

6- Actuators: control the start/stop mechanism of liquid flow and bottle movement.

7- Capping and Labeling Units (Optional): completes the packaging process by sealing and labeling bottles.

 

Advantages

Automation: Reduces human intervention, improving efficiency.

Consistency: Ensures uniform filling across all bottles.

Scalability: Can handle large production volumes.

Flexibility: Adjustable for different bottle sizes and liquid types.

 

Applications

Food and Beverage Industry: Filling water, juices, soft drinks, and milk.

Pharmaceuticals: Filling syrups, medicines, and disinfectants.

Cosmetics: Filling shampoos, lotions, and perfumes.

Chemical Industry: Filling cleaning agents, oils, and other liquids.

 

How does Arduino UNO controls the system ?

An Arduino UNO can control an Automatic Bottle Filling System using a KY-032 obstacle sensor, a US-17H4401 stepper motor, a relay module, and a water pump by coordinating the components to detect bottles, align them, and dispense liquid accurately. Here's a breakdown of how the system works and is implemented:

1. Bottle Detection:

The KY-032 sensor detects the presence of a bottle and sends a digital HIGH signal to the Arduino.

The Arduino processes the signal and starts the alignment and filling cycle.

2. Bottle Alignment:

The Arduino controls the stepper motor, ensuring the bottle is precisely aligned under the filling nozzle.

It does so by sending appropriate step and direction signals to the stepper motor driver.

3. Liquid Dispensing:

Once the bottle is aligned, the Arduino triggers the relay module to turn on the water pump.

The pump runs for a pre-programmed duration to dispense the desired liquid volume.

4. Cycle Reset:

After dispensing, the pump is turned off, and the stepper motor moves the bottle to the next position.

The system resets and waits for the next bottle.

 

Necessary components of system

Arduino UNO:

Arduino Uno

Acts as the brain of the system, coordinating sensor input and controlling the stepper motor, relay module, and water pump.

KY-032 Obstacle Sensor:

Capteur infrarouge KY-032

Detects the presence of a bottle on the conveyor or at the filling station. It triggers the system to start the filling process.

US-17H4401 Stepper Motor:

Moves or aligns the bottle precisely under the filling nozzle. Controlled by the Arduino for step-by-step movements using a stepper driver.

CNC Shield V3

The CNC Shield V3 is a compact, open-source hardware solution for controlling stepper motors and other peripherals commonly used in CNC (Computer Numerical Control) machines. It is designed to be used with an Arduino UNO and is widely used in DIY CNC machines, laser engravers, and 3D printers.

Relay Module:

Acts as a switch to control the water pump. The Arduino activates the relay to turn the pump on and off.

Water Pump:

Dispenses a specific volume of liquid into the bottle when activated.

support

The support structure may also include additional components such as seals to prevent leakage of the liquid or other materials being dispensed.

Disc

In a bottle filling system, the disc may be an important component of the mechanism that controls the flow of liquid or other materials into the bottles.

timing belt

A timing belt is a mechanical component that is used to transmit power and synchronize the rotation between two shafts. In a stepper motor bottle filling system, a timing belt could be used to connect the stepper motor to the disc, which controls the flow of liquid or other materials in the filling mechanism.

Connecting Wires:

Jumper wires

Jumper wires to connect the different components of system.

5- Power Supply:

You’ll need a 9V power supply for water pump.

 

Circuit setup of system

1- Assembly of the Arduino UNO and the KY-032 sensor

KY-032 Obstacle Sensor

VCC → Arduino 3.3V

GND → Arduino GND

OUT → Arduino Analogic Pin A4 (SDA)

2- Assembly of Arduino with the stepper motor

The role of the stepper motor is to turn the disk containing the bottles. We connect the stepper motor to the cnc board which is connected to the Arduino board.

3- Assembly of Arduino with the water pump

VCC → Arduino 3.3V

GND → Arduino GND

S → Arduino Analogic A5 (SCL)

NO Terminals → Water pump power circuit

COM Terminal → (+) terminal of a 9V battery

NO Terminal → (+) terminal of water pump

(-) terminal of water pump → (-) terminal of a 9V battery

 

Programming the Arduino

Below is a sample code for implementing the system:

How the Code Works

1. Obstacle Detection: The KY-032 sensor detects a bottle and sends a HIGH signal to the Arduino.

2. Stepper Motor Control: The AccelStepper library handles precise movement of the US-17H4401 stepper motor for bottle alignment.

3 Relay Control: The Arduino activates the relay module to power the water pump for a fixed duration (e.g., 2 seconds).

4- Cycle Reset: After filling, the system repositions the bottle and waits for the next detection signal.

 

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info