Conventional distribution systems generally operate with voltage and current waveforms being sinusoidal, though they slightly deviate from the ideal sinusoidal waveform, which is measured as distortion. The increase in power demand has led to the local generation and storage of power (Micro Grid systems). For its adoption, we need to implement smart grid architecture. Power electronics is a technologically sound way to limit different kinds of power quality (PQ) disturbances. It can also be used to control power flow, boost energy transmission capacity, enhance dynamic behavior and voltage stability, and ensure better power quality at distribution within established bounds. Unified Power Quality Conditioners (UPQC), one of the well-known Flexible AC Transmission System (FACTS) devices, are typically used to address problems in distribution systems such as voltage surges, flickers, neutral current reduction, and PQ. Additionally, thermal management is crucial for maintaining system stability and preventing overheating. While dealing with sensitive loads, a UPQC injects harmonics into the system, which can compromise system stability. This article describes an artificial neural network with harmonics elimination techniques for a modified UPQC connected with a Smart Grid. The performance of the proposed system is evaluated using MATLAB/Simulink software.