The development of advanced metering infrastructure (AMI) in smart grid (SG) had enabled consumers to participate in demand-side management (DSM) using the price-based demand response (DR) programs offered by the distribution companies (DISCO). This way, not only the consumers minimize their electricity bills and discomfort, but also the DISCOs can handle peak power demand and reduce the carbon (CO 2 ) emissions in a controlled manner. Building an optimization framework that will minimize cost, peak demand, waiting time, and CO 2 emission is not only a challenging task but also a concern of DSM. Most analyses are based on cost and peak-to-average ratio (PAR) minimization, but the effectiveness of the DSM framework is equally determined by user comfort and CO 2 emission. Considering only one objective (cost) or two objectives (cost and PAR) is not sufficient. Thus, for DSM framework to achieve these four relatively independent objectives at the same time, minimized cost, PAR, CO 2 emission, and user discomfort, an energy management controller (EMC) based on our proposed algorithm hybrid bacterial foraging and particle swarm optimization (HBFPSO) is employed that return optimal power usage schedule for consumers. A novel DSM framework consists of four units: (i) DISCO, (ii) multi-layer perceptron (MLP) based forecast engine, (iii) AMI, and (iv) demand-side energy management modules is successfully developed in this work. To validate the proposed model, extensive simulations are conducted and results are compared with the benchmark models like genetic algorithm (GA), bacterial foraging optimization algorithm (BFOA), binary particle swarm optimization (BPSO), and a hybrid combination of genetic and binary particle swarm optimization (GBPSO) in terms of electricity cost, PAR, user comfort, and CO 2 emissions. The simulation results demonstrate effectiveness of our proposed model to outperform all the benchmark models in optimizing the consumer and DISCO objectives. The proposed scheme has reduced electricity cost, user discomfort, PAR, and CO 2 emission for the residential sector by 15.14%, 4.6%, 61.6%, and 52.86% in scenario 1, 62.60%, 4.56%, 60.77%, and 27.77% in scenario 2, and 26.03%, 4.54%, 63.78%, and 23.02% in scenario 3, as compared to without an EMC. Similarly, for commercial sector the proposed HBFPSO algorithm reduces electricity cost, user discomfort, PAR, and CO 2 emission by 11.31%, 5.5%, 60.9%, and 38.18% in scenario 1, 64.9%, 5.56%, 44.08%, and 58.8% in scenario 2, 15.31%, 5.26%, 78.22%, and 15.58% in scenario 3. Likewise, the proposed algorithm also has superior performance for the industrial sector for all the three scenarios.INDEX TERMS Smart grids, advanced metering infrastructure, demand side management, energy management controller, price-based demand response program, heuristic algorithms, multi-layer perceptron, forecasting, carbon reduction.The associate editor coordinating the review of this manuscript and approving it for publication was Arash Asrari .