thank you for reply

The value adcdiv in your calculation should be 1024, not 1023

reason for 1024, correct me if i'm wrong

adcraw is a 10bit values, so from 0(min) to 1023(max = 2^10-1), so the max values here is 1023

A value of 512 with no current flowing is exactly right, however the device may have an offset of a few mV, so the value may be a few counts out. Noise on the +5V line will affect the reading.

which is the math to use for transform adc values to amepere using an acs758.

i get adc samples for adc current making an avarage of "many" values, i.e. at least 2 times the period of my 50Hz primary current, and my adc values are stable.

but maybe my formula is not correct, i'm using this one:

amp = (adcraw*adcvref/adcdiv- adcvref/2) / sensitivity;

because with "small" adcraw changes i have "big" change in amp

es.

( 512 *5/1023 - 5/2)/0.04 = 0.062

( 516 *5/1023 - 5/2)/0.04 = 0.54 (1/2Amp!)

and also consider the max raw value of 1023

( 1023 *5/1023 - 5/2)/0.04 = 62.5

acs758-050b is rated as 50Amp max, the max raw value i should read is almost 900