[After the Kickstarter finishes, go to http://pi.gate.ac.uk/mopi]
1. Pi to Go!
MoPi is mobile and 24/7 power for the Pi. On your bike, up a tree, or for your home server: we've got you covered.
- multiple inputs — standard batteries, car power sockets, old laptop supplies, solar panels, ...
- hot-swap power replacement without stopping work
- shutdown the Pi cleanly when batteries discharge
- integrated on/off switch
- UPS (uninterruptible power) when using both batteries and mains
- on-board LED indicators and on-Pi notifications
And it even fits in the Pibow (and other well-known Pi cases):
Back this Kickstarter from less than £20/€25/$30 (early bird) and we'll have you powered up in no time. Or pick up one of our outdoor experimenter kits and help us deliver field-trip science rigs for schools. (Add £2.25 to any reward and get a custom Pibow lid!)
Where do you want to use yours?!
1.1. I Want One!
Great! Click on one of the pledges listed to the right of the page.
- Just MoPi: pledge £18 (early bird) or £24.
- MoPi, rechargeable batteries and charger: pledge £48 (early bird) or £59.
- Don't interrupt! The cheapest UPS on the market: pledge £75 (early bird) or £89.
- Kit and caboodle:
- for Pi-on-the-Road Adventure kit pledge £128
- for Outdoor Experimenters (Light) pledge £155
- for Outdoor Experimenters (Light and Air) pledge £237
- Make me a lab! An outdoor rig for 10-pupil classes with on-site workshop: pledge £3,340
- Or, just pledge £2 and we'll keep you in touch.
- And add £2.25 to any pledge and we'll upgrade your Pibow case with a custom MoPi-friendly lid.
Payment by barter, bitcoin, or bourbon biscuits in bulk: probably fine, but phone first!
2. The Story So Far
About a year ago we realised that we needed better power management for our mobile projects on Pi.GATE.ac.uk. Five volt USB battery packs are common, but none of them can communicate their level of charge to the Pi. That means lots of unanticipated power cuts — a good way to corrupt your SD card :-(
And then we realised that standard rechargeables are more planet friendly. And then that it would be cool to be able to hot-swap supplies, and that if we could do that then why not make it a UPS too, and how about adding a power switch, and...
Fast forward: we're onto our third prototype and we think we know what perfect Pi power looks like. Read on!
2.1. The Perfect Pack
What would the perfect Pi battery pack look like? It should be:
Low cost. Dedicated battery supplies like those sold as phone charging devices are great, but when they no longer hold charge the whole unit has to be recycled. Standard commodity batteries and the reusable chargers that serve them are well-established and already present in many households. They're the cheapest option.
Flexible. Got a solar panel handy? I want to plug it into the circuitry and have it drive the Pi as long as the sun shines, then let a battery take over when the clouds come. Stuck for power but got an old laptop supply or 12 volt car charger handy? Strip the cables, connect, and power my Pi please! Plugging a bunch of peripherals? I want to be able to drive them all via my battery pack. And etc.
Polite. When you're running your laptop on battery and it runs out of juice it gives you a nice polite warning message or two, and, when the level gets really low, it automagically shuts down the machine. This is important to allow the operating system (e.g. Raspbian Linux on the Pi) to close up any open files and generally tidy the house before power disappears. Just killing the power without warning is risky — sometimes nothing bad happens, but in the worst case you can end up with a machine that won't boot and needs a complete reinstall. So I want my battery pack to signal the Pi when levels are low, so that the Pi can shut itself down cleanly. Good manners are important, after all :-)
And if the battery pack is going to tell the Pi when it is getting low and needs to shut down, why not have an on/off switch into the bargain? The "off" signal triggers clean shutdown, and is very convenient when you're using the Pi in any kind of kiosk or appliance context. Several projects have implemented this type of on/off facility in its own right — e.g. the ATX Pi supply or the PIC controller: it's definitely a useful function to have on board.
Uninterruptible. I don't want to stop work when my battery is low if I've got a charged pack handy (or a different source of power, like a car cigarette lighter socket or the like). So I'd like my battery pack to support hot-swap of a new electricity supply, either a new set of batteries or some other new input. And if I plug in both mains and batteries together then I've got a UPS.
Eco-friendly. One of the great things about the Pi is its low carbon footprint. The recent ones in my lab are made in Wales, so they haven't travelled half way around the world to reach me. The base system is bare-bones, which encourages reuse of power supplies, monitors, cables and the like. The power consumption is low — particularly for the Model A, which gets by on 300 mA or below (at 5 volts this adds up to around 1.5 watts — contrast that with 50 watts and above for a desktop PC!). There's no spare planet; there's no Plan B if we destroy this one. So we definitely want to support rechargeable batteries, and preferably not the built-in variety that are hard to recycle.
Communicative. I want to know when the battery is full, when it is starting to get low and when it is critical. I want to be able to get those signals both when logged in to the Pi and visually from the battery pack itself. (Look! Flashing lights!)
2.2. The Prototypes
We're now working on our third-generation prototype, which will be the final test board before we start volume production — see the development schedule below. This was the second-generation prototype:
The shape of the PCB allows it to fit into the Pibow without blocking the Pi's display output (currently unused but on the list for future development at The Foundation). There's space for a pass-through GPIO header so that other add-on boards can share space on the Pi, separate LEDs for overall function and for the two power inputs, and a neat little power switch on the top.
(The good people at Pimoroni are going to do a custom lid for their Pibow case to give access to MoPi's power switch. We'll also supply templates if you need to drill out an existing Pibow or other popular case.)
And here are the first-generation prototype boards (with separate regulator and controller):
2.3. A Longer-Lasting Snack
So, how long will the batteries last? My first test was a Model B Pi with almost no load (USB keyboard and mouse; monitor attached over HDMI but switched off after starting the test; no network or other peripherals). Using eight rechargeable Duracell AA NiMH 2400 mAh batteries (like these ones) the Pi ran for 9 hours 31 minutes. Not bad! Especially when you consider that the MoPi regulator supports hot-swap of new charged packs — this looks very viable for mobile Pi applications of all shapes and sizes.
For comparison I set up the same rig with a USB battery pack from RS (this one, a 5200 mAh Lithium polymer model). The results were remarkably similar, with the RS pack lasting for 9 hours and 21 minutes.
Since then we've conducted 101 different tests. There are two key factors in Pi battery life: 1. Model A vs. Model B; 2. the peripherals. To summarise:
- You can expect a Model A to get near to double the life of a Model B.
- What you connect to the Pi makes a huge difference. For example: WiFi is a power hog: halve your expected battery life if you're using it. An accelerometer, in contrast, is cheap: e.g. XLoBorg won't reduce your running time by much at all.
You can also connect two battery packs to MoPi and get double the running time.
3. The Future: Development Schedule
We've got two sets of developments we want to make: 1. finishing off the perfect Pi power board (next section); 2. putting together some imagination-capturing outdoor learning kits for schools (below).
3.1. Power to the People
The basic functionality is all in place — just pledge us your £18 and we'll get you on the road ASAP (with your own batteries) — we'll also supply high-capacity rechargeable batteries for the more expensive pledges, or a UPS rig, or even a full kit including Pi and the works for £128. A bargain!
Future developments: see Stretch Goals below.
3.2. Experimenter Kits for Schools and Outdoor Adventurers
The Pi was designed to give a boost to science and technology education, and it has already made a huge impact — here in the UK, for example, we have a shiney new computing curriculum in the works. There are a whole load of reasons why we need to educate our kids about technology, and how technology can help them cope with the challenges that the future holds. And not just any technology — the Pi has a low carbon footprint, and it's the first mainstream device to be made in Europe for many a year.
We're involved with putting together Pi kits for schools — only for indoor use up to now, but this Kickstarter will allow us to create outdoor experimenter kits to help teach the links between technology, climate, wildlife and the like.
We're offering three kits (for young or old!):
- Outdoor Adventurer Kit
- Outdoor Experimenter Kit (Light)
- Outdoor Experimenter Kit (Light and Air)
Then we're offering a set of kits that make up a Schools Outdoor Lab rig, complete with a selection of fully worked lesson plans to get you started. Ideal for teaching basic physics, climate, environment, biology (and of course computing). We'll even run an introductory lab day for you on site.
3.2.1. Outdoor Adventure Kit
The base level kit has everything you need to get out and about: a Raspberry Pi Model B, case, SD card, and a MoPi board with NiMH batteries, holder and charger (and a wall supply for when you get home!).
Buy one for yourself and be on the road in minutes. This kit also makes a great gift for someone yet to experience The Joy of Pi :-)
3.2.2. Outdoor Experimenter Kit 1 (Light)
This kit has all of the previous one, plus the Raspberry Pi camera module (day or night versions). Ideal for all types of outdoor motion-sensing and photography projects. If you haven't tried the excellent Pi camera yet here are a couple of examples:
Forest Gump came by the office when we were testing an early battery-powered camera rig:
The next olympic downhill ski champion straps a Pi cam to his head:
Here's the camera rig (a hackable "GoPro"?!):
People have done all sorts of stuff with these cameras — from videoing Teddy Bears in the stratosphere to night filming wildlife — the educational opportunities are obvious.
Where do you want to use yours?!
3.2.3. Outdoor Experimenter Kit 2 (Light and Air)
If you watch the film Chasing Ice you can't fail to be amazed when a vast chunk of glacier the size of Manhattan suddenly disintegrates before your eyes. What are the climate changes that have triggered these massive events? How do they play out in the air we're breathing? How do you measure atmospheric conditions, and what science can we use to explain changes in those conditions?
Meet AirPi, a brilliant Pi-based atmospheric monitoring kit that ran a crowdfunding campaign in 2013 and started shipping in the autumn. If you pick the Outdoor Experimenter 2 (Light and Air) Kit pledge we'll include an AirPi with your mobile rig, all set to get out and about measuring temperature, relative humidity, air pressure, light levels, smoke, and the concentrations of the harmful gas pollutants carbon monoxide and nitrogen dioxide (and plotting the results direct to a webserver running on the Pi).
Here's the AirPi board, sensor and indicator set:
And here's one we built up on a breadboard:
The third MoPi prototype uses a different set of GPIO pins in order to avoid conflicts with AirPi (thanks Tom Hartley, creator of AirPi, for his help with this).
3.2.4. How Kickstarter Will Help
There are two chunks of work here: first is putting together a hardware set that can do stuff that kids (and their teachers!) get interested in; second, and at least as important, is developing the lesson plans, learning and evaluation materials that make it quick enough and easy enough to incorporate the Pi into existing educational schedules.
We've got our own educational specialist all lined up, and your support on Kickstarter will unlock the resources to make it work. And we'll make it all open source in return.
If you have the funds to pay for a whole outdoor lab (for multiples of 10 students) then we'll supply you with the whole kit and caboodle — and even come visit to deliver an on-site training day for teachers, parents and pupils. (With DBS/CRB registered and STEM ambassador instructors. Travel costs and volume limitations apply!) If you want to dip your toe and support our development of the educational materials then just pick up one of the kits listed above.
3.2.5. Production and Fulfillment Plan
We'll carry out the development plans detailed above in the following stages:
- Complete prototype board level 3. We have a few hardware changes left to make (changing GPIO pins to fit in with AirPi; adding better connectors; etc.). Then we'll revise the PCB layout and order another batch of prototypes. Solder them up (with a big magnifying glass — the surface-mount components are tiny!) and get testing. We'll make a bigger batch for version 3 than previously, and push them out to heavy Pi users to get use and abuse and a final round of feedback. Continue work on the daemon and the firmware (mainly the 2-way communication code and Pi-based configuration option). Start project updates and regular newsletter to friends and the community.
- Completion: February 2014. (Project updates ongoing through September.)
- Finalise the design of the production board. Fix any residual issues arising from testing. Incorporate any feedback from Kickstarter backers (you!). Start ordering components, kit parts and PCBs in bulk. Finalise the pick-and-place manufacturing process and start pre-production testing. Continue work on the firmware and produce the production binary for flashing to the production boards. Address any stability issues in the daemon code.
- Completion: March 2014.
- Start taking delivery of the production boards. Fulfill the early bird orders. (This is our last opportunity to make firmware changes. Test, test and test again!) Resume work on the educational materials: catch up on developments in the curricula, the Cambridge GCSE MOOC, etc.; more project work with the camera and with the air sensors board. Set up pre-order mechanism for retail version. The daemon should be very stable by now.
- Completion: April 2014. (Educational work continues through the summer.)
- Fulfill remaining (non-early bird) orders for all single item and kit rewards. Select lesson plans for delivery with the schools rigs next month. Solicit additional GitHub committers for the daemon code to help with long-term maintainability.
- Completion: May 2014.
- Finalise the first version of the educational materials. Prepare schools rig orders. Revisit long-term production and retail supply options. Work on the workshop days and deliver some trial runs locally. Agree delivery schedule for workshop days.
- Completion: June 2014.
- Finalise the workshop days and deliver. Set up sustainable production process and retail board supply. Set up sustainability mechanisms for the educational materials.
- Completion: September 2014. (Workshop delivery ongoing. Retail board supply ongoing.)
- Collapse in a small pile.
4. How MoPi Works
There are three dimensions to the problem of mobile power for the Pi:
- regulation, to supply the constant 5 volts at up to around 1 amp that the Pi requires
- control: keeping a check on battery charge, switching the regulator off when charge is getting low, and reporting the current level to a monitor
- monitoring: reading level indications from a GPIO connection, reporting it to the Pi user and shutting the operating system down cleanly when levels get critically low
The first two of these need some special hardware (see "The Hardware" below); the third is written as a software daemon. (We'll sketch these here — Pi.GATE.ac.uk has more of the gorey details.)
All Linux systems share the concept of a daemon, which is a system-level service which gets run during operating system startup. It is quite easy to implement a battery monitor daemon that listens on the Pi's GPIO pins for level changes signalled by the MoPi microcontroller board. The daemon then makes entries in the standard system logs as a simple way to share data with other subsystems, and can be configured to send a warning message to all users if levels are low. Best of all, the daemon can easily shut down the Pi cleanly before the regulator voltage gets too low for reliable operation.
The rest of this section describes the implementation of the daemon. It is designed for the MoPi boards, but should be quite easily reusable for other battery power projects.
4.1.1. SimBaMon: a Simple Battery Monitor daemon
SimBaMon is an open source Linux daemon for
- monitoring battery levels (via the gpio command)
- sending warning messages to the user if the battery is low
- shutting down cleanly at critical battery levels
- managing a power supply on/off switch
- writing relevant data to the system logs
You can find the source code on GitHub. The configuration file, simbamon.conf, defines a set of states in which the monitor will take some action (power off, battery empty, battery level critical, battery level low, battery level good).
The MoPi microcontroller supplies these states via three Raspberry Pi GPIO pins (and also sets on-board indicator LEDs accordingly). The core of SimBaMon, a shell script that lives in /usr/sbin/simbamon, implements an infinite loop that checks the levels being reported over GPIO every few seconds and takes any necessary action. The three GPIO pins connected to MoPi are used as a 3-bit binary value, which we convert to decimal using the bc command. The wall (write all) command is used to send messages to any logged in user.
Here's the main loop:
Here is the current version of the code. There is a full test rig, including debug mode (no shutdowns, shorter intervals) and simulation mode (GPIO input is simulated).Installing
The Raspbian maintainers have been kind enough to include SimBaMon in their repository, so you can just do this: sudo apt-get install simbamond
4.2. The Hardware
The MoPi circuitry consists of two parts: a single-chip microcontroller and a five volt switching mode regulator. The microcontroller (with embedded firmware) implements all the functions related to voltage level monitoring, level signalling (via the LEDs and the GPIO interface), and on/off switching of the +5V supply to the Pi. Battery voltage levels are measured using the built-in microcontroller ADC (Analogue to Digital Converter).
The schematic looks like this:
Two yellow LEDs are positioned next to the twin power pack inputs, and indicate their status (blinking when either voltage is critically low). The overall voltage level of both power inputs is indicated by one RGB (three colour) LED and is also sent to the Raspberry Pi over three GPIO lines. The 5 volts to the Pi is generated by a highly efficient switch mode voltage stabiliser, driven by the microcontroller. An open source daemon running on the Pi listens to the GPIO signal, informs the user of low battery levels and shuts the Pi down cleanly when levels are critically low (or when the power switch is pressed).
To start the 5V generator the power button should be pressed and held for 3 seconds. The microcontroller checks the voltage level of the attached battery packs and if it is above the defined operating threshold, it switches the stabiliser on to generate 5V for the Pi. The LED for the battery (or other) power input lights up, and the RGB LED lights up blue when the battery pack is fully charged (or green if the voltage level is within the acceptable operating range). A three-bit coded voltage level is also sent to the Pi over GPIO (using WiringPi pins 4, 5 and 6 — physical pins 16/18/22 — though this changes in version 3 to accomodate AirPi). During operation, the microcontroller continuously monitors the voltage level, and when it falls beneath a safe level it switches the RGB LED to red. Simultaneously the yellow LED for the low battery starts flashing, indicating that the pack needs replacement.
Then the daemon SimBaMon on the Pi gets a low battery signal and informs the user that they should either plug in another supply or shut down (again by pressing the power button for 3 seconds). If nothing changes and the battery continues to discharge down to a critical level, then the RGB LED starts flashing red and MoPi forces a shutdown. If the user wishes to continue to work and connects a new, charged battery pack (or other supply) to the second connector within 30 seconds then the new battery will prevent the shutdown, and the RGB LED will switch back to blue or green. The new input's corresponding yellow LED will light up. The user can then remove the old battery pack for charging.
Behaviour has to be adjusted for multiple battery chemistries; this is done within the microcontroller firmware. (In version 3 we also support chemistry configuration on the Pi itself, giving a wider range of options.)
5. Stretch Goals
Thanks to our backers so far we're going beyond our baseline. We've figured out a bunch of extras we can offer in MoPi if we get further (and the level of funding we'll need to make them viable):
- 150% (nearly there!): screw terminals, stackable headers, remoting pads and self-resetting fuse added
- 175%: two-way communication and remote power-off added
- 200%: 3.3V supply mod added
- 250%: timer-based wake-up added
- 300%: The PiBrush reward released
- 375%: battery charging added
- 430%: The HackCam reward released
- 590%: input voltage boost added
- 999%: The Pablet reward released
When we reach 150% funded (nearly there!) we can make these improvements:
- Screw terminals. This will make it easier to connect all different types of power supply (from batteries to water turbines) direct to MoPi.
- Stackable headers. We'll put a stacking header directly onto the board (and adopt the same case lid style as for the Pibow Model A). This will make it easier to connect multiple boards at once (e.g. MoPi + XLoBorg, or MoPi + AirPi, or etc.).
- Remoting pads. We'll add remoting pads for the power switch to help with applications where MoPi sits away from the edge of the case. This will allow the connection of an additional power switch.
- Self-resetting fuse. MoPi supplies power directly through the GPIO pins, which bypasses the Pi's built-in fuse. We think this is safe — but to be doubly sure we'll add a fuse in MoPi.
When we get to 175% funded we will add:
- Two-way communication. We're moving to I2C for communication between the Pi and MoPi, which will mean complete configurability from the Pi. (It will also minimise our use of GPIO pins and maximise the number of other Pi add-on boards that we can run with.)
- Remote power off. You'll be able to tell MoPi to power down the Pi when logged-in remotely (after a clean shutdown, of course).
If we get to 200% funded we will add the ability to mod MoPi for 3.3V operation (overpowering the Pi's on-board regulator and saving the power that is dissipated there, for weight and battery life critical applications like ballooning).
If we make it to 250% funded we'll add timer-based wakeup — tell MoPi what time you want your Pi to wakeup, then power it down and MoPi will boot the Pi as requested.
If we get to 300% funded we will offer our virtual paintbrush rig — The PiBrush — as a reward. PiBrush combines a MoPi with an accelerometer and is a great way to engage kids with Python programming and the physics of motion. When you've got one you've also got a programmable Pi-based Wii-remote-alike, and there are a ton of cool applications waiting.
Now, the one you've all been waiting for: charging! That's by a long head our most requested feature — but it is also pretty difficult :-( In fact, dealing with lots of different chemistries may not be possible on a tiny device like MoPi (most manufacturers of charging ICs only support one chemistry per chip, for example, and some only support charging a single cell per chip!). The other challenge is that we've got a really small surface area to work with on the PCB. So we need to get quite a bit further to have the necessary resources... but if we reach 375% funding, then we'll do it! We're not promising to charge every battery under the sun, but we'll provide charging for at least one popular configuration.
If we make it to 430% funded we'll offer The HackCam, a Model A Pi, a camera module, wifi and a MoPi, wrapped up in a water-resistant box with a 3 inch screen and the switching to make it work in the way you'd expect. The pictures are served directly to the web by an Apache running on the Pi, and with everything open source (of course) you can tweak the photographic parameters to your heart's content. A camera you can log in to!
Some applications would benefit from the addition of a voltage boost, e.g. when you've got a small surface area of photo-voltaic (solar) panel and want to trickle charge a backup battery. If we reach 590% funding we'll add a buck booster to cater for these applications.
Finally (for now!) if we get to 999% funding we'll offer The Pablet, combining MoPi with this touchscreen and case rig. We'll mod the case to add a couple of PP3 clips, and an external power switch. Hey presto! a Pi-based "tablet"!
Set your Pi free!
Risks and challenges
We see 3 main risks and 3 main challenges:
Risk 1: faults in the design. Mitigation: test, test, test! (And take testing seriously enough to spend time properly engineering test harnesses and collecting good sized data sets.) Potential costs:
— faults in the circuitry: high cost; we're putting our biggest effort into getting this right, drawing on decades of electronics engineering experience
— in the firmware: medium cost; we'll be able to flash new firmware right up to despatch day
— in the software: relatively easy to fix — our monitor software is already in the Raspbian repository so updates can be pushed out rapidly if needed
Risk 2: demand is high and we can't scale up production. Mitigation: we're partnered with one of the highest-volume Pi sites on the net, Pimoroni (who also run the Pi foundation's Swag Store) and our principal design engineer has already scaled up many times (going back as far as the first consumer GB hard-drive!).
Risk 3: component availability. Mitigation: we've verified multiple suppliers for the components; most of them are held in stock in volumes sufficient to meet the demand that we anticipate.
Challenge 1: capturing the imagination. To meet our goal of enthusing kids, their parents and teachers about Pi-based outdoor learning, we need to embed the fun stuff in the educational messages. That's one of the reasons we love the Pi: there's so much creativity and excitement out there in the Pi community that we can draw on. We're not giants, but we know where there are some shoulders we can stand on :-)
Challenge 2: delivering great hardware and software. We don't just want it to be good — we want it to be a worthy add-on for the Pi itself, and that little beast has been pretty miraculous in terms of quality and versatility. A hard standard to live up to, but we'll do our best!
Challenge 3: delivering great learning materials. There's a reason why teaching is a profession, and we take the skills and resources involved in this challenge very seriously. Our lesson plans and lab sessions will be the last outputs from the project, to give us the time we'll need to reach top quality.
Overall, we think risk is low. We know we can supply a brilliant mobile power solution for the Pi (so we have set our minimum goal at a low level, with just enough orders to make sure we get a good price on the components). The circuitry has a bunch of clever tricks to guarantee a clean and efficient supply (and to deal with quite a large set of use cases and Pi specifics), but at base it is well-known technology that has been stable for a long time. So technology risks are low.
The team behind MoPi have around 100 years of professional software and hardware experience behind them. We recognise the risks, but we're confident that we can deliver. Join us?Learn about accountability on Kickstarter
- (34 days)