Journal of Fuzzy Systems and Control, Vol. 4, No 2, 2026

Development of a Vision-Based Color Sorting and Packaging System Using a 3-DOF Robotic
Arm and PLC Control

Kha-Vy Ngo 1, Hien-Dat Phan 2,*, Nguyen-Thanh-Phong Dang 3, Chi-Huy Lu 4, Quoc-Thinh Nguyen 5, Minh-Thang Vo 6,
Binh-Hau Nguyen
7, Van-Tien Tran 8, Bao Pham 9, Long-Phi Pham 10, Nguyen-Duc-Duong Le 11, Quoc-Khanh Trinh 12,
Tuan-Kiet Nguyen
13

1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13 Ho Chi Minh City University of Technology and Engineering (HCM-UTE), Ho Chi Minh City (HCMC), Vietnam

7 Posts and Telecommunications Institute of Technology (PTIT), HCMC, Vietnam

Email: 1 21151189@student.hcmute.edu.vn, 2 21151092@student.hcmute.edu.vn, 3 22151133@student.hcmute.edu.vn,
4 21161005@student.hcmute.edu.vn, 5 22145253@student.hcmute.edu.vn, 6 22145248@student.hcmute.edu.vn,
7 haunb@ptit.edu.vn, 8 22146240@student.hcmute.edu.vn, 9 21151412@student.hcmute.edu.vn,
10 22151131@student.hcmute.edu.vn, 11 23142102@student.hcmute.edu.vn, 12 22146145@student.hcmute.edu.vn,
13 22146161@student.hcmute.edu.vn

*Corresponding Author

Abstract—Automated sorting and packaging play an important role in improving manufacturing productivity while reducing manual labor. An integrated automation platform for color sorting and packaging was designed and implemented by combining a three-degree-of-freedom (3-DOF) robotic arm, machine vision, and PLC-based control. Product images were acquired by a webcam for color recognition and position estimation, while system coordination was performed by a Siemens S7 1214 PLC controlling the conveyor, robotic arm, pneumatic capping mechanism, and supervisory functions. Real-time monitoring and basic operating functions were provided through an Android application communicating via the Modbus RTU protocol. Cycle testing demonstrated a theoretical capacity of 144 items per hour based on a 25-second processing duration and a 70% success rate. Parallel task scheduling in the PLC reclaimed approximately 2.5 seconds per run by removing idle delays between actuators. The physical rig brings together camera-based detection, PLC logic, robotic handling, and pneumatic tooling on one bench. Such performance benchmarks validate the design for academic experimentation and small-scale manufacturing.

Keywords—Color Sorting; Siemens S7-1200 PLC; 3-DOF Robotic Arm; Machine Vision; Automated Packaging

  1. Introduction

Digital manufacturing targets high operational throughput for small and medium-sized enterprises (SMEs). Deploying PLCs alongside vision modules, robotic manipulators, and industrial fieldbuses enables end-to-end inspection, sorting, and packaging [1], [2]. Despite these technological options, manual product handling remains common across many SME production lines. Relying on human operators routinely introduces positioning errors, drives up labor expenses, and degrades product uniformity.

A variety of automated sorting and material-handling systems have been developed [3]-[5]. PLC-controlled pneumatic systems have demonstrated reliable coordination between industrial controllers and pneumatic actuators during sorting operations [3]. Machine vision has also been combined with robotic manipulators for color recognition and automated material handling [4]. In addition, conveyor-based vision systems and robotic sorting platforms have demonstrated effective object detection, classification, and automated sorting in industrial environments [6]-[8].

Current research increasingly emphasizes vision-guided robotic systems capable of autonomous object recognition and color-based sorting. Computer vision combined with conveyors and robotic grippers has improved automated sorting [9], whereas advances in vision algorithms have enhanced object detection, robotic bin-picking,
and collaborative robotic systems for SME manufacturing
[10]-[13].

Despite these developments, most reported studies focus on individual subsystems rather than complete automation platforms [11], [14], [15]. Systems integrating a Siemens S7 1214 PLC, machine vision, a 3-DOF robotic arm, pneumatic packaging, industrial communication, and real-time supervisory monitoring remain limited. In addition, many existing systems terminate after object classification or robotic picking without completing the packaging process required in practical manufacturing environments.

