accessory:power_supply_battery:smartpower3

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.

Any UPS or batteries are not compatible with SmartPower3.
If you want to use SmartPower3 with them, you should add diodes.
There is a use case of UPS in this forum link.

https://forum.odroid.com/viewtopic.php?p=340404#p340404

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

  • 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
  • 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.

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

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.

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

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

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

This protocol supports firmware Dec 14 2021 or above. If you use old firmware, please refer to this link.
old_protocol

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.

welcome to minicom 2.7.1

OPTIONS: I18n 
Compiled on Dec 23 2019, 02:06:26.
Port /dev/ttyUSB0, 18:41:50

Press CTRL-A Z for help on special keys

0000815169,15296,0036,00550,0,00000,0000,00000,0,00,00000,0000,00000,0,00,14,12
0000816107,15298,0038,00581,0,00000,0000,00000,0,00,00000,0000,00000,0,00,13,15

Logging Protocol

Total size : (74) () : size of character
Time Input Power Channel 0 Output Channel 1 Output checksum 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) (1) (2) (1) (2) (2)
(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 , CheckSum8 2s Complement , CheckSum8 Xor '\r\n'

The checksum

The checksums are determined by the sum of “Time”, “Channel 0 Output” and “Channel 1 Output”. The size is 74bytes.
https://www.scadacore.com/tools/programming-calculators/online-checksum-calculator/

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,

012346286,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,38,22

For example,

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

The TCP logging(telnet) on SmartPower3 was deprecated, please use UDP logging instead. In the case of TCP, the speed of SP3 slows down a lot while waiting for an ACK.

Logging with telnet on SmartPower3

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

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

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

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. Connection UDP client Info
3. Scan & Connection AP
4. Set IP address of UDP client for data logging
5. WiFi Command mode exit
Command :

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

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

Set IP address of your Host-PC include UDP port.

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.

Command mode menu : Firmware version v2.0 or higher
>>> WIFI Command mode entered <<<

[ WIFI Command mode menu ]
1. Connection AP Info
2. Connection UDP server Info
3. Scan & Connection AP
4. Set IP address of UDP server for data logging
5. Forget Connection AP
6. Forget UDP server IP address
5. WiFi Command mode exit
Command :
Command mode menu : Firmware version v1.9 or earlier
>>> WIFI Command mode entered <<<

[ WIFI Command mode menu ]
1. Connection AP Info
2. Connection UDP client Info
3. Scan & Connection AP
4. Set IP address of UDP client for data logging
5. WiFi Command mode exit
Command :

Select the number 4 menu and input the IP address of your UDP client and port. You can show the IP address and port in the setting menu.

Run netcat in your Host-PC.

odroid@odroid:~$ netcat -u -l 6000
012346286,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,38,22
012346297,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,36,22
012346304,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,41,29
012346315,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,3f,29
012346326,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,3d,29
012346332,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,40,2c
012346344,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,3d,2d
012346353,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,3d,2b
012346367,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,38,2c
012346376,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,38,2c
012346384,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,39,21
012346392,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,3a,26
012346407,19146,0086,01646,0,00000,0000,00000,0,00,00000,0000,00000,0,00,3d,2d
012346413,19143,0087,01665,0,00000,0000,00000,0,00,00000,0000,00000,0,00,41,2d
012346425,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,4a,2c
012346437,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,47,2f
012346444,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,49,2b
012346454,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,48,2a
012346466,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,45,2b
012346473,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,47,2f
012346484,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,45,27
012346496,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,42,24
012346503,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,4d,29
012346514,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,4b,2f
012346525,19143,0090,01722,0,00000,0000,00000,0,00,00000,0000,00000,0,00,49,2d
012346537,19143,0087,01665,0,00000,0000,00000,0,00,00000,0000,00000,0,00,3a,2a
012346544,19143,0083,01588,0,00000,0000,00000,0,00,00000,0000,00000,0,00,3c,2a
012346556,19143,0083,01588,0,00000,0000,00000,0,00,00000,0000,00000,0,00,39,29

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

Download : Firmware image smartpower3-20230518-v2.2.zip

md5sum (smartpower3-20230518-v2.2.zip) : 61caa684a2281d29991c3de9120bcf7a

Download : Release Source code smartpower3-20230518-v2.2-src.tar.gz

Summary

  • Improved readability by reorganizing the setting screen and changing the font.(Change the font ChewyRegular24/32 to NotoSansBold20.)
  • Removed unusable voltage step values.
  • Optimized the source code.

Thanks to @cedel1 for contributing the source code.

Improved readability
Reorganizing settings screen
Before (Font : ChewyRegular24/32) After (Font : NotoSansBold20)

IMPORTANT: If serial logging is not enabled, WiFi UDP data will not be output even if WIFI logging is enabled.

Download : Firmware image smartpower3-20230418-v2.1.zip

md5sum (smartpower3-20230418-v2.1.zip) : f5dfd43d4361d5e5ed8fd776967bef29

Download : Release Source code smartpower3-20230418-v2.1-src.tar.gz

Summary

  • Independent switching of logging and WiFi connection
  • Logging/WiFi connection icon widget refactoring and source code optimization.

Thanks to @cedel1 for contributing the source code.

Introducing new features

Setting Serial logging and enable/disable (Toggle icon)

Setting WiFi(UDP) logging and enable/disable (Toggle icon)

IMPORTANT: If serial logging is not enabled, WiFi UDP data will not be output even if WIFI logging is enabled.

Download : Firmware image smartpower3-20230403-v2.0.zip

md5sum (smartpower3-20230403-v2.0.zip) : 2f841bf74e2a59d631770bd26092d7bb

Download : Release Source code smartpower3-20230403-v2.0-source.tar.gz

Summary

  • Improved power measuring stability with newer I2C driver.
  • Improved WIFI/UDP setup logic.(Added menu to forget AP/UDP settings)
  • Espressif32 platform version upgrade from @3.4.0 to @6.1.0
  • System library updates for platform version upgrades.
  • Fixed channel 1 log data missing bug.(Fixed channel 1 checksum calculation bug)

Thanks to @cedel1 for his help in resolving the issues.

Summary

Summary

Summary

Summary

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.

Summary

  • Initial Release Version (1st Production)

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

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.

1. Install the requirements

Open a terminal and run commands below.

host
sudo apt install python-pip
sudo pip install esptool pyserial

2. Get a Firmware image

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

host
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.

host
$ ls /dev/ttyUSB*
/dev/ttyUSB0

4. Run upload script

Type the following in terminal.

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

Example

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

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
  • accessory/power_supply_battery/smartpower3.txt
  • Last modified: 2023/05/18 18:02
  • by charles.park