In this opportunity we will integrate our active power meter or power consumption, Peacefair Pzem-004 with the IoT Ubidots platform using an ESP8266 module, later we will create a dashboard to visualize the 4 available variables such as active power, accumulated electrical consumption, voltage and current .
I present the latest update of Arduino IDE libraries for ESP8266 and the Ubidots IoT Platform, this version 3.0.0 presents improvements, such as TLS 2.0 and more functionality in its API constructors and functions.
Ubidots for Education
Previous Tutorials Recommended
Tutorial Platform IoT Ubidots & ESP8266 + Sensor DHT11
Electricity consumption meter Peacefair PZEM 004 + ESP8266 & Arduino Nano
If you want to know more about Peacefair’s Pzem-004 meter, I recommend the following tutorial:
An extension with a multi-outlet has been manufactured and in one of its wires the CT “CurrentTransformer” has been placed, although technically the measurement of one of the led lamps is made, and the heating resistance which presents the consumption more significant.
Important Note: Do not connect these resistors without being submerged in water, the resistance could burn instantly.
Materials and where to buy them very cheap !!
- Meter PZEM 004 with display
- Meter PZEM 004T & Three phase meters
- Immersion heater / Resistance Water heater
- ESP8266 NodeMCU
Other Recommended Equipment
- Transformer core splitter
- Monophasic Electric Consumption Meters – Per Pulse
- Voltage transformers for insulation
- MPPT Controller Regulator for solar panel
- Solar Panels 10W 18v
- Matrix Led x4 Max7219
- Arduino Nano Clone
Simple Test Meter PZEM-004 & ESP8266 Platform IoT Ubidots
Arduino IDE Code
Four variables have been added:
- Instantaneous voltage
- Instant current.
- Instant power.
- Accumulated power.
The sending and / or updating of data is done every 15 seconds, in this tutorial case, the recommended is 5 or 10 minutes for updating.
Note: Download links and / or github below.
Dashboards Web Version
After performing the code download to ESP8266, the variables are automatically displayed, they only need to be configured from the widgets.
Dashboard Ubidots from Android
Tests were also performed analyzing the views from Android, you can also see the Dashboard perfectly.
Video : Quick Test Meter PZEM-004 & ESP8266 Platform IoT Ubidots in Android
Visually Ubidots is very eye-catching and intuitive with regard to uncomplicated configuration, there are no problems with the display of Decimals.
As I mentioned before, there are 2 versions of Ubidots, Industrial version or for companies and the version for education which we have used in this tutorial, if you want to know differences between both versions:
As in almost all platforms there are operating characteristics per device, widgets, dashboard or data retention time in this case are the credits, have created this table to explain those aspects of the platform:
In general there was no major complication, this is only a basic test, in future integrations with Ubidots derived from this project we could perform:
- Measurements of temperature.
- Heating resistance control via Rele or PWM AC.
- Integrations with Wifimanager to facilitate configuration.
- OTA integrations for remote programming of esp8266.
Downloads / Github
- Website : Ubidots for Education.
- RECOMMENDED: Measurement Electrical consumption with Ubidots Industrial & ESP32 + PZEM-004T