To address these limitations, an integrated automation platform for color-based sorting and packaging is presented. The platform combines a Siemens S7 1214 PLC, a 3-DOF robotic arm, machine vision, pneumatic actuators, Modbus RTU communication, and an Android-based supervisory application within a unified control architecture. Automatic color recognition, sorting, packaging, and supervisory monitoring are integrated into a single PLC-based system suitable for laboratory education and small- to medium-scale manufacturing. Experimental evaluation considers processing cycle time, throughput, operational reliability, and control efficiency.

  1. Research Methodology

  1. Overall System Architecture

Fig. 1 illustrates the overall architecture of the proposed automation platform, which is designed to perform color-based product sorting and packaging while providing real-time supervisory monitoring. The architecture is organized into five functional components: machine vision, PLC-based control, robotic manipulation, pneumatic packaging, and supervisory monitoring. A specific function is assigned to each component, and product identification, sorting, packaging, and remote supervision are accomplished through the coordinated operation of all components within a unified automation framework.

  1. Overall system model

At the control level, all field devices, including the conveyor, robotic arm, pneumatic actuators, sensors, and communication modules, are coordinated by a Siemens S7 1214 DC/DC/DC PLC. An overhead webcam monitors the conveyor inspection station, capturing visual data to resolve product color classes and spatial coordinates upon item arrival. Following image processing, the calculated object coordinates and color information are transmitted to the PLC, allowing each product to be transferred by the robotic arm to the appropriate collection container. Once the required number of products has been accumulated, the corresponding container is automatically transferred to the pneumatic station, where lid placement and sealing are performed.

Supervisory functions are provided through an Android-based application that communicates with the PLC via an ESP32 gateway using the Modbus RTU protocol over an RS485 network. Through this communication architecture, operators can observe production status, product counts, and basic operating conditions in real time. Separating supervisory monitoring from the PLC control layer also ensures that visualization and remote communication do not interfere with deterministic control execution.

  1. Mechanical System Design

Reliable product handling, robotic manipulation, and automated packaging were considered during the design of the mechanical subsystem. The corresponding electrical control architecture is presented in Fig. 2. Power is provided to the PLC, sensors, motor drivers, and pneumatic solenoid valves by a 24 VDC switch-mode power supply (SMPS). A circuit breaker and an emergency stop module are incorporated into the control circuit to disconnect the power supply immediately under abnormal operating conditions. Communication with all field devices is achieved through the digital input/output modules of the Siemens S7 1214 PLC, providing deterministic real-time control and coordinated operation of the conveyor, robotic arm, sensors, and pneumatic actuators.

  1. System schematic diagram

The mechanical subsystem is composed of a color-sorting conveyor, a 3-DOF robotic arm, an intermediate accumulation station, and a pneumatic capping unit. Products are transported by the conveyor to the vision inspection area at a constant speed, where image acquisition and color recognition are carried out. After the object position has been determined by the vision system, the corresponding pick-and-place operation is performed by the robotic arm. Lightweight 3D-printed components were selected for the robot links to reduce the moving mass while simplifying the fabrication process. Joint motion is provided by stepper motors, whereas product handling is achieved using a vacuum suction cup as the end-effector. Because no mechanical gripping is required, the possibility of product displacement during high-speed operation is reduced. The fabricated 3-DOF robotic arm is presented in Fig. 3.

  1. Developed 3-DOF robotic arm

Following color-based sorting, the classified products are collected in dedicated containers before being transferred to the packaging station. A double-acting pneumatic actuator pushes containers toward the packaging station using a custom-contoured faceplate. This curved profile cradles the container body, stopping orientation shifts during transit. Capping occurs via a vertical cylinder mounted directly above the workstation, driving a press tool down onto the lid. A heavy-duty support frame prevents structural flexing during pressure strokes to hold axial alignment. The physical capping build appears in Fig. 4.

  1. Pneumatic capping mechanism
  1.  Vision-Based Color Detection

Target colors and spatial positions are determined by a top-mounted webcam facing the inspection belt. Python software processes incoming video frames to isolate red, yellow, and green items. After calculating 2D centroid positions, the script converts pixel values into robot coordinates and forwards data packets to the Siemens S7 1214 PLC. The vision procedure moves from frame capture to color segmentation, centroid tracking, and PLC transmission.

