Monitor battery voltage while charging

So I want to monitor my LiPo battery´s voltage using an ATMega328P analog input while charging. I already figured out how to do it while it is not charging. The only problem is that the
circuit that I plan to use to protect/charge/boost the battery is kinda dumb. This is the schematic of it:

You can see that the battery´s negative terminal (BAT-) is not grounded, but going into FS312F-G IC, which has an NPN mosfet, that grounds the BAT- if the boost converter is turned on, and everything is okay (no shorts, overdischarges....)

That means I can measure the voltage by connecting the microcontroler´s GND to GND of the circuit, and the BAT+ to any analog pin, and I should be fine, as long, as the boost converter is turned on. But while charging, the boost converter is of course turned off, and the BAT- is not connected to ground of the circuit.

So while the battery is charging, the NPN mosfet is turned off and I can´t measure the battery´s voltage. Any ideas? Thanks in advance.

I don't know why you say the battery negative terminal is disconnected from circuit ground during charging. If that were true, how would the battery be charged from USB? What would be the return path? I think the protection N-channels are on all the time unless there's a reason for them to be off (some protection limit has been violated).

You might consider adding a "load sharing" circuit, which would allow your power source to directly power the boost converter while also charging the battery. The added circuit would consist of a P-channel mosfet, a Schottky diode, and a resistor. It just happens that I recently posted a video about adding that function to a very similar circuit.

ShermanP:
I don't know why you say the battery negative terminal is disconnected from circuit ground during charging. If that were true, how would the battery be charged from USB? What would be the return path? I think the protection N-channels are on all the time unless there's a reason for them to be off (some protection limit has been violated).

I am not sure about that. Sure, it might be grounded, but is it straightly grounded? In that way so I can analogRead the voltage by connecting B+ to analog pin and GND to GND?

Just monitor both battery terminals and subtract the voltages.

andrewisbest69:
I am not sure about that. Sure, it might be grounded, but is it straightly grounded? In that way so I can analogRead the voltage by connecting B+ to analog pin and GND to GND?

It’s grounded just like it is when the battery is supplying power to the boost converter. Anytime the mosfets are on (anytime there is no violation of the protection parameters), the difference between the battery negative terminal and system ground is the RDSon of the two N-channel mosfets. That’s likely to be less than one ohm. So yes, I think you could just do a normal voltage measurement. But you could measure the difference in ground voltage anytime with your multimeter, even when charging, and see what you get.