AnalogIn() reads the voltage as a fraction of the system voltage. The value is a floating point from 0.0 (VSS) to 1.0 (VCC). For example, if you have a 3.3V system and the applied voltage is 1.65V, then AnalogIn() reads 0.5 as the value.
So if your system is using 3.3V, then the amps should be (0.53.31000)/66 = 25A.
But it looks incorrect, would you use a multi-meter to first check the value read from ADC is correct?
And please also check the sensitivity again in the datasheet.
I know this thread is relatively old, but just for the sake of correctness.
You say, you’ re using the ACS722 in the 20A AC version, which indicates that you are working with the bidirectional device ACS722LLCTR-20AB. Furthermore, assuming your system voltage for the ACS722 and the ADC is 3.3V, following is the correct explanation:
If you read 0.5 with the AnalogIn read function, it means half the supply voltage. With the ACS722 connected to the analog input it means 0A ( zero amps ). This sounds reasonable if no current is flowing.
The formular for this situation should be like ((ain.read() - 0.5)*VCC)/0.066. Result is in Ampere with a range of +/- 20A. This works for other supply voltage, too. If you use a unidirectional device, just remove the “-0.5” and it should work. If you use a different sensitivity, replace the 0.066 by the appropriate value.