MilikMilik

Build Your Own ESP32 USB-C PowerPD Analyzer

Build Your Own ESP32 USB-C PowerPD Analyzer
interest|Open-Source Hardware

What PowerPD Is and Why You Should Build It

PowerPD is an open source hardware USB-C power analyzer and programmable ESP32 power supply that negotiates USB Power Delivery and PPS voltages while measuring real-time voltage, current, and power on a compact board. Instead of buying an expensive USB PD tester, you reuse the USB-C PD chargers you already own as flexible bench supplies. The design combines an ESP32-WROOM-32E microcontroller, an AP33772S USB-C PD sink controller, and an INA226 power monitor to request and observe power profiles from 5 V up to 20 V. According to the PowerPD project on Hackster.io, this board “supports standard USB-C PD voltages such as 5V, 9V, 12V, 15V, and 20V” and can also use PPS for fine voltage steps. Makers and electronics hobbyists gain a compact, programmable USB PD tester that doubles as a lightweight lab supply for prototyping and debugging.

Gathering Hardware, Tools, and Fabricated PCBs

To build the PowerPD USB-C power analyzer, you start with the key components: an ESP32-WROOM-32E module for control and Wi‑Fi, an AP33772S PD sink controller, an INA226 current and power monitor, an MP1584 buck converter, an AP2204K 3.3 V regulator, a USB Type‑C connector, a 5 mΩ shunt resistor, a MOSFET output switch, a 1.3‑inch SH1106 OLED display, a rotary encoder, push buttons, status LEDs, and supporting passives. Because AP33772S is in QFN, INA226 in a small SOT‑23 package, and the USB-C connector has tight pads, hand-soldering is difficult. The project author used professional PCBA from NextPCB by uploading Gerber files, the BOM, and the pick‑and‑place file. When the assembled boards arrived, they only needed firmware flashing. For your build, you can follow the same route: download the design files from the PowerPD GitHub repository and order assembled boards, then prepare a USB‑to‑UART converter, BOOT/EN buttons, jumper wires, and a multimeter for bring‑up.

Understanding How PowerPD Negotiates and Measures Power

Before powering up your ESP32 power supply, it helps to understand what happens on the USB-C connector. When you plug in a USB-C PD charger, it defaults to 5 V. The AP33772S reads the charger’s advertised Power Delivery capabilities over the CC pins, including fixed profiles like 5, 9, 12, 15, and 20 V, and any PPS support for 100 mV voltage steps. The ESP32 firmware selects the requested profile or PPS setting and commands the AP33772S to negotiate it. Once the charger switches to the new voltage, current flows through the 5 mΩ shunt and MOSFET output switch to your load. The INA226 measures voltage, current, and power and reports them over I²C to the ESP32. The microcontroller updates the OLED, reads the rotary encoder and buttons, and can send live readings to Adafruit IO. Internally, the MP1584 buck and AP2204K regulator generate a clean 3.3 V rail from the PD input.

Flashing the Firmware and Programming AP33772S Control

With hardware ready, connect a 3.3 V USB‑to‑UART converter (such as CP2102, CH340, or FT232RL) to the ESP32 programming header, along with two small push buttons for BOOT and EN. Download the PowerPD firmware from the project’s GitHub repository, which includes PowerPD.ino and the custom AP33772S.h and AP33772S.cpp library files. Place all three in the same Arduino sketch folder so the compiler can find the local library. Configure the Arduino IDE for your ESP32 board and flash the sketch via UART, using the BOOT and EN buttons as you would for any ESP32 module. The firmware configures the AP33772S over I²C or GPIO, reads the INA226, drives the OLED, and implements the user interface logic. Once programming completes, the board should boot to a default 5 V profile, ready to negotiate new USB PD or PPS settings and act as a USB PD tester.

Using PowerPD as a USB-C Power Analyzer and Bench Supply

To use your finished USB-C power analyzer, connect a USB-C PD charger that supports at least 9 V output. The board initially runs at 5 V; use the rotary encoder and buttons to browse available PD profiles detected by the AP33772S, then select a fixed voltage or, if your charger supports PPS, set a custom voltage in fine steps. The ESP32 then requests the chosen setting and, once stable, enables the MOSFET output to your DUT. The OLED shows real-time voltage, current, and power from the INA226, giving you insight into how prototypes behave under different supply conditions. For safety, start at lower voltages and step up while watching the measurements. With open source hardware files and firmware, you can adapt menus, add logging, or integrate Wi‑Fi telemetry, turning PowerPD into a flexible USB PD tester tailored to your electronics bench.

Comments
Say Something...
No comments yet. Be the first to share your thoughts!