By default the analog inputs use the 5v chip supply as its reference , so when running off a 9v battery it’s likely the reference voltage is falling below 5v and hence your analog reading rises .
The answer is
- A 9v battery is not good enough for the job.
- Use the internal voltage reference on the chip and a voltage divider on the input .