Problem with varying analog reading Aref issue

Hi I have an arduino running off of a 9V battery and reading an analog sensor (IR proximity). I calibrated the device but over time the calibration seems to change and the numbers received through the analog pin no longer trigger my audio at the right times(adafruit wave shield).

I am pretty sure it has to do with the 9V battery dropping. I dont have the analog reference set to external yet. I think I need to run a wire from Vin to Aref and turn on EXTERNAL for Aref, but Ive read that I should drop a capacitor vetween Aref and GND.... I also read about adding a resistor to have it act as a voltage divider to make the reference voltage a lower value...

Does it matter what voltage is being referenced??? Pretty sure 9v is to high for the analog pin so Im assuming I do need to drop it first but Is a 5v reference good or does it need to be lower???

I just dont want to constantly have to reupload the sketch with updated settings....

I resolved the issue by changing my code and having the sensor take a reading in setup() and store the value as a calibration constant... This way if it starts to drift I just have to turn it off and back on and it will work with the new correct values... I'd love to figure out the right way to do this using aref...

Can you post your code sofar? there might be some logic flaw?

2nd if the voltage drops might be an indication you draw too much current or so. Can you quantify this? Measure with a DMM? Can you tell what is connected to your project? post a schematic?