GolamMostafa:
For your sensor, you have the idle response (idle to me 0A) is 2.56V. Now apply some current to the load (say, 5A) and measure the output voltage, and then you determine the response equation y = mx +C.
The ACS712 is a RATIOMETRIC sensor.
Zero current output is therefore not a constant 2.5volt (or 2.56volt), but VCC/2.
Therefore A/D result is always ~512 at any supply voltage if you power the sensor from the MCU supply with default Aref. Assuming you stay within the voltage range of the sensor (4.5-5.5volt).
Sensor gain has AFAIK the same ratiometric behaviour.
Gain goes up with supply voltage and A/D goes down with voltage, resulting in a stable gain.
Leo..