
Sasa Karanovic has designed and built a DIY USB power Supply active load tester, that is available at GitHub:
USB Power supply Active Load Tester or short PAL Tester is unit designed for testing the quality of the power supplies.
Idea was to create low-cost, precise device for simultaneous measurement of Voltage and Current drawn from the device under test.
Project info at Sasa Karanovic blog.

He calls it a “PAL Tester”. Uh. The dinosaur in me can’t help but cringe a bit…
Hey – don’t get mad, get even. Design a slightly improved version and call it “New Tension Supply Characteristic (NTSC) Tester”… ;)
I’m open for suggestions if you have a better acronym. :)
There’s nothing actually wrong with anything, it’s just sorta generation gap.
Older folks know the television PAL and the chip PAL and would unlikely use PAL in this context.
But it’s the age of blogs, Twitter, and tons of branding on all sorts of boards, so you’ll get some grumbles from the odd dinosaur… ;-)
How about “PSU Tester” for short? The thing about short names is they never tell the whole story.
Might I make some suggestions, too?
UPSIDE Usb Power Supply actIve loaD tEster
BOYCOTT usB pOwer supplY aCtive lOad TesTer
BESIDE usB powEr Supply actIve loaD tEster
BOLIVAR usB pOwer suppLy actIVe loAd testeR
Dang rumburack, I want to have whatever you’re smoking! :-P
You are already using an I2C chip. Why not use an INA219 or similar to measure current and voltage and simplify a lot the circuit?
My local suppliers didn’t have any of them at stock, so for me it was a better option to purchase op-amp and few resistors than wait several weeks for parts to arrive.
Anyway, I agree, there are many ways to this and all of them should work just fine, for most people.
That makes sense. It’s a tradeoff between cost and performance. The INA225 is also a good choice, as is the PGA281. At their core, they’re just op-amps with precision feedback resistors, and you can build something equivalent piecemeal. However, the accuracy of the INA/PGA chips is difficult to attain with discrete parts. It’s possible to take that < 5% accuracy down to 0.3% or even better.
Rather than combine the PIC16F1829 and (difficult to source) CH340T, I would have been inclined to select something like the PIC18F24K50. It’s almost exactly the same price as the pair of chips, and you have more flexibility to customize the USB implementation.