meta data for this page
  •  

Power measurement tutorial with Hard Kernel power meter

PARTS NEEDED

  • A. Hardkernel SmartPower power meter
  • B. Power supply
  • C. PC computer
  • D. ESP32 Plus controller board
  • E. Special USB-C cable to connect board to the power meter
  • F. Two regular USB-C / USB-A cables

After connected together the setup should look like this:

HARDKERNEL SMARTPOWER LAYOUT

  • A. Screen
  • B. Options menu
  • C. Power LED
  • D. Alive LED
  • E. Output channel 0 (left) on / off
  • F. Output channel 1 (right) on/off
  • G. UI selector, push to select
  • H. USB-C connector to PC
  • I. Channel 1 power connectors
  • J. Channel 0 power connectors
  • K. Power supply connector

PREPARATIONS FOR THE POWER METER

  1. Connect the power supply to the meter
  2. Connect the meter to a PC machine via USB-C cable (should be seen as “CP2102N USB to UART Bridge Controller” in Windows machines)
  3. Download and install CP210x driver for virtual COM port from: https://www.silabs.com/developer-tools/usb-to-uart-bridge-vcp-drivers?tab=downloads
  4. Download and install PuTTY SSH and Telnet client from: https://www.putty.org/
  5. Check the virtual COM port from the Windows device settings
  6. Open PuTTY and setup the connection
    1. Session → Connection type: Serial
    2. Session → Serial line: COMX (X = the number of the virtual serial port)
    3. Session → Speed: 115200
    4. SSH → Serial → Flow control: None
    5. Session → Logging → Session logging: All session output
    6. Session → Logging → Log file name → Browse button: Select suitable output folder for log file, set file name as Measurements&D&T
    7. Session → Saved sessions: Input name for your setting and click “Save” to use store the settings
    8. Click “Open”
  7. If everything is working correctly, you should now see measurement data coming from the meter in the PuTTY terminal window

PREPARATIONS FOR THE ARDUINO ENVIRONMENT

  1. Connect the ESP32 Plus board to a PC via USB-C cable (detach the power meter cable if needed)

GATHERING THE MEASUREMENT DATA

  1. Have a stopwatch, pen and paper ready!
  2. Connect the power supply to the meter
  3. Adjust output channel 0 (left connectors) settings to USB 2.0 values (5.0V, 0.5A)
  4. Connect the ESP32 Plus board to the power meter via modified USB-C cable
  5. Connect the power meter to a PC via normal USB-C cable
  6. Open PuTTY, load the setting stored in the preparations stage and open the terminal connection to the meter
  7. Activate the left output channel (channel 0) from the power meter
  8. Use the stopwatch, pen and paper to manually log the key events during the testing (activation / de-activation time of the board, trigger times for the sensors etc.)! This helps you later to analyze the results
  9. When the testing session is done, de-activate the left output channel
  10. Close PuTTY window
  11. If everything went well, you should now have a new log file (e.g. MeasurementsXX) in the folder you selected in the PuTTY settings

ANALYZING THE MEASUREMENT DATA

  1. Open the log file in a text editor
  2. Delete non-data rows from the beginning and the end of the file manually
  3. Import the file into Excel as csv / text file
  4. Replace the header with the following information: Time (ms), In (mV), In (mA). In (mW), In (on/off), C0 Out (mV), C0 Out (mA), C0 Out (mW), C0 Out (on/off), C0 Out Intr, C1 Out (mV), C1 Out (mA), C1 Out (mW), C1 Out (on/off), C1 Out Intr, Checksum8 S2, Checksum8 XOR
  5. It might be a good idea to add one more column where you calculate the elapsed time from the start of the measurement in seconds
  6. Now you can play with the data! Create at least the following scatter plots: 1) Time (ms) vs. C0 Out (mV), 2) Time (ms) vs. C0 Out (mA), 3) Time (ms) vs. C0 Out (mW)
  7. You can now analyze the plots by using the event times from the manual test log

READ MORE