ACS714 20A current calculation help

Hi

I have developed a current sensing circuit using an ACS714 20A, a PIC16F877A and some other components. The code I have written for the current calculation is:

Vout Voltage(mV) = (ADC Value / Max ADC Value) * Vref
Current Through the Wire (A) = (Vout(mv) - Voffset) / Sensitivity(mV/A)

Which equates to

Vout Voltage(mV) = (ADC Value / 1023) * 5000
Current Through the Wire (A) = (Vout(mv) - 2500) / 100

But when i use it to calculate the maximum amp reading, i get 25A, which seems way too high if the higher threshold of the ACS714 20A is 20A.

Am I making a mistake in my calculations?

Thanks

@loumac1995
Your calculations are correct.
However, the ACS714 is linear only over the +/-20A range, so the output will be 0.5V to 4.5V, a 4V span

Any other quesions?

int ADC = analogRead(aInputPin) - 512;
bool isPositiv = ADC >= 0;
float milliAmpere = 48.78 * abs(ADC);

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