This vision-based approach eliminates the need for individual photoelectric sensors. Software algorithms handle multi-color detection on a single camera. Modifying target specifications requires software adjustments alone. Consequently, the original electrical wiring and hardware assembly remain untouched.

  1. PLC-Based Motion and Sequential Control

A single Siemens S7 1214 DC/DC/DC PLC running TIA Portal drives all physical actuators, sensor inputs, and monitoring feeds. Collision prevention relies on hard-coded software interlocks rather than mechanical limits.

Operational logic splits into two main phases in Fig. 5. Powering on the rig executes a peripheral handshake and homes the arm. Raw vision coordinates stream into PLC memory, pointing the arm to assigned drop points. Internal memory tracks each deposit. When the target count registers, the PLC triggers a double-acting pneumatic cylinder to transfer the filled container downstream.

At the capping station, a photoelectric sensor trips a stop routine on the conveyor drive. The pneumatic cylinder then extends to seal the container lid. High throughput stems from parallel task execution. The arm resets to standby simultaneously as the capping cylinder seals the package, keeping actuator downtime to a minimum.

  1. System algorithm flowchart
  1. Communication and Supervisory Monitoring

To link the PLC-based control layer with the supervisory application, the system relies on an industrial communication network for reliable data exchange. Physical communication among the control devices runs over an RS485 interface using the Modbus RTU protocol. Specifically, a CB1241 communication module manages data transfers between the Siemens S7 1214 PLC and an ESP32 gateway. The ESP32 then bridges this data wirelessly to the Android app for real-time monitoring and control. The resulting monitoring interface is shown in Fig. 6.

  1. Supervisory monitoring interface at the host server

A custom application streams real-time operational data, tracking equipment states, product counts, and system metrics, as shown in Fig. 7. User authentication restricts system access to authorized operators only. In addition to live monitoring, the app transmits remote start/stop commands and event notifications. Isolating these supervisory tasks onto an external client maintains operator control without compromising deterministic PLC control loops.

Field-level execution and supervisory monitoring run across distinct architectural tiers. Local PLC logic manages high-frequency operations, specifically motion timing, sensor reads, and pneumatic actuation. Production counts and system status pass to the monitoring application asynchronously. Separating telemetry from hard real-time tasks protects control loop determinism and allows independent scaling of the monitoring layer.

  1. Application monitoring and control interface
  1. Experimental Setup

A physical laboratory prototype was built to validate the integrated mechanical, electrical, vision, and control subsystems. Hardware components include a Siemens S7 1214 PLC, a conveyor belt, and a 3-DOF robotic arm. Image acquisition relies on an overhead webcam, while a pneumatic mechanism performs lid capping. A custom Android application provides supervisory tracking. System assembly and all experimental runs took place under standard indoor laboratory conditions.

Products of three different colors (red, yellow, and green) were evaluated. All test samples had identical geometric dimensions so that the evaluation focused on the performance of the vision-based color recognition and automated handling functions. During each trial, individual products were placed on the conveyor and processed automatically through the complete operating sequence, including color recognition, robotic pick-and-place, container accumulation, pneumatic transfer, lid placement, and final packaging.

System performance was assessed using engineering performance indicators, including processing cycle time, throughput, operational success rate, and overall system reliability. These metrics were selected to evaluate both the performance of the individual subsystems and the coordination achieved by the integrated automation system.

  1. Results and Discussion

  1. Prototype Implementation

A laboratory-scale prototype was fabricated and assembled by integrating the mechanical structure, PLC-based control system, machine vision module, pneumatic actuators, and supervisory monitoring application into a unified automation platform. Functional validation demonstrated successful integration of all subsystems throughout the complete production sequence. Product detection, robotic pick-and-place, container accumulation, pneumatic transfer, capping, and final packaging were completed automatically without interruption during experimental operation. The assembled prototype is presented in Fig. 8.

  1. Fabricated prototype of the developed system

Vision-guided manipulation enabled successful identification of product colors and accurate transfer of each item to the corresponding collection container. Based on the color recognition results, every product was automatically sorted into its designated bin. Consistent operation throughout the sorting process demonstrated reliable coordination between the machine vision module and the robotic arm. Representative experimental results are shown in in Fig. 9.

  1. Color-sorted products

Container transfer executes when the internal counter hits the preset threshold, triggering the pneumatic pusher toward the packaging line. At the capping module, a dedicated pneumatic cylinder drives the press tool down to seat the lid (Fig. 10). Experimental runs confirmed continuous operation across all functional modules, linking vision tracking directly to final packaging.

  1. Packaged Products
  1.  System Performance Evaluation

