The paper discusses the development of a PI controller for voltage regulation in islanded microgrids, where maintaining voltage and frequency is crucial after disconnection from the main grid. Simulation results demonstrated the controller's effectiveness in stabilizing voltage and frequency, ensuring reliable power supply from distributed generators under various load conditions. The proposed approach outperforms traditional methods by minimizing voltage fluctuations and maintaining load voltage ratings after grid disturbances.