PiJuice is a beautifully neat and feature-rich Uninterruptible Power Supply solution from Pi-Supply. Although we’ve had one for quite some time now, we’ve only just got around to trying it out.
PiJuice takes the form of a Raspberry Pi HAT. As such, it sits neatly on top of the Pi thanks to the 11mm nylon standoffs which come already attached to the PiJuice. One of the great features of the PiJuice is an integrated Real Time Clock. This, along with its onboard microcontroller, allows the Raspberry Pi to be cleanly shut down, and powered on again based on calendar/time events.
An extended GPIO header allows additional HATs to be attached on top of the PiJuice. Furthermore, because the I2C address of the PiJuice is configurable, it removes the potential problem of I2C address clashes with these other HATs.
Hardware set up for the PiJuice is simply a matter of mounting the PiJuice board on to the Raspberry Pi GPIO header, and is fully described in the excellent quick start guide. As mentioned previously, 11mm nylon standoffs attached to the PiJuice mean that it sits neatly on the Pi board. There is the option of installing a supplied spring (pogo) pin to connect the PiJuice to the ‘run’ pad on the Raspberry Pi. However, for most use cases this is probably an unnecessary complication.
It should be noted that, while the positioning of the spring ‘run’ pin supports many variants of the Raspberry Pi board (including the A+, Pi 2 B+, Pi 3 B, Pi Zero and Zero W), the current version of the PiJuice (at the time of writing) does not support the ‘run’ pin on the Pi 3 B+.
The PiJuice software installation pages describe the software setup process for the PiJuice. However, we did find that following this guide did not result in a completely satisfactory software installation. Thus, in order to install the full suite of software described in the PiJuice software guide, we found it necessary to carry out a number of additional steps.
Starting with a new Raspian Stretch installation, we booted our Pi 3 B+, and followed the initial setup steps. The June 2018 release of Raspbian Stretch includes a first-time setup which prompts the user to select, among other things, localisation options and a new user password. This first-time setup also upgrades all the Raspbian system program packages.
Once this first-time setup completed, we carried out the following steps to install the PiJuice software.
sudo apt-get update sudo apt-get install pijuice-gui
Following this, we then downloaded the PiJuice master repository from GitHub. This repository was then extracted to the /home/pi folder, using the Archiver tool. The resulting PiJuice repository folder had a folder name of PiJuice-master, which we renamed to PiJuice. All the required PiJuice software was thus located in the folder
The PiJuice software installation guide makes mention of a Python script that requires to be added to the cron table in order to re-enable the wake-up alarm function on the PiJuice following a system reboot. We found that this Python script would not run in its existing form, so modified this script as follows. The script line that imports the required libraries:-
import pijuice, time
required to be modified to:-
import pijuice, time, os
While the PiJuice is supplied with a 1,820 mAh BP7X Li-ion phone battery, a 4 pin screw terminal allows for larger capacity batteries to be connected. Furthermore, there are also solder pads on the PiJuice for a header to facilitate the connection of a solar panel or wind turbine.
It is suggested that the battery supplied with the PiJuice could support 4 to 6 hours of continuous running. This battery time will, of course, depend very much on the model of Pi with which the PiJuice is being used, and the type of use. With this in mind, Pi-Supply have provided a very useful battery discharge time calculator. In practice, we found that our Raspberry Pi 3 B+, under fairly light use, powered off just over 2.5 hours after we switched off the power supply.
Overall we think the PiJuice is a fantastic piece of kit, with many practical applications. We’re currently planning to try it out with a number of different Raspberry Pi boards. We’re also hoping to get our hands on some solar panels so that we can see how well they integrate with the PiJuice. The PiJuice hardware guide provides guidance on connecting solar panels and different types of batteries.