SmartUPS is Uninterruptible Power Supply & Portable Power for
Raspberry Pi. SmartUPS runs on 3 AA NiMH rechargeable batteries.
Connections
1) Power connection (micro-USB):
For input power connect a MicroUSB cable from mains power to
connector 1 in picture above.
2) USB host connection:
Connect a MicroUSB cable from your Pi to USB host connector on
SmartUPS. (at connector labeled 2 in picture above).
3) Data connection:
Connect I2C Access Point Board on GPIO pins of
your Pi, (as shown in adjacent picture) and
connect the 4-pin colored wire from the i2c
connector of that board to i2c connector of
SmartUPS (at connector labeled 3 in picture
above).
SmartUPS
User Guide
Button and LED Indicator
4) Press Button:
This button can be used to power SmartUPS on and off. The button
clicks can also be read by your Pi over the I2C interface.
5) LED indicator
LED will blink to show status of the SmartUPS. See LED indications
below.
Connect the cables as mentioned above and insert 3 AA NiMH
rechargeable batteries**.
Power ON:
Press the button (labeled 4 in picture above) to power on the
SmartUPS. Button must be pressed to send output power and I2C
communication to Raspberry Pi anytime the LED flashes red, green,
and blue upon startup.
Power OFF:
Hold and press the button for about 4 seconds. The LED will start
blinking at about 1 second interval indicating power will be turned off
soon. (It will blink for about 2 minutes before powering off the Pi).
Automatic startup and shutdown options can be configured. See
Startup and Shutdown options below.
** Currently supported chemistry: NiMH
LED indications
FlashingMeaning
Red, Green, and Blue SmartUPS is starting up and button must be pressed
once to initialize I2C communication and send output
power.
White occasional
blink
Blue occasional blinkNormal operation, battery is being charged.
Yellow occasional
blink
Red fast blinkSmartUPS is in shutdown mode.
White blink on Power ONWhen SmartUPS is powered off, it will blink once to
Green blink on ClickWhen SmartUPS button is clicked (single click or
Red occasional blinkBattery internal resistance is high (battery is going
Red fast blinkBattery is very bad, and won't last long for UPS.
Normal operation, battery is full.
Normal Operation, battery is being drained.
acknowledge change in power state.
Double click), it will blink once to acknowledge.
bad).
Red steady lightFAULT (Battery is dead or missing, or thermistor
missing, etc). The SmartUPS will still deliver power
to Pi, if connected to mains, but won't operate as
UPS.
Button Clicks
You can
configure
Rapsberry Pi to
execute a
command on specific number of button clicks. For example, if you
want to take a picture with your PiCamera you can configure
appropriate command in upspanel for a number of button clicks (up to
three). Any time you simultaneoulsy click for that set number, you
will take a picture.
1 ClickStart the output power if turned off/ User
defined command from upspanel.
2 Clicks User defined command from upspanel.
3 Clicks User defined command from upspanel.
Hold (for about 2 seconds) LED starts blinking fast Green,indicating
shutdown approaching in 50 seconds. (at this
point SmartUPS issues a shutdown command
to Pi).
Hold longer (about 6
seconds)
LED turns solid Red, and as soon as you let go
the button it shuts down power to Pi.
Startup and Shutdown Options
The startup and shutdown
options can be configured by
the upspanel GUI or by
changing the SmartUPS.cfg
file found in /etc/SmartUPS
on your Raspberry Pi.
**Configured options will only
work if the I2C cable is
connected.
**Start up options are designed for automated operation. When
SmartUPS is manually shutdown (by pressing and holding the button
until it power's off), upon power restotation to SmartUPS, you will
have to press the button to power up your Pi.
Power up Immediately Raspberry Pi will power up automatically as
soon as the it receives power from
SmartUPS.
Power up on Battery Stable Raspberry Pi will power up automatically when
the battery status becomes stable.
Power up on Battery FullRaspberry Pi will power up automatically when
the battery is fully charged.
No Auto Power upRaspberry Pi will not power up automatically
Shutdown Options
Shutdown TimeRaspberry Pi will shutdown automatically after
a user defined time once the main power is
disconnected from the SmartUPS. A value of
0 (zero) will not shutdown the Raspberry Pi
until the battery status reaches 'Critical'.
VerboseThe SmartUPS will display a message through
command prompt every minute of the
shutdown process
QuietThe SmartUPS will not display messages
during the shutdown process
Programming for SmartUPS
Python Programming Interface
Python class for user programs, with interface to driver.
DownloadSmartUPS package from http://pypi.python.org
Power Characteristics
Standby time: about 500 hours with standard batteries.
Input voltage: 4.5V-5.3V (charger voltage)
Input current: 0-1.2A (charger current)
Output voltage: 5.00V
Output current: 0-1.5A
I2C pins used
I2CAPB board uses i2c clock and signal pins as follows:
On Rev 1 board – Pin 0 and Pin 1
On Rev 2 board – Pin 2 and Pin 3
The SmartUPS appears as a set of registers as follows:
RegisterReadWrite
0x000x07
0x080x0f
0x100x17
0x41Command
0x42Restart option
0x43Button click status
0x44Restart time
0x46Battery state (See battery
0x48Battery current
0x4ABattery voltage
0x4CBattery capacity
0x4EEstimated battery time
0x50Battery temperature
0x51Battery health
0x52Output voltage0x54Output current0x56Battery maximum capacity
0x58Seconds
Firmware version –
Vendor Id –
Device ID – SmartUPS-
states for more info.)
Openelec
Vxxxx
-
-
Supported I2C Commands:
CMDHexDescription
S0x53Shutdown the SmartUPS in 10 seconds.
These commands are issued on command register (0x41).
UPSPanel Headings:
The upspanel gives multiple outputs:
HeadingDescription
HeartbeatTick count lets user know the I2C connection is
Driver VersionVersion of the driver.
Device VersionFirmware version of the device.
Battery VoltageVoltage of the battery.
Battery CurrentCurrent of the battery. If reading is negative, battery
is discharging; if reading is positive, battery is charging.
CapacityBattery capacity. SmartUPS is learning this information
and data will become accurate once battery cycle is
complete (full charge to full discharge)
Time RemainingTime remaining until battery is fully discharged.
SmartUPS is learning this information and data will
become accurate once battery cycle is complete (full
charge to full discharge).
HealthLife Health of the battery. Not charge percentage.
ChargingCharging state of the battery. See 'Battery States'
section below for more information.
Battery
Temperature
Battery temperature in celcius
Battery States:
Idle – SmartUPS is figuring out the battery status
Precharg – SmartUPS is conditioning batteries for charging
Charging – battery is charging
Topup – battery is begin topped off (think fluids in a car)
Charged – battery is fully charged
Discharging – battery is discharging
Critical – battery is very low and will go into shutdown mode if not
charged
Discharged – battery is fully discharged
Fault – battery is dead or missing or thermistor is missing
Daisy chaining SmartUPS:
You can daisy chain multiple SmartUPS via the USB ports. I2C
connections are only needed for the one closest to your Pi.
Upgrading SmartUPS firmware:
SmartUPS firmware is upgradeable through the Raspberry Pi.