Witty Pi is a new, reasonably priced ($16) add-on board for the Raspberry which provides a real time clock and power management features. This makes it ideal as a the base for a wide variety of projects. Its most promising feature is the ability to power up and power down the Pi using an integrated switch.
Shawn from UUGear very kindly sent me a Witty Pi board to try out. It’s a well made and good looking product with a HAT footprint. This allows it to securely sit on a Raspberry Pi Model A+ and B+ using the four mounting holes.
So lets take a look and see what it can do.
- Turn on/off the Pi with the on board switch
- Raspberry Pi and all its USB peripherals get fully powered down after shutdown
- Raspberry Pi keeps the correct time and date
- Schedule the startup/shutdown of your Raspberry Pi
The following video demonstrates most of these cool features :
Package Contents :
- Witty Pi board
- CR2032 battery x 1
- M2.5 x 11mm Copper Standoff x 4
- M2.5 screws x 8
- Dimension: 65mm x 56mm x 19mm
- Weight: 23g
- LED Indicator: One, for halt and stand by breathing
- Connector: 40-pin dual row 2.54 mm pitch female & male header
- Battery: CR2032 or CR2025 (for time keeping)
- Power In: DC 5V (via micro USB port or white power jack)
- Output Current: Max 2A for Raspberry Pi and its peripherals
- Static Current: < 10mA
- Operating Temperature: 0℃~50℃
- Storage Temperature: -20℃~60℃
- Humidity: 0~80%RH, no condensing
Installing the hardware is easy. Pop in a CR2032 coin cell and plug it onto the GPIO header. The board comes with four brass standoffs which can be used to firmly attach the device to the Pi via the four mounting holes found on the A+, B+ and Pi 2.
The board uses GPIO17 and GPIO4 but these can be changed using the onboard jumpers if required. This is a nice feature and gives you some options if you need these particular GPIOs for other hardware.
With the board attached to the Pi the power on switch feature will work straight away. When you shutdown the Pi the board will cut the power. For the other features (such as the RTC and timed shutdowns) you need to install some additional software.
Setting up the software is really easy due to the well written installation script. This can be downloaded directly to the Pi using :
Running the installation script is done with :
sudo sh installWittyPi.sh
This script will then :
- Enable I2C
- Install i2c-tools, if it is not installed yet
- Install wiringPi, if it is not installed yet
- Install Witty Pi programs, if they are not installed yet
The board is now fully functional with only two lines on the command line!
Witty Pi Utility
In the Witty Pi folder there is a script called wittyPi.sh which provides an easy way to configure the real time clock and scheduled startup and shutdown times. You can run it using :
and you will then be presented with a simple text interface :
The only thing to watch out for is that format you need to use to specify the startup time is slightly different to the format of the shutdown time.
I used this utility to set a couple of times and my Pi powered down and then correctly powered up an hour later. I changed the localisation settings using raspi-config and changed my system time from UTC to BST. The Witty Pi’s RTC was happy with this change and the scheduled timings still worked fine.
The area I would really like to see more development in is the scheduled shutdown/startup. I would like to set a regular schedule so the Pi could wake up, perform an action (perhaps a take a photo?) and then shutdown. A great application for this would be un-attended timelapse photography. As the Pi would only require power while taking the photo it would keep power consumption to a minimum. This would drastically increase the total run time of a system running from batteries.
The Witty Pi user manual can be downloaded from the official site and covers all the installation steps with additional explanations and diagrams. At the time of writing this article the Witty Pi was available for only 13.83EUR / 10.15GBP / 15.58USD. That’s a small price to pay for being able to finally turn your Pi on and off without pulling out cables or messing around with your own scripts and switches.