Problems with ACS712 and ZMPT101B

We're trying to design a smart meter with on/off functionality.
We're using NodeMCU-32S and Arduino IDE 2.

Our goal is to measure the current and voltage and use both to calculate the power consumed by the load and if it passes a certain limit the load will shut off.

However, we're having hard time to get the needed values from ZMPT101B or ACS712.

ZMPT101B:

  • The library we used to calculate RMS ZMPT101B-arduino
  • We used a library that calculates the RMS voltage, and the value it outputs is correct.
  • But I think we need instantaneous(?) voltage to calculate the power consumed?
  • We tried to calculate the inst. voltage using this line of code:
inst_volt = ((readAnalog(analog_pin) * 3.3) / 4095.0) / 500;
  • 500 is the sensitivity, we got it from the library we used.
  • inst_volt reached values above 1000, we think this value is not accurate(?)

ACS712

  • We use this library ACS712
  • We measured the current (without the sensors nor the relay, just the load) and on one multimeter it was 130mA, another was 70mA!
  • Using this example ACS712_20_AC_compare.ino the current measured by the sensor, it's always not accurate, even when there's no load it gives that there's about 1A flowing through the circuit! We just can't get it to work correctly.

We would be very grateful if anyone helped us.

This is our circuit:
220V/50Hz Wall Socket -----> Relay -----> ACS712 (Series) -----> ZMPT101B (Parallel) -----> Load
The relay signal is controlled by the NodeMCU, the ACS712 output signal is connected to 37, and ZMPT101B to 36.

is for AC

is for DC

@0x29a
You can measure AC with the ACS712

Use this library to calculate power

Hi, @0x29a

Do you need instantaneous power of RMS power?

AC Power is usually RMS power, so you need to use RMS Voltage and RMS Current.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

@0x29a
The EMonLib will give you the following:

-Real Power
-Apparent Power
-Power Factor
-RMS current
-RMS voltage

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.