├── images ├── pem.gif ├── hass.png ├── mqtt.png ├── mounted.jpg ├── pemlog.png ├── schematics.png ├── esp32pem_out.png ├── adeleq_02-553_DIG.jpg ├── ds18b20_connection.png └── pulse_measurement.png ├── README.md ├── esp32_powermeter_mqtt └── esp32_powermeter_mqtt.ino └── LICENSE /images/pem.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/pem.gif -------------------------------------------------------------------------------- /images/hass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/hass.png -------------------------------------------------------------------------------- /images/mqtt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/mqtt.png -------------------------------------------------------------------------------- /images/mounted.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/mounted.jpg -------------------------------------------------------------------------------- /images/pemlog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/pemlog.png -------------------------------------------------------------------------------- /images/schematics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/schematics.png -------------------------------------------------------------------------------- /images/esp32pem_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/esp32pem_out.png -------------------------------------------------------------------------------- /images/adeleq_02-553_DIG.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/adeleq_02-553_DIG.jpg -------------------------------------------------------------------------------- /images/ds18b20_connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/ds18b20_connection.png -------------------------------------------------------------------------------- /images/pulse_measurement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fvilmos/power_meter_mqtt/HEAD/images/pulse_measurement.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Power Meter with mqtt-for devices with pulse output 2 | 3 | 4 | ## About 5 | 6 | This project presents a simple solution for measuring the energy consumption of a house. The key element is a cheap energy monitor with pulse output, connected to an [ESP32 WROOM 32 board](https://docs.espressif.com/projects/esp-idf/en/latest/hw-reference/modules-and-boards.html#esp-modules-and-boards-esp32-wroom-32). This, over WiFi using mqtt protocol can be easily connected to a home automation system to report: 7 | - instant power (in Watt); 8 | - total power consumption (in kWh); 9 | - Device temperature (in Celsius) using a DS18b20 temperature sensor. 10 | 11 | OTA support is enabled, after the first software upload, the ESP will available for updates on the local network over [Arduino IDE](https://www.arduino.cc/en/main/software). 12 | 13 | ## Hardware Components 14 | 15 | ### ESP 32 board 16 | [ESP32 WROOM 32 board](https://docs.espressif.com/projects/esp-idf/en/latest/hw-reference/modules-and-boards.html#esp-modules-and-boards-esp32-wroom-32) 17 | 18 | ### The Power Meter 19 | 20 | The power meter [adeleq_02-553_DIG](https://www.dedeman.ro/ro/contor-monofazic-digital-45a-1m-02-553/dig/p/1030357) operating range is 0.05A-45A, and (the most important part) provide 2000 impulses / kWh. Emitted pulses for detections have ~90 ms pulse width. The output is open collector, operating voltage, from 5-24V. In this case, the ESP32 supply provides 3.3V, but this is not a limitation. Other variants are available on the market, usually, the difference is the accuracy (i.e. pulses / kWh are only 1000 instead of 2000). 21 | 22 |

23 | 300 24 | 300 25 |

26 | Below a sample picture for the output, where a light bulb (~53W) is connected to the power meter. 27 | The measured pulse between the two detections is about 30.71s, which leads to a value measured of ~58.61 Watts. 28 | 29 | ``` 30 | Conversion from kWh to Watts, measured with a sensor of 2000 pulses/ kWh: 31 | (*/)/