Previous post we have been talking about Digital Power Meter (DPM) and how to set it during startup. We need to set few things including CT ratio, Electrical Network, Voltage & Current input Selection etc. In this post, we will bring Digital Power Meter to further and more useful approach. We will be taking the reading from DPM to NodeMCU or Arduino micro-controller board for further processing such as adding relay or alarm protection features or display for online & remote monitoring or even can do remote control once data has been taken to Arduino board. As you know, DPM is just a commercial measuring and display unit. However, it has the ability for us to take out the measurement values for further processing through Modbus RTU RS485 to SCADA or any open source micro-controller.
Warning ! You are now dealing with high power source ! We assumed that you have the basic electrical knowledge and know what you are dealing with. You may need guidance from experienced guys if you are new to electrical work. Safety and Precaution must be always have in mind. We shall not be responsible for anything happening to you.
Multi-purpose 3 Phase Digital Power Meter
Digital Power Meter is a professional monitoring device used to display many important Electrical parameters such as Voltage, Current, Power, Energy, and Power Factor. It supports 3 phase and can measure high voltage and current subject to the applied Current and Voltage Transformers. Grab one at our Aliexpress affiliate link here !!!
In this example, we will be using a DPM model : YG889E-3SY from YiGe Electric. It is a economical DPM and widely available in the market. We will be using NodeMCU to collect readings from the DPM and do Real Time Monitoring and display on phone using Blynk App so that we can monitor remotely anywhere in the world as long as there is internet available. Once you understand how the Modbus code works, you can get the more expensive DPM of your choice.
5A Split-Core Transformers
In order to measure current larger than 5A, a Current Transformer (CT) is needed to be installed per phase. The CTs will step down high measurement current into 5A maximum current to the DPM. Make sure to choose the CT with standard 5A output as typical DPM only could support up to 5A. For example if you want to measure current up to 200A, get CT rating of 200/5A. You can get them at our affiliate link here !!!
Advantages of a DPM compared to any other energy monitoring Device.
- DPM is a professional and commercially electrical measuring device to measure and monitor many useful AC electrical parameters. They are normally installed in electrical panel thus it has high accuracy.
- DPM can measure 3 phase AC electrical system. We can have electrical parameters for each phase.
- DPM support RS485 Modbus RTU communication protocol which we can collect data from it.
- It is not plug and play device and may need to do some wiring and setting upon startup.
- It is more expensive and CTs, wires and Fuses for protection are sold separately.
- Need additional devices to collect its data and some programming knowledge is needed when RS485 communication is involved.
Fuse with Isolator
Fuse is important to protect a circuit from Overload Current and Short Circuit Current. This is a din rail type of Fuse with removable cartridge for easy fuse replacement. Grab yours at our affiliate link here !!!
Items required :
- Digital Power Meter from YiGe Electric (Model : YG889E-3SY) x 1
- NodeMCU micro-controller x 1
- NodeMCU Base Board x 1
- RS485 to TTL converter Module x 1
- 1A Fuse with holder x 3 (for 3 phase)
- xx/5A Split Core CT x 3 (for 3 phase)
- 12V Power Supply – for NodeMCU Base Board. x 1
- 0.5-0.75mm2 Single Core Copper Wire
- Dupont Wires Female to Female & Female to Male
The NodeMCU micro-controller is similar to Arduino micro-controller board. It is compatible with Arduino IDE software and is built-in with the ESP8266 module which can be connected to the internet. You can grab some at our affiliate link here !!!
Node MCU Micro controller Base
The based below the Node MCU can provide more flexibility on the connection ports to support more sensors. Besides, it also has 12V input port and able to provide 5V power supply to support the sensors. Support us by purchase it from our affiliate link here !!!
Since DPM uses RS485 communication, we need a converter module that can convert RS485 to Serial communication in order to communicate with Node MCU board. We need a UART TTL to RS485 converter module. Generally there are 2 types of RS485 converter module 1) only 2 communication output pins named Tx and Rx and 2) 4 communication output pins named DI, DE, RE and RO). In this example we are using the 4 pins module (Type 2).
MAX485 UART TTL RS485 converter
This is a module that converts between RS485 communication and Serial (UART TTL) communication. This module enables Arduino to communicate, read or provide command to devices that using RS485 communication. Quickly grab this module at our affiliate link here !!!
Dupont line Wires
In order to connect wiring between Arduino board and module fast and easy, you need the dupont line cables. These cables are suitable during testing and troubleshoot where a lot of wire modifications. You can get it at our affiliate link here !!!
You may dealing with High Power Source, any exposed conductors need to be isolated and fused. Turn the measurement power source OFF during hardware connection. I recommend to use ferrule lug for terminal tight connection and prevent stranded conductor accidentally touching adjacent cable line which might cause short circuit and fire risk. Furthermore, no conductive materials are placed around the workplace and use non-metallic enclosure or project box.
Power Connection Diagram
RS485 Connection Diagram
Wiring of Serial to RS485 Converter Summary :
- A to A terminal of DPM
- B to B terminal of DPM
- Vcc to 5V positive
- Gnd to 5V ground
- RO to D2 Pin of Node MCU
- DI to D3 Pin of Node MCU
- RE to D1 Pin of Node MCU
- DE to D0 Pin of Node MCU
Blynk App – The Online Data Monitoring Platform
Blynk is a user friendly platform that provide web interface for data display. It provide smart phone app for easy setup and monitoring. In the app, there are a lot of Widget Boxes which suits a lot of measurement data. However, if you want to use the Widgets, it will consume energies based on the Widget types, similar to online games that you may need to top up the energy when you require more widgets. Upon creating an account, there will be some energy which should be enough for small project.
Ferrule Lugs and Crimper Set
Ferrule lugs are used at terminals for tight and secure connection. Besides, it also prevent stranded cables accidentally touching adjacent power line that may cause short circuit. Grab 1 at our affiliate link here !!!
Software Step by Step Guideline
The software part will be divided into 2 parts: 1) the smart phone web interface Blynk App and the 2) programming part using Arduino IDE Software.
- Download Blynk App on your smart phone (Google Play / AppStore).
- Open and create an Account on Blynk App.
- Add New Project (see below section)
- Blynk will send a Auth Token to your email specifically for this project.
- At your project main page, swap to the right to open Widget Box.
- Add Widget based on your desire:
Widget settings :
- Virtual pin V0 = AC Voltage (phase 1)
- Virtual pin V1 = AC Voltage (phase 2)
- Virtual pin V2 = AC Voltage (phase 3)
- Virtual pin V3 = AC Current (phase 1)
- Virtual pin V4 = AC Current (phase 2)
- Virtual pin V5 = AC Current (phase 3)
- Virtual pin V6 = AC Average Current
- Virtual pin V7 = Real Power (W) (phase 1)
- Virtual pin V8 = Real Power (W) (phase 2)
- Virtual pin V9 = Real Power (W) (phase 3)
- Virtual pin V10 = Total / Net Real Power (W)
- Virtual pin V11 = Reactive Power (Var) (phase 1)
- Virtual pin V12 = Reactive Power (Var) (phase 2)
- Virtual pin V13 = Reactive Power (Var) (phase 3)
- Virtual pin V14 = Total / Net Real Power (Var)
- Virtual pin V15 = Apparent Power (VA) (phase 1)
- Virtual pin V16 = Apparent Power (VA) (phase 2)
- Virtual pin V17 = Apparent Power (VA) (phase 3)
- Virtual pin V18 = Total / Net Apparent Power (VA)
- Virtual pin V19 = Power Factor (Pf) (phase 1)
- Virtual pin V20 = Power Factor (Pf) (phase 2)
- Virtual pin V21 = Power Factor (Pf) (phase 3)
- Virtual pin V22 = Average Power Factor (Pf)
- Virtual pin V23 = Frequency (Hz)
- Virtual pin V24 = Positive Real Energy (kWh)
- Virtual pin V25 = Negative Real Energy (-kWh)
- Virtual pin V26 = Positive Reactive Energy (kVarh)
- Virtual pin V27 = Negative Reactive Energy (-kVarh)
On Laptop / PC
- Install Arduino IDE Programming Software (If you do not have the software, click here to download)
- Install Node MCU Board Manager for using Node MCU in Arduino IDE Programming Software (see below section)
- Install Node MCU ESP8266 Library for using Wifi codes in Node MCU (see below section)
- Install Modified Modbus Library for using Modbus communication codes in Node MCU (see below section)
- Install ESPSoftwareSerial Library to convert Digital Pins to Serial virtual ports so that we can have additional Serial Port to communicate with the Module.
- Install Blynk Library for enable the Node MCU using Blynk server (see below section)
- Copy Auth Token from the email, note down the Wifi name & password.
- Upload the code to Node MCU Board.
Install Node MCU Board Manager
If this is the first time you are dealing with NodeMCU, you need to add NodeMCU board manager file into the IDE software so that the software can support the Node MCU board. To add the Support File, open Arduino IDE Software, go to files>preferences>Additional Boards Manager URLs, paste this link http://arduino.esp8266.com/stable/package_esp8266com_index.json to the black space and click OK. Go to Tool > Board > make sure the board is showing NodeMCU 1.0 (ESP-12E module).
Terminals Crimping Plier Set
This is a crimping tool with interchangeable jaw for crimping many types of terminals. It is a must have for DIY electronic and electrical for professional installation work. You may choose at out affiliate link here !!!
Install ESP8266 Wifi Library
If this is the first time you are dealing with Wifi programming, this ESP8266 Wifi Library file is needed to be installed to the Arduino IDE Software so that it can understand the programming function. Go to Tools > Boards > Boards Manager and download the ESP8266 library by ESP8266 Community
Install Modified Modbus Master Library
If this is the first time you are dealing with modbus communication, this Modified Modbus Master Library file is needed to be installed to the Arduino IDE Software so that it can understand the programming function. If you have installed the original ModbusMaster.h library from library management, kindly look into the folder and delete it or it will clash with this library.
The Modified Modbus Master Library I get it from EvertDekker.com and I have uploaded the zip file here so that you can download and install it. Go to Sketch > Include Library > Add.ZIP Library…. and locate the zip file. Make sure you download it to your PC first (preferably download at desktop)
Relay Switches Module
Relay is often important to enable micro-controller to control larger loads. More relay switches are used especially for smart home remote controlling. You may get one of those at our affiliate link here !!!
Install ESP Software Serial Library
If this is the first time you use the Software Serial to add Serial Port, you may need to install and download the ESPSoftwareSerial Library in the manage library section. This Library is different with the standard Software Serial, so be sure to install the correct library. Go to Tools > Manage Libraries … and type “ESPSoftwareSerial”. Download from Peter Lerup.
Install Blynk Library
If this is the first time you are dealing with Blynk server, this Blynk Library file is needed to be installed to the Arduino IDE Software so that it can understand the programming function. Go to Tools > Boards > Boards Manager and download the Blynk library by Volodymyr Shymanskyy
The smart phone Blynk app and Arduino IDE software are two independent parties. As long as you do it right, the Node MCU board should be able to send toe data to the Blynk server so that you can see the values from your smart phone. One of the advantage of using Blynk is that the Blynk server can allow for data storage so that you can trace the previous record. All the hard part have been done, all you need is just following the instruction and it should work well. You can customize your web interface at Blynk App. Below is one of the example how it would look like.
Note : My house electrical network only single phase, so only 1 phase values are activated.
Note : This blog page only shows you an example how to collect data from DPM throught RS485 communication protocol. If there is already value error from DPM, the values collected will also be same value as of DPM display. You may modify the reading after collected from DPM. Right click the .ino file and “Save link as…..”
Before we end, we would like to give gratitude to you for taking the time to read the post. We would need readers like you to support us in order to keep growing. You can support us in the following ways :
Donate & Fund Raising
If you like my work, please send me a donation to encourage me to do more. Thanks
We are the member of Aliexpress affiliate marketing. Do support us by clicking the affiliate product links if you do wish to purchase them.
Like and Share
If you like our post, we need your support to like and share our posts or videos so that it can reach more and more people like you !!