USB Tester Pinout and Protocol

Updated: All Leave a Comment

Image
Image

Serial Output

{ "a":{ "max":1.20, "min":0.70, "avg":0.95}, "v":{ "max":5.00, "min":5.00, "avg":5.00}, "mah":0.01, "mwh":0.04, "shunt":0.07, "dp":1.06, "dm":1.08, "ram":1420, "time":24200}


  • Ampere

    A: - This consists of three parts. Max, Min, and Avg of current during the sample period.

  • Voltage

    V: - Consists of max, min and avg voltage readings during the sample period

  • mAh

    Total miliamp hour measured since last boot or reset by command or button.

  • mWh

    Total miliwatt hour measured since last boot or reset by command or button.

  • Shunt

    Shunt voltage (in mV) drop across the sense resistor which is used internally to calculate current.

  • D+ / D-

    This is the voltage reading of the USB differential data lines D+ and D-. Could be used to figure out charge modes for various devices.

  • Free RAM

    Shows the current amount of free SRAM available in the microcontroller. Mostly for debugging but could be useful for anyone wanting to customize the firmware. In FW2.3+ this is disabled.

  • *Runtime

    Current time in milliseconds since power up or reset.

JSON Serial Command Protocol

  • BAUD Rate

    Serial BAUD rate is 115200

  • R:XXXX - Serial Output Rate

    Send R:XXXX - X is time in miliseconds - Returns new set rate (Min is 150ms)

  • S:X - Set Screen

    Send S:X - X is screen number 1-5 - Returns new screen

  • Z: - Reset

    Send Z: - Resets all data - Returns 'OK' upon reset

  • W:XXXX - LED Threshold

    Send W:XXXX - X is current in miliamps - Returns new threshold for LED

  • V: - Verison

    Send V: - Returns current firmware version

  • *E:0 - Disable Events

    Stop sending event based serial packets

  • *E:1 - Set mA Threshold Event

    Start mA threshold serial packets. Threshold is set using W:XXXX command

  • *P:XXX - Set Percent Changed Tr igger

    Send serial packet on current percent change

  • *C:0 - Output Saved Settings

    Output currently saved settings in EEPROM

  • *C:1 - Load Saved Settings

    Load saved settings from EEPROM to running config

  • *C:2 - Save Settings

    Save settings to EEPROM

  • *D:0 - Disable Display

    Turn off updating display and clear. Good for long term logging.

  • *D:1 Enable Display

    Turn on updating display

*Note: Items with an * are only in firmware version 2.3+

Leave a Reply