In recent decades, appearance of micro grid and prodigious achievement of smart grid comparing with conventional power plants has been offered. In this paper a smart grid that consists of diesel engine generator, electrolyzer, ultra capacitor and solar cell, is offered and with some load disturbances and switching off in diesel generator is analyzed. The proposed smart grid has two produced energy; electrical energy and hydrogen gaseous. Using PI controllers as concrete controllers is suggested for frequency control. The implementations of frequency control in suggested smart grid are both a function that is called frequency deviation function and proportional and integral gains in controller.