Battery internal faults are one of the major factors causing safety concern, performance degradation, and cost increases. To extend the lifetime of the battery and bring more security in the system, internal fault detection of solar battery is proposed in this paper using an unsupervised machine learning algorithm based on anomaly detection method. The advantages of adopting such a method consist of using unlabeled data that meet the battery case in the difficulty of obtaining the fault data. In contrast, healthy data can easily be obtained from the battery and therefore allows building the anomaly detection algorithm. The effectiveness of the proposed method is validated using a simulation platform of a stand-alone photovoltaic system developed in Matlab/Simulink that takes as system input a real profile of irradiance and temperature captured from the Centre de Development des Energies renewable (CDER), Algeria. The test results in real-time data show the ability of the proposed approach to detect the fault occurrence in the battery.