I have a Raspberry Pi Zero in a small robot that I have been powering off a USB powerbank and it works great. Unfortunately when the USB battery goes flat the power is cut and the Pi crashes. I want the Pi to know when the battery is nearly flat and warn me. Ideally it could calculate how many hours of battery life I have left too.
I have bought an INA219 voltage\current sensor. My original idea was to put the 0.1 Ohm shunt in series on the 5V between the USB output of the battery and the Pi. This only tells me the current at the time I sample it, and the voltage feeding the Pi which is largely irrelevant as long as it stays within the USB voltage spec.
Having taken apart my USB powerbank (RavPower RP-PB19), can I put the INA219 between the Lithium ion cells and the boost converter\charging circuitry shown? Specifically, can I cut this red wire in the photo and put each cut end of the wire into the blue screw terminals on the INA219 sensor to be able to read the current cell voltage of 3.6V ish and therefore work out roughly what percentage the batteries have left in them?