This article will discuss the Bottle Filling System with Capacity Error Detection using Omron PLC program and CX-Programmer software. The system is designed to automate the bottle filling process in production with an added feature of capacity error detection. The system utilizes a weighing function to ensure that each bottle is filled to the specified capacity. Bottles with excessive or insufficient content will be separated. The system will also count the bottles filled with the correct weight.
Program Objective

Initialization:
- The main conveyor starts moving, and the system waits for a bottle to be detected under the filling valve.
Filling Process:
- When the proximity sensor detects a bottle under the valve, the system opens the filling valve for 5 seconds.
- After 5 seconds, the valve automatically closes.
- A weighing process will be conducted to ensure the bottle is filled to the specified capacity.
Error Detection:
- If the bottle does not reach the minimum capacity (45 ml), the system classifies it as an Underweight bottle. The bottle will be separated from the main conveyor line.
- If the bottle exceeds the maximum capacity (50 ml), the system classifies it as an Overweight bottle. The bottle will be separated from the main conveyor line.
Separation of Bottles with Non-Conforming Weights:
- The bottles with incorrect weight will be directed to another conveyor line using an actuator.
- Bottles with the correct weight will remain on the main conveyor line and proceed to the next process.
- The system will only count bottles with the correct weight.
Indicator Lamp:
- The system has two indicator lamps that will turn On if bottles with Underweight or Overweight are detected.
Detect Overweight and Less Weight Bottles

Inputs and Outputs Mapping
S.No. | Comment | Input (I) | Output(Q) | Memory Bit | Memory Word | Timer |
1 | PB_START | 0.00 | ||||
2 | PB_STOP | 0.01 | ||||
3 | SENS_BOTTLE | 0.02 | ||||
4 | SENS_OUT_OVER | 0.03 | ||||
5 | SENS_OUT_LESS | 0.04 | ||||
6 | SENS_OUT_GOOD | 0.05 | ||||
7 | RESET_COUNTER | 0.06 | ||||
8 | CONVEYOR_1 | 100.00 | ||||
9 | VALVE_FILLING | 100.01 | ||||
10 | ACTUATOR_1 | 100.02 | ||||
11 | ACTUATOR_2 | 100.03 | ||||
12 | LAMP_BOTTLE_OVERWEIGHT | 100.04 | ||||
13 | LAMP_BOTTLE_LESSWEIGHT | 100.05 | ||||
14 | CONVEYOR_2 | 100.06 | ||||
15 | CONVEYOR_3 | 100.07 | ||||
16 | PV_LIQUID | D0 | ||||
17 | COUNTER_GOOD_BOTTLE | D10 | ||||
18 | SYSTEM_ON | W0.00 | ||||
19 | TIMER_DELAY | T0000 |
PLC Project

RUNG 0 (SYSTEM START)
In this Rung, the memory bit SYSTEM_ON (W0.00) will be in the HIGH state when the PB_START (0.00) button is Pressed. Because it uses the KEEP (011) instruction, the memory bit SYSTEM_ON (W0.00) will remain in the HIGH state even though the PB_START (0.00) button has been Released.
If the PB_STOP (0.01) button is Pressed, the memory bit SYSTEM_ON (W0.00) will be in the LOW state.
RUNG 1 (CONVEYOR 1 ON)
In this Rung, when the NO contact of the memory bit SYSTEM_ON (W0.00) is in the HIGH state, the output CONVEYOR_1 (100.00) will be ON. The CONVEYOR_1 (100.00) output will be OFF if the NC contact of VALVE_FILLING (100.01) is in the HIGH state.
RUNG 2 (BOTTLE FILLING)
In this Rung, if the NO contact of the memory bit SYSTEM_ON (W0.00) and the SENS_BOTTLE (0.02) Sensor are in the HIGH state, then the VALVE_FILLING (100.01) output will be OPEN and the TIMER_DELAY (T0000) Timer will Start counting up to 5 seconds.
After Timer TIMER1 (T0000) has finished counting, the output VALVE_FILLING (100.01) will be closed.

RUNG 3 (BOTTLE OVER WEIGHT)
In this Rung, the output ACTUATOR_1 (100.02) will be ON when the NO contact of the memory bit SYSTEM_ON (W0.00) in the HIGH state and the memory word PV_LIQUID (D0) is Greater Than “50”.
The ACTUATOR_1 (100.02) output will be OFF if the NO contact of Sensor SENS_OUT_OVER (0.03) is in the HIGH state.
The CONVEYOR_2 (100.06) output will be ON when the NO contact of ACTUATOR_1 (100.02) is in the HIGH state.

RUNG 4 (BOTTLE LESS WEIGHT)
In this Rung, the output ACTUATOR_2 (100.03) will be ON when the NO contact of the memory bit SYSTEM_ON (W0.00) in the HIGH state and the memory word PV_LIQUID (D0) is Less Than “45”.
The ACTUATOR_2 (100.03) output will be OFF if the NO contact of Sensor SENS_OUT_LESS(0.04) is in the HIGH state.
The CONVEYOR_3 (100.07) output will be ON when the NO contact of ACTUATOR_2 (100.03) is in the HIGH state.
RUNG 5 (LAMP ALARM)
The LAMP_BOTTLE_OVERWEIGHT (100.04) output will be ON when the NO contact of the memory bit SYSTEM_ON (W0.00) and the ACTUATOR_1 (100.02) output are in the HIGH state.
The LAMP_BOTTLE_LESSWEIGHT (100.05) output will be ON when the NO contact of the memory bit SYSTEM_ON (W0.00) and the ACTUATOR_2 (100.03) output are in the HIGH state.

RUNG 6 (COUNTER AND RESET)
In this Rung, the value in the memory word COUNTER_GOOD_BOTTLE (D1) will increase (+1) if the NO contact of the memory bit SYSTEM_ON (W0.00) and Sensor SENS_OUT_GOOD (0.05) are in the HIGH state.
The value in the memory word COUNTER_GOOD_BOTTLE (D1) will be reset to zero “0” when the NO contact of the memory bit SYSTEM_ON (W0.00) in the HIGH state and the RESET_COUNTER (0.06) button is Pressed.
Read Next:
- Empty Bottle detection using PLC Logic
- PLC Programming on Bottle Line Control
- Fish Farm PLC Automation Programming
- PLC Program for Automatic Bottle Rejection
- Electro-Pneumatic Circuit Using Pressure Sensor