How to make a battery level indicator for arduino (The battery is powering the arduino also)
The same battery is powering the device so using voltage divider is not useful because of the ADC reference depends on the battery. 


It sounds like you are running this without a voltage regulator, such that the supply voltage to the MCU varies with the battery.

In that situation, the best course of action is typically to momentarily turn on the ATmega's internal bandgap reference, measure that with the supply-referenced ADC, and then calculate backwards from the data sheet's value of the bandgap reference to the supply voltage that would produce the measured ADC counts.  (Some MCU's also get a factory-measured item-unique calibration value stored somewhere you can read at runtime, not sure the ATmega does however)

Then you can turn the internal reference back off to save power.  Probably you want to put some thought into what else you can turn off, and sleeping the processor, turning off the display, etc to save power.  Or even give it a manual power switch.