analog inputs unexpected behavior

jremington:
After switching between ADC channels, it is usually a good idea to make two readings, and throw the first one away.

Thanks for the tip, according to the first test it seems all readings are pretty stable even the first one. But i still have to test with the real current sensor and voltage divider to check if that would be necessary.

Delta_G:
Your readings are all referenced to a 5V reference. If your 5V reference isn't exactly 5V then your readings will seem to be off as the Arduino now thinks that 4.95 is 5V or something.

There is an internal 1.1V reference that is a bit more stable and might get you better results.

Hi @Delta_G, that might explain why i get 670 instead of 673 in the first test, but wouldnt the reference be the same when running both sketches? I mean I understand the reading will be a bit off due to the reference not being 5V exactly but shouldnt I get the same readings in both test if the code is the same?
I just want to find a logical explanation to this before I continue building the whole circuits, otherwise when everything is plugged I'll get strange results and would not know where the problem is!