Raspberry Pi Zero W UPS with LiPo Battery
Give your Raspberry Pi Zero W an uninterruptable power supply with this neat pHAT system from PMD Way.
No soldering is required, the Pi is simply screwed onto the pHAT with the included fasteners. Communication with the Pi is via the ten pogo pins.
The 1000mAh LiPo battery is included, so you don't need anything else. The battery is charged via the micro USB socket, which also offers a USB-serial connection to the Pi via a CP2104 interface IC.
The battery charger has a current of 400mA, and the UPS can supply 5V at up to 1.3A if required - however the battery can last much longer if your Pi is not doing too much.
Tests of turning on the network and printing power parameters every two seconds resulted with a battery life of around six hours. Of course your battery life will vary ... however it beats not having power at all if there's a cut to the AC power.
Your Pi can interrogate the onboard MAX17040 fuel gauge IC via the I2C bus. Click here for python code to do this.