USB-C Energy Metering with the ChargerLAB KM003C: A Google Twinkie Different?


The previous few years have seen a rise in adoption of the USB Sort-C connector. It has concurrently been accompanied by further technological improvements on prime of it. This has created a necessity for gadgets and instruments to watch the communication over the connector – particularly, the facility supply (USB-PD) facet. Whereas expensive USB protocol analyzers fulfil the requirement of firms concerned in silicon improvement and low-level {hardware}, these are impractical for individuals trying to optimize their microcontroller initiatives, hobbyists, lovers, and even finish customers.

The Google Twinkie (developed in 2014) was the unique USB-PD Sniffer. Since then, many gadgets have tried to copy at the least a few of the performance in a extra user-friendly method. Nevertheless, none of them had been capable of match the Twinkie’s flexibility for superior customers. Not like the Twinkie, the designs additionally interfered with common information visitors whereas monitoring the facility switch. ChargerLAB’s KM003C is without doubt one of the newest premium options within the checklist, and it ticks lots of the containers that different options don’t. In reality, it goes one step additional than the Twinkie by supporting the EPR specs additionally (Prolonged Energy Vary, as much as 240W).

One of many key benefits of the Google Twinkie is the supply of a shell over a serial port by which the operation may be configured. This enables finish customers to develop customized scripts and purposes for monitoring varied parameters. At AnandTech, we’ve been utilizing Plugable’s USBC-TKEY (a model of the Google Twinkie for the retail market) to trace the facility consumption profile of bus-powered USB gadgets since 2016. After 7+ years of service, the USBC-TKEY had began to point out its age, prompting us to be looking out for another. After wanting on the specs of the ChargerLAB KM003C, we determined to take a punt and bought one to see if it may change the USBC-TKEY in our workflow.

ChargerLAB gives a Home windows-only closed-source software to show the superior options of the KM003C (past what’s offered within the show on the gadget). The corporate additionally gives documentation for his or her APIs in Chinese language. This overview takes an in depth take a look at the options of the ChargerLAB KM003C. It additionally particulars our makes an attempt to make use of their APIs to copy the Google Twinkie performance for AnandTech’s use-case.

Introduction and Product Impressions

The USB specs have been topic to speedy updates for the reason that introduction of the Sort-C connector. Knowledge charges have been rising and the most recent variations even enable encapsulation of PCIe visitors. On the identical time, the USB-IF additionally foresaw the necessity for flexibility in transmitting completely different quantities of energy from the host to the gadget and vice-versa. In direction of this, the USB-PD (energy supply) specs had been additionally developed. The newest revision – USB-PD 3.1, brings assist for 140W, 180W, and 240W energy ranges. The PD specs have additionally allowed for energy transmission both from the host, or the gadget. All these capabilities are enabled by an influence supply handshake course of between the gadgets on both facet of the cable. As the facility supply requirements evolve in each capabilities and suppleness, a necessity has come up out there for gadgets that may present suggestions to the customers and builders on the PD handshake course of and its outcomes.

USB protocol analyzers additionally embody assist for analyzing the PD handshake course of. Silicon and low-level {hardware} builders do use them, however they’re normally extraordinarily expensive (as a result of additionally they assist the tracing and debugging of the high-speed information transfers). The PD handshake course of is at a comparatively sluggish velocity (round 300 KHz) over the CC (management channel) wire, and would not require high-speed sign monitoring. There are a lot of low-cost gadgets out there that faucet the CC1 and CC2 pins to offer info on the PD handshake course of to the tip person.


Energy supply sniffers additionally want to watch the voltage and currents on the VBUS and VCONN pins. Superior sniffers enable for the injection of energy supply packets on the CC pins and likewise inserting the termination resistances. From an influence measurement perspective, the attention-grabbing ones are the VBUS and VCONN. The previous carries bus energy for gadgets (and, in some circumstances, for the circuitry within the cable itself). The voltage could fluctuate from 5V for typical USB 2.0 hosts / gadgets to as much as 48V for USB-PD situations. VCONN, alternatively, is at all times set to 5V and might provide as much as 1W of energy for circuits inside the plug. These circuits can implement electronically marked cables and even be equipment.

The pin-out diagram above exhibits the D+ / D- differential pair that’s used just for USB 2.0 visitors. An inline energy supply sniffer may choose to chop out the trail, eliminating USB 2.0 information switch path utterly. The identical might be executed for the TX / RX pairs liable for the upper velocity information visitors in USB 3.x / USB4 / Thunderbolt 3+. Whereas there are some professional use-cases for permitting solely energy switch by way of the USB cable, most customers using an inline energy supply sniffer need information visitors to be untouched. Sadly, a majority of the low-cost sniffers out there take the simple means out by utterly ignoring the info switch path.

ChargerLAB KM003C Package deal Contents and Function Set

The ChargerLAB / Energy-Z KM003C is marketed primarily as a USB PD tester, and is available in a non-descript field. The rear label gives the high-level specs when it comes to supported voltage and present vary, in addition to quick charging protocols. Contact particulars for assist and enterprise points are additionally supplied.

