Select Page

# Theory

5A Module 20A Module 30A Module
Supply Voltage (VCC) 5Vdc Nominal 5Vdc Nominal 5Vdc Nominal
Measurement Range -5 to +5 Amps -20 to +20 Amps -30 to +30 Amps
Voltage at 0A VCC/2
(nominally 2.5Vdc)
VCC/2
(nominally 2.5Vdc)
VCC/2
(nominally 2.5VDC)
Scale Factor 185 mV per Amp 100 mV per Amp 66 mV per Amp
Chip ACS712ELC-05A ACS712ELC-10A ACS712ELC-30A

## ACS712 Module Pin Outs:

• Always connect load in mentioned direction for positive output.
• If you will connect as illustrated below, the output will be positive ans above 2.5 volt .
• If you will connect it in opposite direction as illustrated in below picture, the output will decrease from the 2.5 volt.
• It will give 2.5 volt when there is no current flowing through it. # Coding

/*
Measuring AC Current Using ACS712
www.Kraj.in
*/
const int sensorIn = A0;
int mVperAmp = 185; // use 100 for 20A Module and 66 for 30A Module

double Voltage = 0;
double VRMS = 0;
double AmpsRMS = 0;

void setup(){
Serial.begin(9600);
}

void loop(){

Voltage = getVPP();
VRMS = (Voltage/2.0) *0.707; //root 2 is 0.707
AmpsRMS = (VRMS * 1000)/mVperAmp;
Serial.print(AmpsRMS);
Serial.println(” Amps RMS”);
}

float getVPP()
{
float result;
int maxValue = 0; // store max value here
int minValue = 1024; // store min value here

uint32_t start_time = millis();
while((millis()-start_time) < 3000) //sample for 3 Sec
{
// see if you have a new maxValue
{
/*record the maximum sensor value*/
}
{
/*record the minimum sensor value*/