IoT Based Smart Energy Management System using Pzem-004t Sensor & Node MCU

Download Full-Text PDF Cite this Publication

Text Only Version

IoT Based Smart Energy Management System using Pzem-004t Sensor & Node MCU

Gopika B

M.Tech, CSE Dept.

Mangalam College of Engineering Ettumannoor, Kottayam, India

Dr. Sabu George

Asso. Prof., CSE Dept.

Mangalam College of Engineering Ettumannoor, Kottayam, India

AbstractEnergy demand is increasing day-to-day according to the increase in population and industrial expansion. There exists a lack of technical knowledge in the case of monitoring and controlling energy consumptions. Conventional energy meters which we use to measure energy consumption in are households are offline devices. Readings are taken manually from such devices. Smart energy meter can overcome such situations. The proposed system using IoT helps people to take the readings from anywhere in the world. Along with energy consumption it will also give details of parameters such as voltage, current, power and frequency. Thus we can attain perfect load management. PIR (Passive Infrared) sensor in deployed in every room for attaining load management. This system will help the users to choose their own tariff on the basis of their income. PZEM-004T sensor is used to measure the parameters and Node MCU will post this collected data to server. User can control the system by using mobile application and web application.

Keywords- IoT, PZEM-004T, Node MCU, Relay, PIR sensor, Firebase


    Electricity has become one of the basic requirements of humans. It is used in domestic, industrial, and agricultural purposes. Existing system is a time consuming system. IoT based smart energy meters can overcome the existing problems like reducing man power, energy monitoring, load management, power theft etc. Smart meters are same as normal meters. It is an advanced technology for reading, billing, and controlling the energy consumption. Smart meters are referred as smart because it includes a two way communication system. It monitors the system very quickly and provides real time data to the user. They also collect power outages from loads and communicates this information to the user. The main advantage of smart meter is that we dont require many components to take readings as smart meter sensor itself will give different parameter readings. It takes the reading and sends the detailed information to the user remotely. Smart meter allow switching on/off loads remotely with the help of iot.

    In this paper, user monitors the electrical energy and controls the loads in our home using PIR sensor, relay, NodeMCU and pzem-004t sensor module. The objective of our proposed system is to monitor the energy consumption and manage them accordingly so that the user can overcome high bill amount. Pzem-004t module can measure voltage, current, power, power factor, energy consumption and frequency. The collected data gets send to server by NodeMCU. PIR sensor is used to detect human presence in a

    room. NodeMCU decide power supply to the room in accordance with the readings collected by PIR sensor and relay will controls it.

    Data from the NodeMCU can be monitored by the web in real time basis. User can also control relay manually with the help of web/android application.


    In 2017, C. Choi, et al. proposes an effective energy monitoring system based on IoT. It will forecast users, energy demands. It mainly focuses on LoRa technology, renewable energy generations etc. But its main drawback is, it does not discuss how the data is taken and how power is calculated.

    Hiremath et al. in 2017 made his research on IoT-based energy control and managing devices. They designed and implemented an energy meter which uses Arduino as its microcontroller. This system is used to measure the power consumed by electrical devices. Power consumption is monitored and is send to the server via Wi-Fi module. Web- based application is used so that the user can monitor the consumption anywhere in the world. The researcher mainly focuses only on the tools used in the experiment. Measurement data and their details are not discussed in it.

    Other scholars like Medina et al. in 2018 conducted a study on IoT-based electrical energy consumption using Raspberry pi. This study was made in order to know how energy consumption can be controlled and monitored. An android application was used for displaying the data obtained. According to their studies analog input from the current sensor is connected to Arduino and is controlled by Raspberry pi. This data is then processed and stored in the database. Based on their results some systems are having high accuracy while some other devices are having low accuracy.

    In 2019, Prasetyo et al. researched Smart Home for monitoring and control of electrical energy. The research was taken place in Indonesia. The research aims to conduct the effectiveness of electricity usage by monitoring and controlling power using cloud-based IoT. The Smart Home design was built using several devices such as an Arduino microcontroller, Internet module, AC Voltmeter, Relay, LDR Sensor, and PIR Motion Sensor. The output of the research is still in the form of design, not yet at the stage of developing and implementing the tool.


    Fig 1: Proposed System, wiring diagram

    We are living in a world where everything depends on Electricity. Simply we can say that electricity governs the world. Therefore power consumption has becomes an essential criteria for every filed. From the above literature surveys we can found that every researchers aims in developing new technologies for automating the household items, machineries, for finding power theft, for controlling the voltages etc., using smart meter, sensors, microcontrollers, along with Internet of Things. None of them concentrated on the huge cost of energy which we are paying. Sometimes we wonder by seeing the electricity bill as it may exceeds our monthly budget. Efficient monitoring and controlling system is the only method to overcome this situation. The proposed system is one such method. Here we are controlling the loads according to our monthly tariff chosen with the help of sensors and relay. User can choose their own tariff in accordance with their monthly budget. If they need any extra power, then the user itself can edit their tariff. In such a way energy gets consumed by controlling unnecessary loads automatically and save money.

    Simply we can say that the proposed system is to create a user friendly system inorder to monitor energy usage in real time. Data is collected by some electronic devices and is transmitted to the server using NodeMCU.

    The main components required for the system are as follows:

    1. PZEM 004t multifunctional meter

    2. Node MCU

    3. Relay

    4. Display

    5. SMPS

    6. PIR sensor


    1. Pzem 004t

      Fig 2: PZEM 004T, (source: PZEM-004T V3.0 User Manual)

      PZEM 004T multifunction AC power monitor is a very popular smart meter used in electrical consumption measurement projects. It is great for measuring voltage, current, power, and energy. It comes with serial TTL interface. It has overload detection function. The main part of PZEM 004T module is of SD3004 chip.

    2. Node Mcu

      Fig 3: NodeMCU

      Arduino doesnt have built-in support to wireless network. Therefore developers need to add a wifi module to the board and write code to access the wireless network. Node MCU is a microcontroller which has built-in support for wifi connectivity and hence makes IoT applications developments much easier. Itis an open-source software and hardware development environment which is built-in an inexpensive chip ESP8266. It provides low-level control for the specific hardware. Node MCU can be programmed using Arduino IDE.

    3. Relay

      Fig 4: 2 Channel 5 volt Relay,

      Relay module consist of VCC, Gnd, and control inputs. The relay module was powered by 5V DC. This module was used and attached to the microcontroller so that the electrical connections can be turned on or off by the user.

    4. Display

      Fig 5: 16*2 LCD Display,

      (source:×2- Module-Arduino/dp/B07GC15X91)

      This is a 16*2 LCD display screen. It have i2c communication interface. It only needs 4 pins for the display; VCC, GND, SDA, SCL.

    5. SMPS

      Fig 6: SMPS

      SMPS stands for switch mode power supply. It is mainly used to achieve regulated DC output voltage from unregulated AC voltage. It provides supply from source to loads. It is very important for power consumption. They are efficient than liner regulators. Power loss will be much less than transformer based power supplies. In our project we had used 5Volt 1Ampere power supply.

    6. PIR Sensor

    Fig 7: PIR sensor

    PIR sensor helps user in sensing motion. This sensor is commonly used to detect whether a person moves in or out of the sensor range. PIR sensor is small in size, inexpensive and easy to use. It is able to detect different levels of infrared radiation. Once there is infrared radiation from the human body particle with temperature, focusing on the optical system causes the pyroelectric device to generate a sudden electrical signal.


    Usually 230V will pass through the ELCB and gets divided by MCB. In the proposed system energy from ELCB is passed to MCB and from MCB it is passed to the load through relay. Here we use 2 PIR sensors for detecting human presence in the room. Real-time data from Pzem-004T will pass to NodeMCU. The extracted data can be viewed through the serial port and lcd display. Normally we used closed relays in our system. Data from NodeMCU is pushed to server using HTTP protocol.

    In our project we are using firebase as our desired server. We can control and configure relay through firebase easily. User can view the real time data through the web/android application from anywhere in the world. Thus they can monitor and control loads more efficiently thereby reducing the bill amount.

    Web development is done by python djanjo framework. MIT app inventor is a third party application which acts as user interface between mobile and control equipment. It is an open-source application building platform. Application behaviour will be provided by piecing blocks together in a visual blocks based programming language

    Fig 8: Mobile Application


    Our proposed system is having an architecture based on PZEM004T energy meter. NodeMCU, PIR sensor, firebase server etc. The PZEM004T sensor and microcontroller is placed near the MCB of our building. It is connected to the firebase server via WiFi. We can calculate the accuracy of our system by comparing the readings of the electrical parameters such as voltage, current and frequency. Power factor values may get varied according to the load connected. The readings are acceptable and consisted which means our system is accurate.

    PZEM004T sensor is used to read data and is stored in NodeMCU microcontroller. From NodeMCU data gets passed to the firebase server at every 10seconds. Performance of the proposed system is based on its processing time which includes reading, storing and data transfer. Lower the difference, higher the performance. The system will help us to find whether any voltage fluctuation is there, what will be the peak time in using more energy etc. In such a way we can analyze the minimum and maximum distribution of voltage during a particular day. Wi-Fi module delivers highly integrated WI-FI solution to meet users for continuous demand of efficient power usage.

    Fig 8: Real-time energy data visualization

    In the above mentioned graph, left axis indicates the values of voltage, current and the power while the right axis indicates the power factor coloured curve indicates the product of both current (ocean blue) and voltage (sky blue). Orange colour represents the value of power factor.


