This paper proposes an improved PSO (IPSO) algorithm for home energy management system (HEMS), which integrates demand response (DR) in a smart grid. Based on the time of use (TOU), the critical peak pricing (CPP), as well as the DR signals from the utility, the proposed IPSO algorithm minimizes the electricity payment by scheduling the home appliances, while satisfying the constraints set by the users. In order to find better solution, the IPSO adopts new strategies regarding initialization, chaotic inertial weight approach (CIWA), simplex crossover operation, subswarms, repair algorithm, as well as penalty factor in the evolutionary process. To verify the proposed algorithm, simulations are carried out on different kinds of households in a micro-grid, containing some important appliances, EVs, energy storage batteries, photovoltaic (PV) and wind-turbine generations. The simulation results show that the proposed algorithm achieves less electricity payments for the users, while reducing the peak demand of the distribution transformer, with minimal impacts on the users' life. As compared with the existing algorithm, the proposed algorithm is also shown to be able to find better solution for the same number of functions evaluated.