In this paper a fault diagnosis method for photovoltaic (PV) modules is developed using an open source Machine Learning (ML) platform (Edge impulse). The idea is to develop a TinyML to classify certain defects that can frequently occur on PV modules (e.g. dirty, degradation and dust deposit on PV modules), and then to integrate the impulse into an Edge device for real time application. In this regard a database of infrared thermography image was built and used. The model could be run locally without internet connection. This method could help users to diagnosis their PV modules and make decision about the maintenance schedule (cleaning or replacing of PV modules). Results clearly report the feasibility of the method with a mean accuracy of 93.4 %. The main advantage is that, thanks to this platform, embedded ML model could be developed quickly. Moreover, edge processes are not affected by the latency and bandwidth issues becoming outstanding methods for real-time diagnostics.