What PowerPD Is and Why USB-C PD Matters
PowerPD is a compact USB-C power supply and power delivery analyzer built around an ESP32 microcontroller and a dedicated USB PD controller, designed to negotiate and monitor configurable USB-C PD and PPS voltages from common chargers for prototyping, testing, and portable lab work. In practice, you plug in any USB-C PD charger, then PowerPD reads the charger’s supported profiles, negotiates the voltage you select, and measures voltage, current, and power in real time. According to Hackster.io, PowerPD supports standard PD levels of 5V, 9V, 12V, 15V, and 20V and can take advantage of PPS when your charger offers it. That means a spare laptop or phone charger can double as a small, programmable USB-C power supply for your bench, with live PD protocol behavior visible on a compact OLED display.
Core Hardware: ESP32, USB PD Controller, and Power Path
At the heart of this ESP32 project are three main chips: an ESP32-WROOM-32E module, an AP33772S USB PD controller, and an INA226 power monitor. The USB Type‑C connector feeds power and CC communication lines into the AP33772S, which negotiates the desired PD or PPS profile with the charger. Once the charger switches from the default 5V to the requested voltage, power flows through a 5 mΩ shunt resistor and MOSFET switch before reaching the output terminals. The INA226 measures voltage, current, and power across that shunt and reports data over I²C to the ESP32. A MP1584 buck converter drops the negotiated PD voltage, and an AP2204K regulator provides a clean 3.3V rail for the ESP32 and logic. The ESP32 then drives the SH1106 1.3‑inch OLED, reads the rotary encoder and buttons, and controls the MOSFET output.
Designing and Assembling the PowerPD PCB
PowerPD is designed as a compact PCB that keeps high‑speed and sensitive traces short while grouping functional blocks clearly. The AP33772S USB PD controller sits close to the USB‑C connector so the CC lines remain short and clean, which helps reliable power delivery negotiation. The INA226 current sensor is placed right next to the 5 mΩ shunt resistor with Kelvin connections for accurate measurements. Most critical parts are fine‑pitch SMD packages such as QFN and SOT‑23, and the USB‑C connector has tight pad spacing, so manual soldering is difficult. The original design therefore used professional PCBA services: Gerber, BOM, and pick‑and‑place files were uploaded, and the assembler mounted components including the ESP32 module, AP33772S, INA226, MP1584 stage, AP2204K, MOSFET, and passives. When the boards arrived, firmware flashing over a USB‑to‑UART adapter was the only remaining task before testing.
Flashing the ESP32 Firmware and Talking to the AP33772S
To turn the hardware into a working USB-C power supply and power delivery analyzer, you will load custom firmware onto the ESP32. The firmware is written in Arduino style and uses a dedicated AP33772S library to handle USB PD communication. Download PowerPD.ino, AP33772S.h, and AP33772S.cpp from the project’s GitHub repository and place all three files in the same Arduino sketch folder so the compiler can find the local library. Wire a 3.3V USB‑to‑UART converter (such as CP2102, CH340, or FT232RL) to the ESP32 programming header, add two push buttons for BOOT and EN, then flash the sketch from the Arduino IDE. Once the ESP32 boots, it queries the AP33772S, lists supported PD/PPS profiles, accepts voltage selections from the rotary encoder, switches the MOSFET output, and reads live measurements from the INA226 for display and optional Wi‑Fi streaming.
Using PowerPD for PPS, Testing, and Customization
With firmware running, PowerPD behaves like a small programmable bench supply and PD analyzer. When you connect a USB-C PD charger, the board starts at 5V, then uses the AP33772S to read all advertised fixed and PPS profiles. You can scroll through 5V, 9V, 12V, 15V, and 20V, or, if your charger supports PPS, tune the voltage in fine 100 mV steps and current in 50 mA steps. This makes it useful for powering prototypes, checking regulators at specific input voltages, or characterizing small loads. The INA226 and ESP32 give continuous readings of voltage, current, and power on the OLED, and the MOSFET switch lets you disconnect the load during faults. Because the entire design is open source, you can adapt the code, change menus, log data to Adafruit IO over Wi‑Fi, or extend the firmware when new USB PD features such as EPR or AVS become relevant to your work.

