Adjustable High Voltage USB PD Power Supply

A usb-pd that nobody wanted or asked for. However, I needed one.

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 compilated design, and I “needed” a test PCB for my hotplate, so I made this.

The goal of this project was to make something worthy of being a lab instrument, e.g. not completely unsafe, and not held together with string and gum. I want to “have it all” with this instrument and even more than that I wanted an excuse to use a lot of new parts and tools.

With respect to safety, I wanted to essentially live up to a standard of a double insulated tool- that anything conductive sticking out of the case (unless it is live) has double or reinforced insulation. To avoid USB ground loops or accidental ground-referencing due to an evil USB port (or a short of shield to ground), all USB ports are isolated from each other and from the high voltage.

In short, in addition to this project being impractical, its also somewhat risky in terms of project bringup- it was possible I missed something or that a circuit just won’t work and would be impossible to fix.

High Voltage Generation

Ignore the loose solder blobs…those got cleaned off.

I wanted to use a flyback converter to take advantage of the inherent isolation of the transformer. 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). One option is to use an opto isolator, but that requires more board area, cost, and things that can go wrong.

Another option is to use a flyback controller with “PSR”. PSR is primary side regulation, which senses the voltage induced on the primary while the secondary coil is discharging. This cleverly uses the transformer itself to avoid extra parts or breaching the isolation. There are a few controllers with this feature.

I also wanted the flyback to be adjustable- this is not as easy since it seems like these controllers are most often used when “just one” voltage is needed over and over again (many are for charging photoflash capacitors). The trick was finding one where only one resistor value needed to be changed, which I could do using a digipot.

I landed on the LT3750, which checks all the boxes. An additional factor was that coilcraft sells a special inductor that plays nicely with this controller, and for my application which has very high primary side currents (low DCR), low leakage inductance, and needs a relatively high inductance to be slow enough for the controller.

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.

N.B.: I later figured out that choosing a controller without continuous feedback was a problem- I made it work but its not ideal, see what went wrong.

USB Isolation

This device has three ports- two USB and one BNC. It’s important to prevent any conduction from one port to another, to avoid ground loops or ground referencing. The power USB port is isolated from the high voltage by nature of the converter. The data usb port (also for programming the RP2040) also needs to be isolated from the power USB port.

To do this I used an ADUM3160 which is a full speed, reinforced isolator. this provides a great deal of protection from voltages on either side of the isolator, which is important to protect both myself and my computer!

This worked off the bat at full speed, with little care given to the trace lengths/impendence ,since I kept them short. Surprisingly, the main design issue in the whole project was using the wrong jumper footprint, which left the device speed undefined on the rp2040 side. a single blob of solder fixed this (shown above).


At the heart of this all is an RP2040. I’ve never used one of these (or micropython) but they have a pretty good hardware design guide and it looked simple enough to one-shot the design. 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.

What Went Wrong + The RP2040 is a Hammer

The LT3750 has PSR, but no feedback about what the voltage is unless it is charging. This means that if it is charging, it is regulating the voltage, and if it is not charging, it has no idea what the output voltage is. Checking what the output voltage is can only be done by pumping a little energy into the output and seeing what happens, which increases the output voltage (if done frequently).

Days since magic smoke released: 0

To maintain the output voltage for different loads, the output needs to be checked frequently. This checking can easily drive the output voltage up (based on the minimum resistor value, to about 600V), which is enough to blow up the output caps, fry whatever thing you were running off the power supply etc. – in short, its nasty.

If not checked frequently enough, the output voltage will sag under different loads. What works for maintaining voltage across the bleeder resistors might not work for a real load.

Fortunately, I had planned to use the AMC3336-Q1 to measure the output across the isolation barrier. This part is super convenient to use because it is powered from the isolated side through some integral magnetics. This eliminates needing to do funny business to get a low voltage source referenced to the high voltage side.

Sadly the AMC3336 was out of stock, so I ended up with the AMC3306m25. This is the same part, but it only has a 250mV range, which is ok because that only required a small change in the resistor divider.

By using the AMC33X6, I can measure the output and kick on the converter if the output drops from within a few volts of my specified output.

One annoying thing about the AMC33X6 series is that the output is fairly high frequency digital output. The output is basically is a 5-20Mhz square wave that needs to be measured synchronously with a CLKIN signal that also needs to be generated (at least on my board) by the micro. The digital output actually encodes raw ADC information in terms of duty cycle. The proper way to process this is with a digital filter (and who knows- maybe I’ll do that) but currently I am just decimating (averaging) it.

If this sounds like a job for some low level micro peripherals, you are right. Or if you think this is the perfect application for the raspberry pi PIO, you would also be very right. However, the rp2040 also has an entire 125MHz core that I wasn’t using, so instead of doing it the hard way, I did it the easy way and used the second processor to generate the clock signal and to read/process the data in.

This works reasonably well, and I’m ready to start developing the rest of the application for which I need this high voltage supply.


If you are interested in any of the specifics of this project, you can get the source here.

Posted in: ENG

3 thoughts on “Adjustable High Voltage USB PD Power Supply

  1. paulhoets says:

    Really, really, really cool. I wish I had the brains to design something so complex.

    Could it be taken up to 400V and made to sit there? Doing this would require uprating certain components, or woudk that be pushing the envelope a bit too far?

    • tequals0 says:

      400V would be possible with some upgrades- specifically the output capacitors and maybe the diode on the output side. The capacitors are only rated to 400V, and the diode only to 600V, so the maximum output voltage is around 600V, but this will quickly cause the capacitors to pop open and let the magic smoke out. I know this from some overvoltage experiences during bringup.

      However, in retrospect, I’d recommend a flyback with feedback from the secondary side. It would be a lot easier to keep it running nicely. I probably won’t make one of those any time soon since my goal is to explore some electrowetting stuff vs. making an nice power supply.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s