USB type-C power meter

A low-cost ($20) bidirectional USB-C power meter 5-20V 0-5A

Similar projects worth following
Because I'm trying to enter into the world of USB type-C products, I needed something convenient to do quick power checks on my products (and anything plugged into it). Unfortunately, there literally exists nothing on the market with specified accuracy and precision. The only offerings on the market are 'hey, it measures something' - not really satisfactory for debugging purposes. So I designed my own. As an added challenge, I tried to go the low-cost route and did some massive cost optimization, which ended up being way more fun than I thought it would be. If you are interested in design for manufacturing, I really recommend watching my first video on this project!

I'm really trying to go for broke here and design the meter to accept any USB configuration:

  • Fully USB type-C connection compliant; it has full routing of all the data lines, and it is transparent - i.e. it just acts like a wire, not blocking or distorting any data transmission.
  • One plug and one socket, so can be put in-line with any type-C connection
  • Compatible with all power specs, including PD, up to 5A and 20V
  • Accumulates up to 500Ah and up to 5000Wh of power on the display
  • Can run for days without overflowing, i.e. great for long-charging batteries
  • Did I mention it is bidirectional? It has little arrows saying which direction the current flows in.
  • 5-digit readout with effective 18-bit precision (measured precision better than 1mV and less than 0.5mA!)
  • 1% accuracy over the entire range

  • 1 × Atmel SAM D09 The microcontroller doing the grunt work
  • 1 × LM385 reference
  • 1 × INA213 current shunt amplifier
  • 1 × Aliexpress 128x64 OLED display

  • Correction to previous log

    mux08/21/2017 at 05:41 0 comments

    I was notified that the link I put in the previous project log is broken, it's supposed to be:

  • Revision 1 finally done (and for sale)

    mux08/07/2017 at 12:13 0 comments

    Revision time! A little while ago I uploaded a video where I worked on the revision 1 schematic and layout, and after quite a long wait for the displays as well as about 2 weeks of on-and-off coding on the firmware, it's finally finished. 

    As it turns out, the MOSFET and resistor approach I used to calibrate the input offset of the current shunt amplifier was not really ideal. The resistor I used to short out the amplifier was actually introducing an additional (significant) error, so I've done a bunch of testing to find out how to salvage this anyway. I ended up having to change out the resistor and MOSFET to both be lower-resistance, which fortunately got them completely in-spec. 

    Also, shipping times from China are very variable. Whereas my first couple of OLED displays were here within a week, this shipment took a month. I hate sourcing from China for this reason, it's so hard to plan products.

    Anyway, here's a little update video and if you like the project, check out the schematic and documentation on

View all 2 project logs

Enjoy this project?



K.C. Lee wrote 09/10/2019 at 18:04 point

>5-digit readout
>1% accuracy over the entire range

You realize that 1% accuracy gives you only 3 digits (or less) that are reliable.
i.e. for a count of 100, the last digit is within +/- 1 and it get worse from there.

So you have at most 2-3 digits of good values and the other 2 are not.

  Are you sure? yes | no

mux wrote 09/10/2019 at 18:06 point

I'd highly recommend reading the Wikipedia articles about accuracy and precision - because those aren't the same thing!

  Are you sure? yes | no

K.C. Lee wrote 09/10/2019 at 18:10 point

While you can distinguish the individual levels, your reading are way off from the standards.  See significant digits on wiki.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates