SmartPower3

Introducing the easy way to make a “Green” platform. The ODROID Smart Power3 is an easily deployable power supply that collects voltage, current, and power of the attached system load allowing developers to optimize energy consumption. The LCD shows voltage, current, and watts simultaneously. Additionally, the measurements can also be sent to a PC via the USB interface.

Specifications

Output Channels Two output channels (Max 50W + 50W)
Output Voltage DC 3.0 V ~ Input voltage -1 V
Output Current DC 3A (Max) per channel
Measurement Voltage, Current, Watt : Maximum sampling rate : 200Hz (5msec interval)
Tolerant 3% typical (above 5V 1A)
MCU ESP32-WROOM-32E
LCD 480×320 3.5“ TFT LCD IPS grade wide viewing angle A
LED RED(Power), BLUE(Alive) C, D
Button ON/OFF/Menu/Cancel, Output Channel On/Off B, E, F
Encoder Button Select/Setup G
Encoder Dial Adjust Voltage and Ampere
USB-C port Data communication with PC (5ms ~ 1s sampling rate), F/W Upgrade H
Output Terminal 4mm diameter banana jack x 2 J, I
Input Voltage DC 9V ~ 21V K

Components

PACKAGE INCLUDES :

  • ODROID Smart Power3
  • USB-C data cable
  • DC plug cable(5.5mm/2.1mm) x 2(L type/S type) for ODROID-XU4/ODROID-N2/ODROID-C4

REQUIRED (NOT INCLUDED) :

  • Power supply unit
    • 15V4A Power supply (AU, EU, KR, UK, US) or 19V7A Power supply

How to use SmartPower3

The interrupts of SmartPower3 are generated from buck converter(STPD01).

Please refer to the STPD01 datasheet for more details.

O.P (Overvoltage Protection)

The protection is triggered when the voltage sensed on the VSNS pin rises over the OVP threshold.

S.P (Short-circuit Protection)

The protection is triggered when the output voltage is under the SCP threshold and the Ipk threshold is detected. The device acts by suddenly switching off both HS and LS MOSFET. The device follows a soft-start procedure after 300 ms with default output voltage value.

T.P (over Temperature Protection)

The protection is triggered when the internal temperature is over the OTP threshold and the device acts by suddenly switching off both HS and LS MOSFET

T.W (over Temperature Warning)

This interrupt is just the alarm at temperature 145-celsius degree.

I.P (Inductor Peak current)

The condition is checked cycle-bye-cycle on the high-side and triggered once the current cross the IPK threshold.

You can collect power data of two channels and the interrupts such as (OTW)Over Temperature Warning via Serial communication on SmartPower3.

Hardware Requirements

  • SmartPower3
  • Type-C USB cable
  • Host-PC

Setting Serial logging

After connecting SmartPower3 to your Host-PC through the Type-C cable, you should enable “Serial Logging” with baud rate and interval.
First of all, change to the setting screen with “Menu/Cancel” button. After that move to “Serial Logging” section with the dial and set the baud rate and interval with the dial button as following gif image.

When the logging is enabled, you can see the green log icon in the top right corner on the LCD.

Run serial application on your HOST-PC

There are many applications for serial communication. You can choose your preferred serial program.

The following picture is that I run “GNU screen” for serial communication on my Linux PC. “Gnu Screen” makes it easy to save as a file.

Logging Protocol

Total size : (75) () : size of character
Time Input Power Channel 0 Output Channel 1 Output Linefeeds
(10) (1) (5) (1) (4) (1) (5) (1) (1) (1) (5) (1) (4) (1) (5) (1) (1) (1) (2) (1) (5) (1) (4) (1) (5) (1) (1) (1) (2) (2)
time stamp(ms),volt(mV),ampere(mA),watt(mW),on/off,volt(mV),ampere(mA),watt(mW),on/off,interrupts,volt(mV),ampere(mA),watt(mW),on/off,interrupts '\n\r'

Interrupts

Bit Function Notes
0 Overvoltage protection
1 Constant current function
2 Short-circuit protection
3 Power-on
4 Watchdog
5 Overtemperature protection Junction temperatrue 165 Celsius
6 Overtemperature warning Junction temperature 145 Celsius
7 Inductor peak current protection

For example,

0001552821,15250,0398,00000,0,11966,0163,01954,1,0,04991,0623,03108,1,0

The firmware build date of Smartpower3 have to be “2021/Nov/26” or above. Please refer setting menu on your SmartPower3 to check the build date.

Hardware Requirements

  • SmartPower3
  • Type-C USB cable
  • Host-PC
  • WiFi router(2.4GHz)

Configuring an WiFi via serial port

First of all, you have to connect SmartPower3 with Host-PC via Type-C USB cable. And then, run your preferred terminal program.
The baud rate has to be the same as the value shown on your smart power3 setting menu.

For example, in Linux.

odroid@odroid:~$ sudo apt install minicom
odroid@odroid:~$ ls /dev/ttyUSB*
/dev/ttyUSB0
odroid@odroid:~$ sudo minicom -D /dev/ttyUSB0 -b921600

Enter a command mode in your SmartPower3

After that, type CTRL-C to enter into the command line mode in your SmartPower3. You can see the following menu in your terminal.

>>> WIFI Command mode entered <<<

[ WIFI Command mode menu ]
1. Connection AP Info
2. Scan & Connection AP
3. WiFi Command mode exit
Command : 

Scan and connect

Select number 2 menu and connect with your WiFi router. You can show the ”WiFi Icon“ in setting menu including IP address.

Get power data with telnet

In order to log via telnet, you need to set up an interval in setting menu.

Run telnet

When WiFi configuration is okay, run telnet in your Host-PC.

odroid@odroid:~$ telnet 192.168.30.2
Trying 192.168.30.2...
Connected to 192.168.30.2.
Escape character is '^]'.
0001168723,15291,0051,00779,0,05033,0000,00000,1,00,05219,0000,00000,1,00
0001168733,15291,0054,00825,0,05033,0000,00000,1,00,05218,0000,00000,1,00
0001168743,15282,0061,00932,0,05031,0000,00000,1,00,05218,0000,00000,1,00
0001168753,15279,0068,01039,0,05031,0000,00000,1,00,05220,0000,00000,1,00
0001168764,15279,0074,01130,0,05031,0000,00000,1,00,05222,0001,00005,1,00
0001168773,15283,0079,01207,0,05031,0000,00000,1,00,05218,0001,00005,1,00
0001168783,15281,0087,01329,0,05028,0000,00000,1,00,05221,0001,00005,1,00
0001168793,15287,0087,01329,0,05031,0000,00000,1,00,05219,0000,00000,1,00
0001168804,15287,0080,01223,0,05031,0000,00000,1,00,05218,0000,00000,1,00
0001168814,15287,0080,01223,0,05031,0000,00000,1,00,05218,0000,00000,1,00
0001168823,15288,0072,01100,0,05031,0000,00000,1,00,05219,0000,00000,1,00
0001168833,15289,0067,01024,0,05031,0000,00000,1,00,05219,0000,00000,1,00

Hardware (Schematics & Data sheet)

This file is the full schematics of the ODROID Smart Power3.

smartpower3_pdf.pdf

ODROID Smart Power3 Gerber(Kicad) File : smartpower3.zip

MCU(ESP32-WROOM-32E) : esp32-wroom-32_datasheet_en.pdf

TFT-LCD Controller : ILI9488%20Data%20Sheet_100.pdf

Programmable Buck Converter(STPD01) : stpd01.pdf

USB to UART Converter(CP2102N) : CP2102-9.pdf

Three Channel Power Monitor(PAC1933) : PAC1931-Family-Data-Sheet-DS20005850E.pdf

DC/DC Step-Down Converter(MP2482) : MP2482.pdf

Adjustable LDO Regulator(RT9179) : DS9179-11.pdf

Digital Pressure Sensor(BMP280) : bst-bmp280-ds001.pdf

Why we had to disable the current sensing feature of the PMIC

The STPD01 PMIC of the SmarPower3 has a current sensing input pin which can limit the output current. The maximum current is limited at 3Amp according to the datasheet.
But the PMIC is too much sensitive and it does shutdown the output power when the output current is slightly over 2.4Amp regardless of the output current settings. .

The major purpose of SmartPower3 is to supply stable power to the ODROID boards well.
For examples, ODROID-XU4 peak(short period) current is around 3.2Amp at 5 Volt when we use the board with some power hungry USB devices.
Therefore, we couldn't make the XU4 board boot stably when we implemented the current sensing feature on a SmartPower3 prototype sample.

To overcome the instability problem, we had to remove the current sensing feature from the mass-production version of the SmartPower3. Although the maximum current output has 3A in STPD01, the inductor current limit has 5Amp to make it more stable and robust.
We have been testing the circuit with continuous 3.5~4Amp of full load over a couple of months and there was no issue.
If SmartPower3 will be used with generic single board computers, there will be no problem.
Since the thermal protection circuit feature is still working nicely, you can safely keep using the SmartPower3 with various load conditions.

Software

2021/Nov/26

Summary

2021/Nov/03

Summary

  • #1 Reading moving average current values from PAC1933
  • Optimized “refresh” command for PAC1933
  • Remove unused constant current icon on UI
  • Remove fan control in setting

Thanks to @tomek-szczesny who raised an accuracy issue and gave us many ideas to make a more accurate power measuring.

2021/Oct/13

Summary

  • Initial Release Version (1st Production)

If you want to flash the latest firmware without building the source code, follow these instructions.

Windows

The instruction were tested on Windows 10. Some users reported it also worked on Windows 7.
You might need to install the USB-UART CP2104 VCP driver for Windows.
VCP driver for Windows
You need to check the COM port number with Device Manager.
Refer to this guide.

1. Get a Firmware image

2. Download ESP32 flash download tool

3. Connect your SmartPower3 to PC via Type-C USB cable

4. Run the ESP flash tool

5. Select ESP32

6. Erase

You must erase the flash of ESP32 before uploading a new firmware. Select parameters as shown in the below picture and check your COM port.
Then, click ERASE button.

Check COM port with Device Manager

ERASE

7. Import binaries and start to upload

Select .img file and input parameters as shown in the below picture and check your COM port.
Then, click START button.

Don't forget to reconnect an input power source for resetting the SmartPower3 manually after uploading.

8. Reconnect the input power source

Don't forget to reconnect an input power source for resetting the SmartPower3 manually after uploading.

Linux

1. Install the requirements

Open a terminal and run commands below.

sudo apt install python-pip
sudo pip install esptool pyserial

2. Get a Firmware image

Firmware release info : https://github.com/hardkernel/smartpower3/releases

wget https://github.com/hardkernel/smartpower3/releases/download/v1.5/smartpower3-firmware-20211103.img

3. Check your serial node

Connect your SmartPower3 to HOST-PC via Type-C USB cable. Then, you should check that your serial node is similar to ”/dev/ttyUSB0“ or ”/dev/ttyUSB1“
If have another serial device connected, you have to disconnect them on your Host PC first.

$ ls /dev/ttyUSB*
/dev/ttyUSB0

4. Run upload script

Type the following in terminal.

sudo esptool.py -p [usb_port] -b [upload_speed] write_flash [flash_address] [firmware_image]

Example

sudo esptool.py -p /dev/ttyUSB0 -b 921600 write_flash 0 smartpower3-firmware-20211103.img

Mac OS

Linux(platformio)

Install platformio

Get the Smartpower3 source code

git clone https://github.com/hardkernel/smartpower3
cd smartpower3
git submodule init
git submodule update

Compile & Upload

pio run --target upload
pio run --target uploadfs