Experimental evaluation of the laboratory-scale prototype was conducted under continuous operating conditions to examine overall system performance and operational stability. Testing was performed over three representative durations (15, 30, and 45 min) to investigate the reliability of the integrated sorting and packaging process. The corresponding results are summarized in Table 1.

  1. Continuous Operation Test Results

Test duration

Total products

Successful

Failed

Success
rate (%)

15 min

38

29

9

76.3

30 min

72

52

20

72.2

45 min

108

74

34

68.5

Testing showed the operational success rate dropping from 76.3% at 15 minutes down to 68.5% by the 45-minute mark. This degradation stems from progressive mechanical instability as the prototype ran continuously. Still, across all conditions, performance averaged around 70%, proving the system remains reliable enough in laboratory conditions.

Each sorting and packaging cycle took roughly 25 seconds on average. At this pace, the platform achieves a theoretical output of 144 units per hour, defining its baseline processing capability.

By adopting a parallel PLC control strategy instead of conventional sequential control, cycle time decreased by about 2.5 seconds. The pneumatic capping mechanism operates while the robotic arm homes itself simultaneously. Overlapping these tasks minimizes actuator idle time and improves throughput without adding new hardware.

Most of the failed operations happened because of the hardware, while the PLC and vision programs ran perfectly. The 3D-printed robotic arm lacked stiffness and experienced mechanical backlash. Doing the same pick-and-place actions repeatedly caused small positioning errors to add up. When this happened, the gripper would either miss the target completely or put the product in the wrong spot.

  1. Discussion

Physical bench tests verified continuous operation connecting vision detection, PLC control, robotic handling, and pneumatics. System workflow spans target identification, sorting, container transfer, and lid capping. Replacing fixed color sensors with a vision pipeline simplifies line reconfiguration. Adapting to new product variants involves software updates alone, avoiding physical hardware alterations [3], [4], [6].

Parallel PLC execution directly trims cycle duration. Concurrently homing the manipulator during the pneumatic sealing stroke reclaims idle actuator time to maximize output.

Transitioning to production demands targeted hardware upgrades. Extended trial runs revealed structural compliance in the 3D-printed manipulator, resulting in cumulative position errors. Furthermore, vision evaluations depended on controlled ambient lighting and simple color profiles. Future revisions will replace 3D-printed links with a rigid metal structure and update vision code to process non-standard geometries under variable lighting.

  1. Conclusion

An automated packaging system integrating a 3-DOF arm and Siemens S7 1214 PLC was constructed and benchmarked. The hardware architecture ties computer vision, pneumatic tooling, robotic manipulation, and fieldbus communications into a unified sorting and sealing line. System validation confirmed continuous operation through every station. Executing parallel task blocks in the PLC reduced cycle latency by eliminating inter-actuator downtime. Telemetry monitoring and manual commands route through an Android supervisory application.

Extended runs exposed physical limitations in the prototype. Physical compliance within the 3D-printed arm structure led to cumulative position errors during prolonged cycles. Additionally, vision algorithms required controlled lighting and basic color spaces. Future iterations will replace 3D-printed components with high-rigidity structural members and update vision pipelines with machine learning classifiers for non-ideal lighting conditions.

Acknowledgement

This research is funded by Ho Chi Minh City University of Technology and Engineering, Vietnam, under grant No. SV2026-248. We also want to give thanks to the PhD. Van-Dong-Hai Nguyen (HCM-UTE) and Ms. Eng. Tu-Duc Nguyen (HCM-UTE) due to their supervision. Link of operation of system is: https://www.youtube.com/watch?si=isqj2GpLuk5VXqNT&v=968zRF170as&feature=youtu.be.

