I would like to measure the consumption of an item connected to the relay module that I have it attached in an esp8266 node mcu eg a desk lamp.
My setup consists of:
-esp8266 node mcu
-5v relay module
-mqtt broker
I would like to ask how do I get the consumption published to a topic, please? Or am I missing any hw component to get that measurement?
An item like a desk lamp will consume a constant power while it is on. You can simply measure that power once. Then the ESP only needs to measure the time that the lamp is on (which it controls, as I understand) to calculate the consumption.
the lamp is an example. i need to measure the power consumption of the attached device and once subscribed to that topic, then i will get it.
multimeter is not something i can use remotely to get info.
i need it to be on the board.
what do I need to get info about energy consumption of the device connected to the relay, no matter if it is AC or DC.
Setup has a MQTT broker in a Raspberry Pi, eap8266nodemcu with a single relay. The esp is controlled by a topic to on off the relay.
So the question is: what do I need to measure the energy consumption? Is it a software module or an extra hw needed?
There are current and voltage sensors for AC, DC and both. The power consumption is a function of the voltage and current at your load. Max of 2,000 watts really tells us nothing. You have been given answers which you answer with more questions. It becomes obvious you have not looked at any of the links provided or simply do not understand what you have been told.