I got the GPS-RTK2 chip, and I wanted to add battery support to it, but I wanted to reuse the existing the existing USB-C plugs, so I can use the plug both for charging and for communicating with the chip over the serial port that USB-C provides.
So my thinking was that I could add a battery to the power pins on the board to power the device.
But my question then is: How do I make it so that when the chip gets external power, the power flows from the board to the battery and charges it, but when I unplug, the power flows from the battery to the board? (and preferably with an on/off switch that still allows charging from USB port when battery is off).
All the LiPo things I see have their own USB port, but I’d rather avoid having multiple ports.
Of course it would be an option to add a USB-go-between the board and charger, as long as I can still use the serial-over-usb port the board plug provides.
You could snag USB power from the 5V pad on the board then run that over too a battery charger and Lipo.
You’d need to put a voltage regulator on the batteries output after the charger to drop it down to 3.3 volts and could then route that back to the GPS’s 3.3v pad. Put a diode on the 3.3v pad though to prevent current back feeding the battery.
Thanks. So nothing fancy but the diode to make it automatically run to the battery when plugged in, and back to the board when not?
The GPS will grab power wherever it’s available be it USB or from the battery. The diode just prevents the 3.3 volt rail and anything on that rail from pushing current backwards into the battery.
@TS-Chris, but if it prevents pushing power into the battery, doesn’t that mean it won’t charge from the power coming from the board when it is plugged into usb?
The battery charger is what’s charging the battery and it’s getting power from the 5V pad. You want power to flow from the 5V pad, through the charger and into the battery. Power then flows from the battery, through a voltage regulator and into the GPS via it’s 3.3V pad.
You don’t want power to flow from the 3.3V pad backwards into the voltage regulator and battery, a diode prevents that.