Reading Sensing and Controlling current flow is a requirements in a wide variety of application including, over-current protection circuits, switching mode, battery chargers, power supplies, digital watt meter and programmable current source, etc.. The ACS721 current reading module is based on ACS712 Sensor which can detect AC, DC current signal accurately.

The maximum AC / DC can be detected using ACS712 will reach 30 amp and present current signal can read via analog IO port of Arduino, Product available for this module are 30A, 20A, 5A. for this demonstration we will used the ACS712 30A.

DC Current Measuring Sketch

AC Current Measuring Sketch

Another Example of the AC712 Alternative Formula

Introduction of ACS712 Current Sensor Module – 30A with Arduino

### 11 thoughts on “Introduction of ACS712 Current Sensor Module – 30A with Arduino”

• at

Hey what parameters do I need to change for 30 A sensor

amplitude_current=(float)(sensor_max-512)/1024*5/185*1000000;

• at

1023 – 512 = 511 * 234375 = 119,765,625 quarter microamps / 4,000,000
= 29.9410625 Amps close to 30amp

• at

I see , but can you explain what each number means and reform this amplitude_current=(float)(sensor_max-512)/1024*5/185*1000000; for 30A what do i need to replace

• at

its very unreliable when using arduino with usb, because codes take ideal 5 volts into consideration, while in real world this dosent happen, and thus the readings fluctuate. I have tried and made this work, now all aspects of sensors and formulas are taken from current voltage, which are measured by secret arduino voltmeter.

• at

1024——->adc value for 5V both are constant for acs712
*5———> 5V arduino analog pin max value
185——->its from datasheet and its for 5A if we will use 30A censor we have to change it 66
amplitude_current=(float)(sensor_max-512)/1024*5/66*1000000 so it will change like this for 30A

• at

And I have a question too How can I use both code for it I mean I have to measure ac and also dc current

• at

Well yet another code for this sensor doesn’t work… literally copied and pasted it, uploaded… my output is as follows:
72.04
72.04
72.04
72.04
72.04
72.04
72.04
72.04
72.03

Thats without pressing the button to connect the motor to the power (which uses around 300mA).

Why on earth does the code from any site never work for this sensor? (I have two of them and both have the same result).

• at

#include
//current censor
const int sensorIn = A1;
int mVperAmp = 66; // use 100 for 20A Module and 66 for 30A Module
int RawValue= 0;
int ACSoffset = 2500;
double Voltage = 0;
double Amps = 0;

void setup() {

}
void loop() {
//Current calculate
Voltage = (RawValue / 1024.0) * 5000; // Gets you mV
Amps = ((Voltage – ACSoffset) / mVperAmp);
Serial.print(“Current: ” );

Serial.print( Amps );
Serial.println(” A”);
}

I use this code and it worked on my project bro for 30A censor I hope it will help u too

• at

#include
There is this at the first in code I accidently deleted it