How much voltage is your divider making. 3V? What size resistors are you using, 1 Meg or 1K? Are you over drawing power or putting to much voltage into an IO pin.
I will be doing the same and my plan is, I have 12V battery, regulated to 5 V, which could go as high as 14.4 V since it is a car battery on a solar charger. I will use 6 megohms of drop. The divider will be made up of 5 megohms and 1 megohm. 5 will tie to the battery, then tied to 1 megohm which will tie to ground. The voltage to measure the battery will be pulled from the connection of the 5 and 1. These will all be 1% resistors, don’t use 5%, you might as well just guess. At 18 Volts, the extreme, I will see 3 V, at 12V I will see 2V. I will run this line into an A/D and set that to either 12 or 16 bits.
You could use a FET to turn on the voltage divide on and off via power in and using an IO line, there should be all kind of examples out there, but I would think if you go with megohms you are pulling micro-amps… The FET will also have voltage drop across the drain 0.2 volts depending on the chemistry.