The application of social artificial intelligence (AI) techniques appears to be creating a real viable solution that will improve over the management and operation of micro microgrids in potential future smart grid networks. The primary goal of the suggested system is to regulate renewable energy during fluctuations to provide a steady supply of electricity, so here we continuously monitor solar panel power generation and load usage, and send these values to a machine learning model to categorize the switching status of the regulator circuit. In the proposed system, the solar panel absorbs the solar energy at the sun's peak hours. When the voltage readings are above a certain fixed value, the voltage is supplied to the load. In case the voltage from the solar panel is less than the fixed value, it's not enough to be supplied to the load. This is where the involvement of Machine Learning plays a major role. The shortage of power will be detected by machine learning. Then the voltage for the load will be provided from the SMPS. The KNN algorithm has a set of pre-defined set of data which is gathered from testing, which will be referred for providing voltage for the load.