Using the ACS712 current sensor to measure current in a circuit. Benefits are that it can measure current in the high side of the circuit, adds just 1.2 milliohms to the cuicuit to be measured and includes all the amplification electronics on chip.
float amps = 0;
float maxAmps = 0;
float minAmps = 0;
float lastAmps = 0;
float noise = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
amps = (516 - analogRead(A0)) * 27.03 / 1023;
amps = (amps + lastAmps) / 2;
lastAmps = amps;
maxAmps = max(maxAmps, amps);
minAmps = min(minAmps, amps);
noise = maxAmps - minAmps;
Serial.print(amps);
Serial.print(" ");
Serial.println(noise);
if (Serial.read() != -1) {maxAmps = amps; minAmps = amps;}
delay(100);
}

By Julian

Youtuber, shed dweller, solar charge controller aficionado

16 thoughts on “Using the acs712 hall effect current sensor module part 1”
  1. Avataaar/Circle Created with python_avatars MrNams says:

    Can i use this to measure current for 3phase motor,440v?

  2. Avataaar/Circle Created with python_avatars The Wavering Warrior says:

    How do the Shelly Em modules know which direction ac current flows? They only have two wires on the CT.

  3. Avataaar/Circle Created with python_avatars Mike Berger says:

    I bought one of these modules and it seems to me there is no way you should run high current through those traces on the pcb — has anyone done it? It says good for 20 amps ! (no way?) YOurs looks beefier than what I bought — nicer terminals also. Where did you get it?

  4. Avataaar/Circle Created with python_avatars FelinoFacho says:

    Can that measure little current like 100mA ?

  5. Avataaar/Circle Created with python_avatars Alan Johnstone says:

    I know it is a long time since you posted this but one thing to know is that you have to measure the zero point in the position you will use the module because it is affected by magnetic fields in the vicinity.

  6. Avataaar/Circle Created with python_avatars DTec says:

    U r great

  7. Avataaar/Circle Created with python_avatars Kip Crossing says:

    I'm glad that I know this product exists! Thanks from 7 years later.

  8. Avataaar/Circle Created with python_avatars Hans de Groot says:

    Hi Julian. good vid. But to me (so far) the acs712 is pretty useless. I have 4 of those mini boards but the readings are so silly unstable. With no load it is hopping between 08 amps and -08 amps. Some times I even see reading above 2 amps. I also have the ina219 whis is suposed to be much better but that one does only handles max 3 amps. When having 200 watts of solar on 12 vols… well I need a lot more amps!

    Eventually I like trying to "record" the current/wattshours going in and out of the battery so I can determine of it is running low or not. I need this since just measuring the battery voltage under high load is pretty useless because of the voltage drops under load.

    So any one any suggestions for a (cheap!) +-20 amps braekout board for arduino similar too the ina219?

  9. Avataaar/Circle Created with python_avatars Karan Sahil says:

    Can I connect 230v AC supply neutral to 10A Current Sensor ACS712-10A

  10. Avataaar/Circle Created with python_avatars John Ward says:

    Hey Julian, I've seen some suppliers place a wire shunt in those two now spare screw terminal holes to increase the current measuring capabilities. Thanks for your videos!

  11. Avataaar/Circle Created with python_avatars Andrea Errico says:

    hi, you have a sensor with big terminal! Where Can I foud this model? thank you

  12. Avataaar/Circle Created with python_avatars Daniëlle Leever says:

    Julian, you stated the isolationvoltage of the acs712 is 1200V. According to the specs of Allegro it is 2.1 kV RMS (60Hz) for the duration of max. 1 minute. Did you test the 1200V as a continuous DC voltage during, lets say, 1 day?

  13. Avataaar/Circle Created with python_avatars acqurius 2018 says:

    is it possible to measure ac current of signal with frequence of 1kHz with ACS712?

  14. Avataaar/Circle Created with python_avatars Jorge Alberto Gómez says:

    Could you measure AC current with this module? Did you use any control of 50/60Hz pulses to measure in AC?

  15. Avataaar/Circle Created with python_avatars Ahmet aa says:

    you cant just use 185mv/amp value because it is the nominal value. you have to find the value of yours own

  16. Avataaar/Circle Created with python_avatars Rizwan Saeed says:

    Please suggest me to measure th DC voltage upto 500V and Current of 20A I want to make power meter for my solar panals whcih are capable of giving volage upto 300V and current upto 5A please suggest me the sensors

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.