This is an old revision of the document!
Table of Contents
⚠️UNDER CONSTRUCTION!⚠️⚠
USB-C-ifying
Having several different chargers for devices is tedious. Read about how to convert nearly everything into USB-C.
It can be done two ways:
- buy an external USB-C adapter if available: you can find them for notebooks, electric razors and other proprietary plugs
- modify the device itself
- create a fake battery pack with USB-C socket, reusing original BMS (Battery Management System)
- create an USB-C adapter: also read DIY drill power bank
There are three ways how to do it electronically:
- no voltage adjustment needed = there is already mini/micro-USB or a socket with 5V
- use step-up or step-down electronics to match voltage of the device
- use USB-PD (with PPS) or Quick Charge (QC) to request voltage of fast chargers
Terminology: PD = Power Delivery ; PPS = Programmable Power Supply
Category 1: Solder in a USB-C socket - there are available USB-C breakout boards for easy of use. For some devices there are replacement boards with USB-C so it is easy to convert them. Examples are PlayStation DS4 controllers and PS Vita. There are solderless boards/kits offered.
Category 2: The voltage of the device is not 5V. To lower voltage, a linear regulator (LDO) can be used (e.g. to 3V7 with AMS1117-adj) - they are small and cheap but also inefficient and may get hot, as LDOs just burn up the excessive voltage. There are switching regulator modules which are more efficient but bigger in size and more expensive. Bad modules may have high voltage ripples - add 10nF + 100nF capacitors for smoothing the output.
Category 3: Chose USB-PD or QC if voltage of the USB power supply needs to be adjusted. Regular USB-PD is >=5V. PD with PPS can go as low as 3.3V. QC3 typically goes as low as 3.6V.
TIP: If you solder in a USB-Socket, you need to fixate it somehow. If there used to be a micro-USB socket, there is mostly a ground pad beneath it. Apply solder tin on the upper side of USB-C socket and solder it upside-down onto the ground plane of the PCB.
#TODO: USB-PD + PPS and QC
“Just” request the desired voltage via USB-PD (power delivery) or USB-QC (QuickCharge). If you need other voltages than fixed USB-PD PDOs of 5v, 9V, 12V, 15V, 20V, (with EPR: 28/36/48 V), go for USB-PD PPS or QC3.0, which support smaller voltage steps.
PPS (Programmable Power Supply)
Typical USB-PD PPS range: 3.3 V → 21 V, in 20 mV steps
Also read about QuickCharge on wikipedia.
QC3.0 introduced INOV (Intelligent Negotiation for Optimum Voltage). Voltage range: 3.6 V → 20 V Step size: ~200 mV per step Negotiation method: pulse-based up/down commands over D+ / D– Only available on USB-A or proprietary USB-C implementations (not USB-IF compliant)
If a charger supports QC4, it almost certainly supports PPS (because that's how QC4 is implemented).
QC4+ Fast Charge Protocol is a combination of USB-PD PPS and QC3.0/2.0 fast charge protocol for backwards compatibility.
read-ups
hackaday.com series: All about USB-C, especially Replying Low-Level PD and Talking Low-Level PD.
A really good write-up of USB-PD: https://github.com/manuelbl/zy12pdn-oss and OSS FW for ZY12PDN PD-trigger board
hardware modules
There are various pure hardware trigger boards that set PD voltage over resistor or DIP-switches.
IC
There are USB-PD sink controller ICs which you can interface with an MCU, like FUSB302, AP33772, CH224K or IP2736. Read about 30 ICs compared on chargerlab.com
- https://hackaday.io/project/192576-picopd-usb-c-pd-30-pps-trigger-with-rp2040 AP33772 on Pi Pico
- https://github.com/Ralim/usb-pd USB-PD driver stack for FUSB302
- https://github.com/Starryccc/FUSB302 PPS on FUSB302
MCU implementations
Instead of using a trigger sink IC, there are implementations for requesting voltage with MCUs, e.g.:
- https://www.g3gg0.de/esp32/esp32-pd-usb-pd-using-esp32-zigbee-crib/ BitBang USB-PD on ESP32-C3
- https://github.com/vdeconinck/QC3Control Arduino QC3
- https://github.com/Crypter/QC3Client another Arduino QC3
- https://github.com/z4yx/USB-C-PPS PPS for STM32G0
- https://github.com/wagiminator/CH32X035-USB-PD-Adapter PPS on “10¢” CH32X035
TODO
USB-PD (65W) fast charger buck boards
Bidirectional power bank modules: e.g. IP2369, read DIY drill power bank
USB-PD/QC trigger boards → request voltage from USB fast charger
Basically the trigger board is the “end device” which needs to be powered.
Regular USB-PD is >=5V. PD with PPS can go as low as 3.3V.
Typically, PPS allows continuous adjustment in 20 mV steps.
USB-PD PPS IC (like CH224K or IP2736)
In USB Power Delivery (PD), a PDO (Power Data Object) describes a power option that a source (charger) can offer to a sink (device).
Fixed PDOs: Advertise fixed voltages (5 V, 9 V, 15 V, 20 V).
Variable PDOs (deprecated): Used in older PD specs, allow requesting a voltage within a range.
Battery PDOs: Specify a power range in watts instead of volts.
APDOs (Augmented PDOs)
Introduced in USB PD 3.0 to support PPS (Programmable Power Supply).
Instead of just offering a fixed voltage, an APDO defines a range and step size.
The sink can request a specific voltage (in 20 mV steps) and current from the source.
Example APDO from a charger:
“PPS: 3.3 V – 11 V @ 3 A”
Sink could request 3.8 V, 5.6 V, 7.2 V, … within that range.
APDOs are PDOs that describe a programmable voltage range (for PPS), not just a fixed level.
EPR = Extended Power Range
Standard USB PD (USB PD 3.0) delivers up to 100 W (20 V × 5 A).
USB PD EPR extends this range up to 240 W (48 V × 5 A). The device can negotiate USB-C PD at higher voltages (above 20 V). Requires EPR-capable cables and devices to safely handle the higher voltage.
AVS = Active Voltage Switching (sometimes also called Automatic Voltage Switching)
dynamically switch output voltage depending on the needs of the device. With AVS, the charger can smoothly change voltage without disconnecting the load = stable power delivery as the device requests more or less voltage.
#TODO: modified battery as USB-C dummy
Modify a (broken) battery to use as a dummy with USB-C. Also useful for devices which cannot be powered w/o battery (and you only need the device stationary).
Caution: Do not accidentally cut into the battery cell! Beware of health issues.
Reuse the original BMS and replace the cells of a battery pack cells with electronics to get nominal battery voltage. Add a diode in case you accidentally try to power (and therefore charge) the fake battery via charging port of the device!
All you need is the BMS, a USB-C socket and a voltage regulator - alternatively use USB-PD PPS or QC to request a voltage: ~3.7V for single cell devices or ~7.2V for 2S.
the modern way: USB-PD/QC
“Just” request the desired nominal battery voltage via USB-PD PPS or QC3, which is then connected to the BMS.
switching regulators
Terminology:
Buck = step-down voltage
Boost = step-up voltage
Buck+Boost: can do both
If your device uses > 5V battery (multi cell), you can use a step-up module to connect to the BMS.
If your devices uses ⇐5V (single cell 3.7V), then you can use a step-down module to connect to the BMS.
If you need it compact for a low powered device, you can consider an LDO instead of a step-down switching regulator.
LDO for single cell low power devices
Instead of using USB-PD with PPS, you can use regular 5V USB and a LDO regulator like ASM1117-ADJ to set ~3.7V. An LDO “burns off” the extra voltage as heat and handles only limited current: use for low power devices only!. Advantage: you can use regular dumb 5V USB and are not restricted to use PPS only.
Vout = Vref (1+ R2/R1) + Iadj * R2; where: Vref ~1.25V Iadj ~50-100µA (small enough to usually ignore) R1 is the resistor from OUT → ADJ R2 is the resistor from ADJ → GND For 3.7 V: 3.7 ≈ 1.25(1+ R2/R1) R2/R1 ≈ 3.7/1.25 −1 ≈ 1.96 So good resistor pairs are: R1 = 1 kΩ, R2 ≈ 2 kΩ (closest standard: 2.0 kΩ → 3.75 V output) R1 = 1 kΩ, R2 = 1.96 kΩ (E96 series gives almost exactly 3.70 V) R1 = 240 Ω, R2 ≈ 470 Ω (classic LM317-style pairing)
Note:
The ASM1117 has a dropout of around 1.1–1.3 V at typical load, so your input must be at least ~5.0 V.
As power dissipation of the LDO is P=(Vin−Vout)*I, do not use a too high input voltage, stay with 5V USB. For anything above ~500 mA, the 1117 may overheat unless heatsinked.
examples of replacements with USB-C sockets
#Category 1:
Devices with 5V power plugs are the easiest to modify. Just replace proprietary socket or mini-/micro-USB with USB-C socket breakout board.
- hollow out proprietary (broken) PlayStation Vita socket, solder in USB-C socket
- custom PCB for Sony Ericsson FastPort USB-C replacement in C901
- install USB-C breakout board in various devices like PSP, PowerBank, etc.
USB data libraries
https://github.com/jojolebarjos/vusb-gamepad VUSB: Bitbang USB on ATtiny
https://hackaday.com/2012/02/09/learning-to-use-the-v-usb-avr-usb-firmware-library/: VUSB on AVR tutorial series
https://github.com/hathach/tinyusb
