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 .
Update Ubidots Libraries V3.0.0 for ESP8266 modules
Ubidots for Education
Previous Tutorials Recommended
Tutorial Platform IoT Ubidots & ESP8266 + Sensor DHT11
This tutorial will show how to communicate an ESP8266 and a DHT11 sensor with Ubidots from scratch:
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:
Features, Connections, Arduino and ESP8266.
Electricity consumption meter Peacefair PZEM 004 + ESP8266 & Arduino Nano
RECOMMENDED: Measurement Electrical consumption with Ubidots Industrial & ESP32 + PZEM-004T
Measurement Electrical consumption with Ubidots Industrial & ESP32 + PZEM-004T
Tests Performed
We will measure the electrical consumption of a resistance to heat water, consume approximately 870 Watts and visualize the measurements in a platform / Dashboard called Ubidots for Education.
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
Connections
Arduino IDE Code
The routine created in Arduino IDE, esp8266 performs the reading of the meter pzem-004 through the serial port.
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.
RECOMMENDED: Measurement Electrical consumption with Ubidots Industrial & ESP32 + PZEM-004T
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
Conclusions
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
References
- Website : Ubidots for Education.
- RECOMMENDED: Measurement Electrical consumption with Ubidots Industrial & ESP32 + PZEM-004T