@funky81
the original question was, if you could connect the supply to Vraw (using 3xAA batteries), and still use the internal Vref to calculate batteryvoltage. This is not possible
Your approach is connecting battery directly to VCC on the atmega (bypassing the onboard voltage regulator). In this case it will work.