tsakitsan:
I think the topic should be marked as solved.
Maybe.
tsakitsan:
I am trying to find out what is the linear equation that the ACS712 20A Current Sensor uses.
If you looked at the datasheet, you would see that, nominally, Vout = (0.1v/A * amps) + 2.5v...which is consistent with your code.
By the way, if you use the 1.1v internal reference as suggested in post #2, you will only read a very small portion of the range (-20A to -15A).
And if you are going to use the full range of this sensor (or even just half the range), I'd suggest calibrating it with a wider range of loads than 1.4A to 2.3A