Relay module measure consumption

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?

Do you mean the watts? Like volts X Amperes? Use you DVM. Digital Volt Meter, which also have the ability to measure the current.

1 Like

How do you plan on measuring the current?

Topic moved !! Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.

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.

1 Like

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 are the possible power consumption values? Microwatts, milliwatts, megawatts?

max 2000w in the relay.

Everything you need to know about DIY energy monitoring
https://docs.openenergymonitor.org/electricity-monitoring/index.html

This is like a game of 20 questions! 2000w at what voltage and is it AC or DC?

1 Like

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.

Ron