The problem of Power Quality analysis is becoming crucial to ensuring the proper functioning of complex systems and big plants. In this regard, it is essential to rapidly detect anomalies in voltage and current signals to ensure a prompt response and maximize the system's availability with the minimum maintenance cost. In this paper, anomaly detection algorithms based on machine learning, such as One Class Support Vector Machine (OCSVM), Isolation Forest (IF), and Angle-Based Outlier Detection (ABOD), are used as a first tool for rapid and effective clustering of the measured voltage and current signals directly on-line on the sensing unit. If the proposed anomaly detection algorithm detects an anomaly, further investigations using suitable classification algorithms are required. The main advantage of the proposed solution is the ability to rapidly and efficiently detect different types of anomalies with low computational complexity, allowing the implementation of the algorithm directly on the sensor node used for signal acquisition. A suitable experimental platform has been established to evaluate the advantages of the proposed method. All the different models were tested using a consistent set of hyperparameters and an output dataset generated from the principal component analysis technique. The best results achieved included models reaching 100% recall and a 92% F1 score.