References
  1. J. M. Müller, O. Buliga, and K. I. Voigt, “Fortune favors the prepared: How SMEs approach business model innovations in Industry 4.0,” Technological Forecasting and Social Change, vol. 132, pp. 2–17, 2018, https://doi.org/10.1016/j.techfore.2017.12.019.
  2. J. Werheid et al., “Machine vision in manufacturing SMEs: a review,” Discover Applied Sciences, vol. 7, no. 5, p. 371, 2025, https://doi.org/10.1007/s42452-025-06923-4.
  3. S. R. Rallabandi, S. Yanda, C. J. Rao, B. Ramakrishna, and D. Apparao, “Development of a color-code sorting machine operating with a pneumatic and programmable logic control,” Materials Today: Proceedings, 2023, https://doi.org/10.1016/j.matpr.2023.05.150.
  4. M. L. Dezaki, S. Hatami, A. Zolfagharian, and M. Bodaghi, “A pneumatic conveyor robot for color detection and sorting,” Cognitive Robotics, vol. 2, pp. 60–72, 2022, https://doi.org/10.1016/j.cogr.2022.03.001.
  5. N. Almtireen et al., “PLC-Controlled Intelligent Conveyor System with AI-Enhanced Vision for Efficient Waste Sorting,” Applied Sciences (Switzerland), vol. 15, no. 3, p. 1550, 2025, https://doi.org/10.3390/app15031550.
  1. H. I. Bozma and H. Yalçin, “Visual processing and classification of items on a moving conveyor: A selective perception approach,” Robotics and Computer-Integrated Manufacturing, vol. 18, no. 2, pp. 125–133, 2002, https://doi.org/10.1016/S0736-5845(01)00035-7.
  2. K. R. Sughashini, V. Sunanthini, J. Johnsi, R. Nagalakshmi, and R. Sudha, “A pneumatic robot arm for sorting of objects with chromatic sensor module,” Materials Today: Proceedings, vol. 45, pp. 6364–6368, 2020, https://doi.org/10.1016/j.matpr.2020.10.936.
  3. R. Mattone, G. Campagiorni, and F. Galati, “Sorting of items on a moving conveyor belt. Part 1: A technique for detecting and classifying objects,” Robotics and Computer-Integrated Manufacturing, vol. 16, no. 2, pp. 73–80, Apr. 2000, https://doi.org/10.1016/S0736-5845(99)00040-X.
  4. I. Alrushidy, Y. Bahumid, R. Bin Shujaa, A. Abdullah, A. Kurd, and M. Abdullah, “Design and Fabrication of Color Sorting Machine Based on Computer Vision,” Journal of Science and Technology, vol. 30, no. 6, pp. 107–115, 2025, https://doi.org/10.20428/jst.v30i6.2954.
  5. L. Fina, T. Mascarenhas, C. Smith, and H. Sevil, “Object Detection Accuracy Enhancement in Color based Dynamic Sorting using Robotic Arm,” in Florida Conference on Recent Advances in Robotics (FCRAR), 2023 https://doi.org/10.5038/cvse3872.
  1. W. T. Abbood, O. I. Abdullah, and E. A. Khalid, “A real-time automated sorting of robotic vision system based on the interactive design approach,” International Journal on Interactive Design and Manufacturing, vol. 14, no. 1, pp. 201–209, 2020, https://doi.org/10.1007/s12008-019-00628-w.
  2. J. Borrell, C. Perez-Vidal, and J. V. Segura, “Optimization of the pick-and-place sequence of a bimanual collaborative robot in an industrial production line,” International Journal of Advanced Manufacturing Technology, vol. 130, no. 9–10, pp. 4221–4234, 2024, https://doi.org/10.1007/s00170-023-12922-9.
  3. X. Yang, Z. Zhou, J. H. Sørensen, C. B. Christensen, M. Ünalan, and X. Zhang, “Automation of SME production with a Cobot system powered by learning-based vision,” Robotics and Computer-Integrated Manufacturing, vol. 83, p. 102564, 2023, https://doi.org/10.1016/j.rcim.2023.102564.
  4. J. Park, M. B. G. Jun, and H. Yun, “Development of robotic bin picking platform with cluttered objects using human guidance and convolutional neural network (CNN),” Journal of Manufacturing Systems, vol. 63, pp. 539–549, 2022, https://doi.org/10.1016/j.jmsy.2022.05.011.
  5. X. Xiao, Y. Jiang, and Y. Wang, “Key Technologies for Machine Vision for Picking Robots: Review and Benchmarking,” Machine Intelligence Research, vol. 22, no. 1, pp. 2–16, 2025, https://doi.org/10.1007/s11633-024-1517-1.

Kha-Vy Ngo, Development of a Vision-Based Color Sorting and Packaging System Using a 3-DOF Robotic Arm and PLC Control