The 2D Barcodes Identify the Workpieces by using Microcontroller Interface between Image Processing and PLC Machine


  • Napassadol SINGHATA Department of Automation and Robotic Engineering, Faculty of Engineering, Rajamangala University of Technology Krungthep, Bangkok 10120, Thailand



Barcode, Image Processing, Web camera, Microcontroller, PLC


This paper focuses on 3 main subjects; the first is the presentation and implementation of a PLC concept as a core component to control the system in the industry. The next subject of this work involves some tests to detect 2D barcodes with a web camera on 5 similar workpieces. It is difficult to classify and detect 2D barcodes since they are small about a size of 0.5×0.5 cm2 patterned squares. The last part of the paper presents the implementation of a technique by using a microcontroller to link between a vision system and PLC. This method can be used in an old type of PLC without an additional equipment in the PLC, which can be connected to various types of cameras. The results of the system test show that the vision system can operate in the automatic classifying machine of the PLC controller. The machine vision can classify similar workpieces by using small 2D barcodes with image processing methods. The workpieces are stored in the correct position of 5 boxes in the storage compartment. This method of using a microcontroller interface with image processing and the PLC was successful.


  • Web camera sensor read 2D barcodes
  • Decoding 2D barcode and transform to digital signal
  • Incorporating image processing into PLC system by using microcontroller and relay
  • Transform signal into PLC processing to classifying the workpieces



Download data is not yet available.


Metrics Loading ...


H Wang, Z Xiong, AM Finn and Z Chaudhry. A context-driven approach to image-based crack detection. Mach. Vis. Appl. 2016; 27, 1103-14.

JB Li, WQ Huang and CJ Zhao. Machine vision technology for detecting the external defects of fruits - a review. Imag. Sci. J. 2015; 63, 241-51.

SM Iqbal, A Gopal, PE Sankaranarayanan and AB Nair. Classification of selected citrus fruits based on color using machine vision system. Int. J. Food Properties 2016; 19, 272-88.

GC Deac, CN Deac, CL Popa, M Ghinea, CE Cotet. Machine vision in manufacturing processes and the digital twin of manufacturing architectures. In: Proceedings of the 28th DAAAM International Symposium on Intelligent Manufacturing and Automation. Vienna, Austria, 2017, p. 733-6.

MG Hudedmani, RM Umayal, SK Kabberalli and R Hittalamani. Programmable Logic Controller (PLC) in automation. Adv. J. Graduate Res. 2017; 2, 37-45,

V Chauhan and B Surgenor. Fault detection and classification in automated assembly machines using machine vision. Int. J. Adv. Manuf. Tech. 2017; 90, 2491-512.

DB Perng, HW Liu and SH Chen. A vision-based LED defect auto-recognition system. Nondestr. Test. Eval. 2014; 29, 315-31.

CM Yeum and SJ Dyke. Vision-based automated crack detection for bridge inspection. Comput. Aided Civ. Infrastruct. Eng. 2015; 30, 759-70.

JF Lopes, L Ludwig, DF Barbin, MVE Grossmann and S Barbon. Computer vision classification of barley flour based on spatial pyramid partition ensemble. Sensors 2019; 19, 2953.

M Rokunuzzaman and HPW Jayasuriya. Development of a low cost machine vision system for sorting of tomatoes. Agr. Eng. Int. CIGR J. 2013; 15, 173-80.

TH Sun, FC Tien, FC Tien, RJ Kuo. Automated thermal fuse inspection using machine vision and artificial neural networks. J. Intell. Manuf. 2016; 27, 639-51.

A Azizi, Y Abbaspour-Gilandeh, M Nooshyar and A Afkari-Sayah. Identifying potato varieties using machine vision and artificial neural networks. Int. J. Food Properties 2016; 19, 618-35.

MS El-Faki, Y Song, N Zhang, HA El-Shafie and P Xin. Automated detection of parasitized Cadra cautella eggs by Trichogramma bourarachae using machine vision. Int. J. Agr. Biol. Eng. 2018; 11, 94-101.

WY Wu, CW Hung, WB Yu. The development of automated solder bump inspection using machine vision techniques. Int. J. Adv. Manuf. Tech. 2013; 69, 509-23.

M Nagle, K Intani, G Romano, B Mahayothee, V Sardsud and J Müller. Determination of surface color of “all yellow” mango cultivars using computer vision. Int. J. Agr. Biol. Eng. 2016; 9, 42-50.

JA Alvarez-Bermejo, C Giagnocavo, Li Ming, EC Morales, DPM Santos and Y Xinting. Image processing methods to evaluate tomato and zucchini damage in post-harvest stages. Int. J. Agr. Biol. Eng. 2017; 10, 126-33.

AS Prabuwono, W Usino, L Yazdi, AH Basori, A Bramantoro, I Syamsuddin, A Yunianta and KHS Allehaibi. Automated visual inspection for bottle caps using fuzzy logic. TEM J. 2019; 8, 107-12.

ANJ Raj, R Sundaram, VGV Mahesh, Z Zhuang and A Simeone. A multi-sensor system for silkworm cocoon gender classification via image processing and support vector machine. Sensors 2019; 19, 2656.

DT Lin, MC Lin and KY Huang. Real-time automatic recognition of omnidirectional multiple barcodes and DSP implementation. Mach. Vis. Appl. 2011; 22, 409-19.

L Liu, Z Li, Y Lan, Y Shi, Y Cui. Design of a tomato classifier based on machine vision. PLoS One 2019; 14, e0219803.

YH Cheng, PJ Chao, HY Liang and CN Kuo. Smart home environment management using programmable logic controller. Eng. Lett. 2020; 28,1174-81.

PP Horváth, TI Erdei and G Husi. Restoration and PLC control of a material handling MP-9S industrial manipulator platform. Ann. Univ. Oradea Facsicle Manag. Technol. Eng. 2019; 29,1-5.

M Gao. Application analysis of PLC technology in automatic control of ship auxiliary machinery. J. Coast. Res. 2020; 115, 130-2.




How to Cite

SINGHATA, N. . (2021). The 2D Barcodes Identify the Workpieces by using Microcontroller Interface between Image Processing and PLC Machine. Walailak Journal of Science and Technology (WJST), 18(18), Article 9539 (13 pages).