Consumer electronic devices such as smartphones, TV sets, etc. are designed around printed circuit boards (PCBs) with a large number of surface mounted components. The pick and place machine soldering these components on the PCB may pick the wrong component, may solder the component in the wrong position or fail to solder it at all. Therefore, Automated Optical Inspection (AOI) is essential to detect the above defects even prior to electric tests by comparing populated PCBs with the schematics. In this context, we leverage YOLO, a deep convolutional architecture designed for one-shot object detection, for AOI of PCBs. This architecture enables real-time processing of large images and can be trained end-to-end. In this work we also exploit a modified architecture of YOLOv5 designed to detect small components of which boards are often highly populated. Moreover, we proposed a strategy to transfer weights from the original pre-trained model to this improved one. We report here our experimental setup and some performance measures. © The Author(s), under exclusive license to Springer Nature Switzerland AG 2024.