Measuring battery charge

Zener's don't have a very sharp cutoff at low currents(*), another way to protect is to use a schottky diode to the +5V line, thus preventing the pin going higher than about 5.3V. Schottky diodes have a lower forward voltage than the protection diodes in the MCU and external schottky diodes can handle a lot more current than the protection diodes (which are meant to protect against static discharge).

(*) this could cause inaccuracy in the voltage divider when close to 5V at the analog input.