Các lỗi trong hệ thống điện năng lượng mặt trời (PV) ảnh hưởng rất tiêu cực lênnăng suất và vận hành. Để hạn chế hậu quả này, việc phát hiện và phân tích nhữnglỗi trong hệ thống PV cần được phát triển nhanh chóng và hiệu quả để kịp thời sửachữa. Trong bài báo này, một mô hình phát hiện và phân loại lỗi được xây dựng vàphát triển. Những lỗi như hở mạch, ngắn mạch và bóng che một phần ở trong hệthống sẽ được phát hiện và phân loại bằng giải thuật K hàng xóm gần nhất (kNN).Dựa vào mô phỏng MATLAB/Simulink, dữ liệu của ba loại lỗi được thu thập và phânloại với tỷ lệ 75% cho tập huấn luyện và 25% cho tập kiểm tra. Tập dữ liệu được xâydựng với điều kiện nhiễu như trong thực tế và quy trình thu thập được tự động hóa.Sai số tuyệt đối được giới hạn trong phạm vi 0,5% và 5%. Theo quan sát, kết quả từmô hình đề xuất cho độ chính xác cao đến 99,84%.Faults in photovoltaic systems (PV) have critical damage to the operationand be the main reason for power loss. To avoid these consequences, thedetection and analysis of PV systems faults must be enhanced effectively andpromptly. In this paper, a fault detection and classification model is developedand improved. Faults such as open-circuit (OC), line-to-line (L-L), and partialshading of the systems are detected and classified in K-nearest neighbor (kNN).Based on the simulation performed in MATLAB/Simulink, the dataset of thethree errors is collected and split at the rate of 75% for the training and 25% forthe testing. The dataset is built with noise conditions as in practice, and thecollecting progress is automated. The absolute error is confined to the range of0.5% and 5%. It is observed that the result from the proposed model gives highaccuracy of 99.8%.