Inaccurate analog reading and interrupt problem

To get a good and easy test of the accuracy of the analog to digital conversor. I also tried connecting the 3.3v to the analog and the 5 volt to the analog as well. The 5v was the only one that gave me the correct result (1023) and I suppose that a smaller potential difference would give me 1023 also (as everything I try gives me more than what it is supposed to).