<span lang="EN-US">This research study aims to develop automatic optical inspection (AOI) for detecting keycaps misplacement on the keyboard. The AOI hardware has been designed using an industrial camera with an additional mechanical jig and lighting system. Optical character recognition (OCR) using the Tesseract OCR engine is the proposed method to detect keycaps misplacement. In addition, captured images were cropped using a predefined region of interest (ROI) during the setup. Subsequently, the cropped ROIs were processed to acquire binary images. Furthermore, Tesseract processed these binary images to recognize the text on the keycaps. Keycaps misplacement could be identified by comparing the predicted text with the actual text on the golden sample. Experiments on 25 defects and 25 non-defected samples provided a classification accuracy of 97.34%, a precision of 100%, and a recall of 90.70%. Meanwhile, the character error rate (CER) obtained from the test on a total of 57 characters provided a performance of 10.53%. This outcome has implications for developing AOI for various keyboard products. In addition, the precision level of 100% signifies that the proposed method always offers correct results in detecting product defects. Such outcomes are critical in industrial applications to prevent defective products from circulating in the market.</span>