The correct 5v step up buck converter will give your arduino constant power even when battery level drops, thus making reference voltage constant, if you take measurements from the battery terminal then it should work fine, even with your old code
The correct 5v step up buck converter will give your arduino constant power even when battery level drops, thus making reference voltage constant, if you take measurements from the battery terminal then it should work fine, even with your old code