From previous years, the research on usage of renewable energy sources (RES), specially photo voltaic (PV) arrays. This paper is based on home energy management system (HEMS). We propose a grid connected microgrid to fulfill the load demand of residential area. We have consider fifteen homes with six appliance for each home, the appliances are taken as the base load. For bill calculation, real time pricing (RTP) tariff is used. Ant colony optimization (ACO) is used for the scheduling of appliances. To fulfill the load demand; Wind turbine (WT), PV, micro turbine (MT), fuel cell (FC) and diesel generator (DG) are used. Energy storage devices are used with generators to store excessive energy. Also, we propose penalty and incentive (PI) mechanism to reduce the overall cost. Objectives of the paper are cost and peak to average ratio (PAR). The simulation results show better performance with our optimization technique rather than without any technique.