Existing systems only concentrate on controlling energy theft, home automations, reducing man power, automatic meter reading using different technologies etc. Our proposed system is to conserve energy thereby reducing the bill amount by proper load management and by determining our own tariff. We can determine the slab in accordance with our budget and the amount of energy required.


  1. Ravi Kishore Kodali, Archana Sahu,: "An IoT based weather information prototype using WeMos", 2nd International Conference, Contemporary Computing and Informatics (IC3I), Noida, India, IEEE, pp. 612 – 616, 2016.

  2. G. Wibisono and N. Badruzzaman, Strategy of smart meter infrastructure implementation using LPWAN technology, pilot project PLN Bali Case Study, MATEC Web of Conferences 218, 03013, ICIEE, 2018.

  3. PZEM-004T V3.0 User Manual

  4. C. C. Medina, J. M. U. Pamplona, and A. P. Uy, Monitoring And Control of Electricity Consumption Using Raspberry Pi Through IoT, LPULaguna J. Eng. Comput. Stud., vol. 4, no. 1, pp. 5066, 2018.

  5. N. A. Prasetyo, A. G. Prabawati, and Suyoto, Smart home: Power electric monitoring and control in Indonesia, Int. J. Interact. Mob.

    Technol., vol. 13, no. 3, pp. 143151, 2019

  6. S. David, P. Akshara, S. Dixit, and S. Purnimaa, Decrease of power consumption utilizing IoT, Int. J. Innov. Technol. Explore. Eng., vol. 9, no. 1, pp. 53165319, 2019.

  7. V. Firmansyah, V. Nadhira, L. Silvi, and T. A. Dewi, IoT Sistem Monitoring Meter kWh Digital Menggunakan Sensor LDR dan CodeIgniter API Service, J. Mater. dan Energi Indones., vol. 09, no. 01, pp. 1825, 2019.

  8. Ida Bagus Gede Purwania, I Nyoman Satya Kumara, and Made Sudarma, Application of IoT-Based System for Monitoring Energy Consumption, International Journal of Engineering and Emerging Technology, Vol.5, No.2, December 2020

  9. Amazon Web Services: AWS IoT Documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *