Home / Blog / Avery Louie's RP2040

Avery Louie's RP2040

May 14, 2023May 14, 2023

Engineer Avery Louie has built a handy tool for turning a USB Power Delivery (USB-PD) connection into a high-voltage supply for a variety of uses — bumping the output up to 300V via a flyback converter.

"[It's] a USB-PD that nobody wanted or asked for. However, I needed one," Louie jokes of his project. "When I say high voltage, I don't mean 20V, I mean around 300V, for high-voltage DC needs like electrophoresis or electrowetting. This is a gratuitous and impractical project, since you can buy an electrophoresis power supply for about $100. However, I wanted to do a more [complicated] design, and I 'needed' a test PCB for my hotplate, so I made this."

The build, brought to our attention by Adafruit, is designed around the USB Power Delivery (USB-PD) standard — which allows for up to a 48V output at up to 5W. While that's a decent amount of oomph for driving something like a laptop, it's still not enough for Louie's purposes — meaning the board has to house some additional hardware.

"I wanted to use a flyback converter to take advantage of the inherent isolation of the transformer," Louie explains. "The 300V out is not ground referenced, which makes it a lot safer since you have to touch both wires to get zapped (this will hurt). To maintain isolation, the output voltage cannot be sensed directly (with a conductor). For safety, I added a high value bleeder resistor to the output caps, so they will discharge below the hazardous voltage threshold within a minute or two of disabling the supply."

The finished board design includes two USB ports and a BNC connector. One of the two USB ports connects to the USB-PD controller and provides the overall power, while the other connects to a central Raspberry Pi RP2040 microcontroller — the same chip driving the popular Raspberry Pi Pico — to provide the ability to configure the supply and flash new firmware. The BNC connector, meanwhile, handles the high-voltage output.

"I've never used [an RP2040] (or MicroPython) but they have a pretty good hardware design guide and it looked simple enough to one-shot the design," Louie writes. "Surprisingly, soldering the QFN went smoothly, and the USB bootloader worked flawlessly, which is an unusual and totally delightful experience.

"Bringup with the RP2040 has been similarly delightful — using the REPL, its easy to query devices over I2C and to make sure that all my buttons etc. are hooked up correctly in only a few minutes. It was also easy to write scripts to quickly test the power supply. I can see a lot of reasons to use this in the future."

Louie's full project write-up, including some notes about avoiding voltage sag and overvoltage at the output stage, is available on his blog; the project design files have been published to GitHub under an unspecified open source license.