RobTillaart / ACS712

Arduino library for ACS Current Sensor - 5A, 20A, 30A
MIT License
129 stars 35 forks source link

How can we measure exact AC current in Amps #27

Closed atanudasgupta closed 2 years ago

atanudasgupta commented 2 years ago

Hi,

I went over your source code and readme, I am using ACS712 with AC50Hz, 15A , with ESP32, how can I measure amount of current flowing in the circuit. Also if there is no power, what should be the expected value from :mA_AC()

RobTillaart commented 2 years ago

check - https://create.arduino.cc/projecthub/instrumentation-system/acs712-current-sensor-87b4a6

it is not with my library but explains how it is done,

RobTillaart commented 2 years ago

Note, it is never exact, but the test results so far are pretty close to a professional Brymen multimeter.

PS, there is a bug fix pending, so either use the develop branch or the 0.3.0 version. (will be merged later today)

atanudasgupta commented 2 years ago

and what should I expect as mA value if there is. no current passing through the current sensor.?

I still seem to get a high value

RobTillaart commented 2 years ago

If there is no current you should get 0 plus maybe some noise (see datasheet). One way to test that is to disconnect the current wires, so the ADC should measure the midpoint (around 0). You can calibrate then by calling autoMidPoint().

If that does not work, your sensor may be broken. As I dont know your hardware setup I can only guess. As this seems not a library issue you better ask help on the Arduino forum.

RobTillaart commented 2 years ago

FYI, I'm merging the bug fix within an hour or so into a new release 0.3.2

update: 0.3.2 released.

RobTillaart commented 2 years ago

As this issue is not a library issue I close it. Feel free to reopen it if the problem is in the library.