Power measurement of AC loads using ESP32

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ssd
Normal user
Posts: 53
Joined: 19 Aug 2020, 12:04

Power measurement of AC loads using ESP32

#1 Post by ssd » 21 Sep 2020, 07:24

Hello all,

I am trying to configuring 4 switches on a switchboard with domoticz and ESPeasy. I am able to configure it successfully. Now, I want to measure the power consumption of each device on the switchboard. I tried using ACS712 but the readings where nonlinear(using a simple Arduino code as I was unable to find any ESPeasy plugin for ACS712). If I use the I2C sensor I guess ESP32 supports only two I2C devices. Is there any particular sensor with which I can measure the power used by individual devices using a single ESP32? And do ESPeasy have a plugin for the same?
Last edited by ssd on 22 Sep 2020, 07:26, edited 1 time in total.

User avatar
Ath
Normal user
Posts: 3517
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Power measurement of each device using ESP32

#2 Post by Ath » 21 Sep 2020, 08:20

Recently I2C multiplexer support was added, but it is, because of build-size issues, only included in the 'normal' builds of ESPEasy.

Alternatively, you can make a custom build of ESPEasy to enable support for this feature (search for FEATURE_I2CMULTIPLEXER in define_plugin_sets.h, it is inhibited by LIMIT_BUILD_SIZE). When compiled with this option enabled it allows to configure a supported multiplexer in the Hardware page, and the desired channel(s) an I2C device are selectable per I2C device.
/Ton (PayPal.me)

ssd
Normal user
Posts: 53
Joined: 19 Aug 2020, 12:04

Re: Power measurement of each device using ESP32

#3 Post by ssd » 21 Sep 2020, 08:33

Ath wrote: 21 Sep 2020, 08:20 Recently I2C multiplexer support was added, but it is, because of build-size issues, only included in the 'normal' builds of ESPEasy.

Alternatively, you can make a custom build of ESPEasy to enable support for this feature (search for FEATURE_I2CMULTIPLEXER in define_plugin_sets.h, it is inhibited by LIMIT_BUILD_SIZE). When compiled with this option enabled it allows to configure a supported multiplexer in the Hardware page, and the desired channel(s) an I2C device are selectable per I2C device.
Okay, thank you for the information but to start with I don't know any other way of energy monitoring apart from ACS712 so it will great if guide me with some of these sensors or modules which will help me measure the current or power.

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Power measurement of each device using ESP32

#4 Post by TD-er » 21 Sep 2020, 14:38

If I use the I2C sensor I guess ESP32 supports only two I2C devices.
As Ton already stated, for those sensors that only have a limited set of I2C addresses, you can use a multiplexer to overcome this issue.
About the recent changes of I2C plugins. The update is intended to add support for multiple instances of the same plugin to run on the same node.
But there has not yet been a nightly build including these changes.
Yesterday I did make a new test build based on the current state of the mega branch.
So you are welcome to test it:
https://www.dropbox.com/s/k183w03846szc ... 5.zip?dl=0
https://www.dropbox.com/s/iaea3k4zxe989 ... 5.zip?dl=0

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Power measurement of each device using ESP32

#5 Post by TD-er » 21 Sep 2020, 14:57

OK, I just googled the ACS712 sensor (didn't know it) and it is just an analog output sensor (Hall effect sensor)
So you can just use the ADC plugin.

Just make sure you don't use pins connected to ADC2 of the ESP32 as those do not work well when WiFi is used.

ssd
Normal user
Posts: 53
Joined: 19 Aug 2020, 12:04

Re: Power measurement of each device using ESP32

#6 Post by ssd » 22 Sep 2020, 07:14

TD-er wrote: 21 Sep 2020, 14:57 OK, I just googled the ACS712 sensor (didn't know it) and it is just an analog output sensor (Hall effect sensor)
So you can just use the ADC plugin.

Just make sure you don't use pins connected to ADC2 of the ESP32 as those do not work well when WiFi is used.
Okay, thank you for this information. :D

ssd
Normal user
Posts: 53
Joined: 19 Aug 2020, 12:04

Re: Power measurement of each device using ESP32

#7 Post by ssd » 22 Sep 2020, 07:16

TD-er wrote: 21 Sep 2020, 14:38
If I use the I2C sensor I guess ESP32 supports only two I2C devices.
As Ton already stated, for those sensors that only have a limited set of I2C addresses, you can use a multiplexer to overcome this issue.
About the recent changes of I2C plugins. The update is intended to add support for multiple instances of the same plugin to run on the same node.
But there has not yet been a nightly build including these changes.
Yesterday I did make a new test build based on the current state of the mega branch.
So you are welcome to test it:
https://www.dropbox.com/s/k183w03846szc ... 5.zip?dl=0
https://www.dropbox.com/s/iaea3k4zxe989 ... 5.zip?dl=0
Currently, I have no I2C sensor or multiplexer to test this build. Once I procure these materials I will test it for sure. Thanks :D

happytm
Normal user
Posts: 107
Joined: 15 Aug 2016, 17:53

Re: Power measurement of AC loads using ESP32

#8 Post by happytm » 29 Sep 2020, 01:51

Please look at following link:

viewtopic.php?f=2&t=1078&p=6462#p6462

Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 101 guests