1. @6.54A 547max 480min (it's 6.54A sorry)

+ @3.65A > 547max 512min

2. multimeter (not true RMS)

6.54A * 1.414 * 2 = 18.5A peak to peak

(547 - 480) * 5 / (1024 * 0.04) = 8.1A peak to peak

So, if my calculations are correct and your meter is to be believed, the sensitivity of your device is only about half what it should be. Are you sure you have the 50A version and not the 100A version of the ACS758?

I would tidy up the code like this:

const double sensitivity = 0.04;

const int16_t adc_zero = 512; //as read when there is no current on the load

const uint16_t numSamples = 100;

float current;

...

long acc = 0;

for(uint16_t i=0; i<numSamples ; i++) {

int16_t adc_raw = adc_read(2);

acc += (adc_raw - adc_zero)*(adc_raw - adc_zero);

_delay_us(100);

}

const float meanSquare = ((float)acc)/((float)numSamples);

current = sqrt(meanSquare) * (5 / (0.0016 * 1024.0)) - 0.5;

While writing this, I noticed that you were dividing by the number of samples after taking the square root instead of before. That explains a factor of 10 in why the sensitivity appeared to be incorrect.