Contained in the bundle, we’ve an aluminum storage field with the PD tester positioned inside a foam cladding for defense when the unit shouldn’t be in use. The Sort-C male port additionally has a safety cap. QR codes with hyperlinks to ChargerLAB’s YouTube and Telegram channels are supplied in an accompanying enterprise card.

The ChargerLAB / Energy-Z KM003C is an inline gadget positioned between the downstream dealing with port (DFP) of a bunch and the upstream dealing with port (UFP) of a tool. Both part can act because the supply and sink when it comes to energy supply. It’s used for voltage and present detection, energy supply functionality testing, cable testing for e-markers, quick charging protocols detection, and different such checks.

The KM003C itself is a cuboidal piece of aluminum (measuring 36.5mm x 35.5mm x 8.7mm, weighing in at 16.5g) with a Sort-C male port because the UFP, and a Sort-C feminine port because the DFP. It’s outfitted with a vibrant 240 x 240 1.54″ IPS display that gives actual time info on the VBUS, IBUS, energy consumption, charging protocol (if relevant), and voltages on completely different strains within the connector. The product can be outfitted with a Sort-C HID port that can be utilized to interface it with a PC for information recording and additional evaluation. There are bodily buttons on the product that enable the person to navigate the menus, configure varied testing parameters, set sampling charges, and so on.


Bodily buttons on the KM003C (the HID port is on the face reverse to the buttons)

The KM003C can carry out some fundamental operations with the facility provided by way of the VCONN line, nevertheless it requires connection to energy by the HID port for full-fledged operation. The everyday energy consumption of the KM003C itself is round 75 – 250 mW. It additionally features a supercapacitor that permits for a protected shutdown (guaranteeing that information in flight is flushed out to everlasting storage) and the show to stay energetic for round 5 seconds after the facility is disconnected.

ChargerLAB additionally bundles a closed supply Home windows-only software program to graph and retailer the recorded parameters on a PC for additional processing.

ChargerLAB KM003C vs. Plugable USBC-TKEY

The Google Twinkie / Plugable USBC-TKEY and ChargerLAB KM003C are conceptually related in that they’re each USB PD sniffers / testers. Nevertheless, the variations are proof to the developments made within the USB area between 2014 and 2022, and likewise mirror the evolution of end-user necessities on this area.

The important thing distinction lies within the energy specs. The Google Twinkie / Plugable USBC-TKEY can assist solely as much as 20V / 5A on the VBUS strains because of the limitations of the digital energy monitoring ADC chip getting used. The KM003C can assist as much as 50V / 6A (full USB-PD 3.1 specs, with EPR as much as 240W).

The usage of a more moderen ADC chip has enabled elevated measurement accuracy within the KM003C as in comparison with the Google Twinkie / USBC-TKEY. The INA231 used within the latter has a 16-bit ADC and a voltage measurement step measurement of 1.25 mV. The INA228 within the KM003C has a 20-bit ADC and a voltage measurement step measurement of round 0.2 mV. The INA228 additionally contains temperature monitoring (and that’s obtainable by way of APIs and the show display on the KM003C).

The Twinkie was designed primarily to be used with Chrome OS, and consequently, its retail variations such because the Plugable USBC-TKEY assist solely Linux. TotalPhase provides the TP350110 based mostly on the identical {hardware} because the Twinkie. It comes with modified firmware and drivers that assist each Home windows and MacOS, together with prolonged APIs and a customized information processing software at a steep premium. The KM003C helps solely Home windows formally for the connection by the HID port, and their information processing software program can be Home windows-only.

The Twinkie / USBC-TKEY has a CLI shell accessible over a USB serial port and comes with assist for a selected set of instructions (like ‘tw vbus’ and ‘tw vconn’ for studying the voltage and present on the VBUS and VCONN strains, ‘tw res param1 param2’ for putting resistors on the CC strains – Rp / Rd / Ra), and so on.). The KM003C is accessible over the HID port and is receptive to instructions, however these are customized encodings with out an interpretation layer within the center.

The Twinkie / USBC-TKEY can act as a sink and inject energy supply packets to make the host / supply negotiate a special energy supply contract. That is additionally obtainable within the KM003C when utilizing the cable simulation and charging protocol detection characteristic, however doesn’t appear to be uncovered by way of the APIs (to the perfect of my understanding).

The Twinkie / USBC-TKEY can arrange or take away resistors on the CC lines with a purpose to configure the related port as both UFP or DFP. The KM003C appears to have a similar functionality for the Rd alone. Once more, this doesn’t appear to be uncovered by way of the APIs.

The subsequent part talks concerning the {hardware} design and software program capabilities. It’s adopted by a dialogue of the API assist and learn how to use them on each Linux and Home windows. After adapting our direct-attached storage movement to assist energy monitoring from each USBC-TKEY and KM003C, we recorded some outcomes from each meters. We offer some comparisons of these outcomes earlier than continuing to the concluding remarks.

Leave a Reply

Your email address will not be published. Required fields are marked *