SmartPower2

SmartPower2 is a power-supply which has WiFi connectivity to control the voltage to and switch on/off a connected device.
You can also monitor the load current and power consumption remotely on your smartphone, tablet and PC.

Ver. korea

Where to buy

Specifications

WiFi MCU module ESP12E
Output InterfaceUSB Host, terminal block(+, -)
Terminal Block Output Voltage DC 4 ~ 5.3V in 100mV step
Terminal Block Maximum Output Current5A
USB Host Port Output VoltageDC 4 ~ 5.3V in 100mV step
USB Host Port Maximum Output Current1A
DC-Jack Input Voltage 9~15V
MeasurementVoltage, Current, Watt, Watt-Hour
Display16×2 I2C Character LCD
WirelessWiFi 802.11 b/g/n 2.4 GHz
Dimensions 52x46mm
weight 18g, 58g(with LCD)

How to use

0. Connect the included 15V/4A adapter and plug the output cable in the terminal block.
Ensure the DC plug cable is properly connected to negative(black) and positive(red).
Caution! if you plug it the other way, your board will be seriously damaged.

1. Output Power ON/OFF
You can turn the output power on/off using the tact switch on SmartPower2

2. Power monitoring with 16×2 LCD
We recommend connecting the LCD after disconnecting the main power source.

The webpage supports IE 11+, Edge 13+, Firefox 47+, Chrome 49+, Safari 9.1+, Opera 41+, IOS Safari 9.3+, Android Broswer 4.4+, Chrome for Android 53+

1. WiFi Connection

Default SSID : smartpower2, Password : 12345678

2. Access Web UI

Default webserver ip : 192.168.4.1

1. WiFi Connection 2. Access Web UI

3. Home

  • Seven Segments : voltage, ampere, watt, watt-hour.
  • ON/OFF slide : Output power ON/OFF.
  • Start/Stop slide : Watt-hour measurement Start/Stop.
  • Voltage slider : Change output voltage.
  • Save Default Voltage button : Set default voltage.

4. Settings

  • Auto Run checkbox - Output power ON/OFF automatically when you power on the SmartPower2.
  • Save Button - Save Network Configuration (SSID, IP Address, Password).
  • Reset Button - Initialize User Network Configuration (Factory reset)
3. Home 4. Settings

After connection with WiFi, you can get power data via telnet.
[Voltage],[Ampere],[Power],[Watt hour]

$ telnet 192.168.4.1
5.255,0.451,2.374,0.000
5.256,0.451,2.374,0.000

This feature is available in F/W v1.4 or later.

You can receive power data(current, voltage, power, watt-hour) from your SmartPower2 to your PC or ODROIDs through serial.
The serial output is available only when the output power is enabled.

Requirement Parameters

  • 115200bps 8N1
  • no-flow-control
1. Connect your SmartPower2 to PC via microUSB cable
2. Run Serial serial console program like putty or minicom
3. Enable power on
LEDStateDescription
PWR(D1)offInput power off
onInput power on
blinkOutput power on
WiFi Statusoffno WiFi connection
onWiFi connected
blinkWebpage loaded

After boot, press the ON/OFF switch for 5 seconds to reset all settings including WiFi.

Hardware

Schematic

Data Sheet

  • MCU - ESP8266 Espressif low power 32-bit MCU
  • USB to UART - CP2104 single chip usb-to-uart bridge
  • 3A 16V Stepdown - MP1495S High Efficiency 3A, 16V, 500kHz Synchronous Step Down Converter
  • Digital Potentional Meter - MCP4652 7/8-Bit Single/Dual I2C Digital POT with Volatile Memory
  • Current/Power Monitor - ina231 High- or Low-Side Measurement, Bidirectional CURRENT/POWER MONITOR with 1.8-V I2C Interface
  • 10A 18V Stepdown - MP8762 High Efficiency, 10A, 18V Synchronous Step-down converter

Software

Framework - Arduino, Jquery

Build Platform - Platformio

Simple instruction for Firmware upload.

Linux

1. Install the requerments

$ sudo apt install python-pip git
$ sudo pip install esptool

2. Get the binaries about firmware and web source

$ git clone https://github.com/hardkernel/smartpower2.git
$ cd smartpower2

3. Upload

You should check your esp8266 serial number like “/dev/ttyUSB0” or “/dev/ttyUSB1”

$ sudo esptool.py --chip esp8266 --port /dev/ttyUSB0 --baud 921600 write_flash 0x00000 prebuilt/firmware.bin 0x100000 prebuilt/spiffs.bin

Windows

The instructions were tested on Windows 10.

1. Get the binaries about firmware and web source

master.zip
And then, you need to extract the zip file on your work folder.

2. Download and extract the flash tool

3. Run the exe file into the folder

4. Select ESP8266

5. Start upload

You have to input binaries and other parameters as shown below picture.
COM port is variable depending on your PC environment.

This guide is working with x86 platforms only. The development tools are not available for ARM platforms.

Linux

1. Install PlatformIO

$ sudo apt-get install python-pip
$ sudo pip install -U platformio
$ platformio --version

If you have any issue while installing it, refer this guide.
http://docs.platformio.org/en/stable/installation.html

2. Get source code

$ sudo apt-get install git
$ git clone https://github.com/hardkernel/smartpower2.git

3. Build & Upload

Connect microUSB to Host PC.
You can see the list of USB drivers “CP210x UART Bridge” by lsusb in the terminal.

$ cd smartpower2
$ sudo platformio run
$ sudo platformio run --target upload
$ sudo platformio run --target uploadfs

Windows

1. Install platformIO

2. Get source code

master.zip

3. Install libraries

Install libraries with platformio library manager

  • Websocket(549)
  • Simpletimer(419)
  • LiquidCrystal_I2C(576)
platformio lib install 549 419 576

3. Build & Upload

Run CMD and move to the smartpower2 folder and Connect microUSB to Host PC.
You can see the list of USB drivers “CP210x USB to UART Bridge(COMx)” on the Device Manager.

$ cd /path/to/dir/smartpower2
$ platformio run
$ platformio run --target upload
$ platformio run --target uploadfs

"undefined reference to sqrt" error

If you have any errors such as the following.

/home/kyle/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib/libm.a(lib_a-w_sqrt.o):(.literal+0x8): undefined reference to `__ieee754_sqrt'
/home/kyle/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/lib/libm.a(lib_a-w_sqrt.o): In function `sqrt':
/xtensa/esp-open-sdk/crosstool-NG/.build/src/newlib-2.0.0/newlib/libm/math/w_sqrt.c:69: undefined reference to `__ieee754_sqrt'
collect2: error: ld returned 1 exit status
*** [.pioenvs/esp12e/firmware.elf] Error 1

Please try to replace the libm.a file in the “.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/lib/” after extract.

Refer to : https://github.com/esp8266/Arduino/issues/612

Release Date Version Description Git
January 22 2017 v1.1 Add console logging with telnet and make SSID unique to each device https://github.com/hardkernel/smartpower2/tree/v1.1
March 27 2017 v1.2 Fix the LCD display of watt hours, display volts and amps to three decimal places on the web interface.
February 12 2018 v1.3 Fix compile errors
May 28 2018 v1.4 Add receiving power data function through serial https://github.com/hardkernel/smartpower2/commit/429051d5ca11d7b898a0d01594be8bb01a703b4c

F/W upload tutorials

Release Note of F/W v1.4

  • You can receive power data(current, voltage, power, watt-hour) from your SmartPower2 through serial

Release Note of F/W v1.1

New features