USB-C Battery Charging
Overview
PyCubed uses the TI BQ25883 USB battery charging IC to manage USB-C power delivery. This provides an easy way of powering the board and/or charging the batteries.
- Charging is enabled/disabled and configured in software.
- USB power can safely be applied at any time with / or without a battery attached.
- It is even possible to charge batteries after integration of your CubeSat into the deployer as long as you have access to the USB port.
(All of this is made possible by the 🔓Inhibits & RBF Header. Make sure to review that page to understand how different power arrangements are achieved)
Default Charging Behavior:
When USB power is first applied, the BQ25883 will look for an attached battery and and trickle-charge it (if possible) to 8.4V at a rate of 200mA.
- The
VCHRG
andGND
jumpers of the RBF header must be installed in order to charge the batteries. See RBF page above for more details.- In this scenario, the PyCubed MCU will not boot unless the
VUSB
jumper is also installed or both high side and low side screw terminals (inhibits) are jumpered.
- In this scenario, the PyCubed MCU will not boot unless the
- USB power can be supplied by any powered USB port such as a laptop, wall charger, laptop charger, etc...
- The green “CHRG” LED (D5) next to the USB connector will turn on when charging and turn off when the batteries are full. The LED will blink once per second if the no battery is detected, the safety timer has expired, or some other fault has occurred.
If PyCubed Is Allowed to Boot:
If VUSB
jumper is installed (or the inhibits are connected, see above) PyCubed will be powered and the MCU will boot. Part of the booting process initializing hardware and software (i.e. when from pycubed import cubesat
is called), during which USB battery charging is intentionally turned off.
- To turn on USB battery charging in software use:
cubesat.charge_batteries=True
. This can be done from the REPL or within your main.py code.- This enables charging and sets the charge rate to 400mA
- Similarly, to disable charging use
cubesat.charge_batteries=False
- For advanced users, the charge rate and target voltage can also be configured in software. See the bq25883.py library (in your board’s
/lib
folder) to see what functions are available. PyCubed supports the USB-C Power Delivery (PD) specification, meaning the BQ25883 could be configured for up to ~2A charge current if desired. Stick to the defaults to avoid undue stress on your battery cells.
Safety Timer:
USB battery charging will automatically shut off after 12 hours of continuous charge operation. The green “CHRG” LED (D5) will blink once per second if the safety timer expires.
- If charging without booting PyCubed (i.e. from a wall socket), USB power must be removed and then re-applied (unplug and plug USB charger from wall socket) to restart charging.
- If charging was enabled from software (PyCubed was allowed to boot), the safety timer can be reset in software and charging will resume.
For Flight:
The USB battery charger