Close

Pi gateway upgraded to battery backup

A project log for The Moteino Framework

Automation framework based on wireless Moteino nodes.

felix-rusuFelix Rusu 09/17/2014 at 21:180 Comments

The gateway that drives the Moteino Framework relies on power from the utility. If there is an outage, even a short one, the RaspberryPi will shutoff and SD card file system could be corrupted. So I upgraded the gateway from ATXRaspi to MightyBoost which supports the same nice shutoff button interface but adds the ability to switch to battery backup in case of an outage, and monitor the battery voltage in case power is out for a long time. The goal is to always shutoff the Pi gracefully to avoid SD corruption.

I had to lasercut a new mid layer for my existing Pi Gateway lasercut case. I have posted the changes (corel and DXF files) in the github repo so you can customize &/or lasercut your own if you’d like. As usual, I like to cut the new template in cardboard and do a fitting test, measure any adjustments, re-cut if needed, then finally when it’s perfect cut it in the more expensive translucent acrylic.

I have used one of my OSHPark prototypes and an old Moteino R1 to drive the MightyBoost using the provided sketch. This allows me to use a power button as before, monitor backup battery voltage through Moteino A7, control the standalone i2c LCD via Moteino to display status and messages from the Moteino Framework. And yes, there are 2 Moteinos in this setup. I could have used a single Moteino for everything, but that would mean combining the MightyBoost control sketch with my main RFM69 receiving sketch, and I wanted to avoid that.

Also, the MightyBoost sketch will hardly ever need changes. But the gateway sketch is tweaked quite often, and I like to wirelessly program the gateway Moteino without loosing control of the MightyBoost power (ie a wireless programming sequence involves a hardware reset which would shut power off on the MightyBoost Moteino). I hope that makes sense. For an end user, in terms of cost, the extra transceiver-less Moteino that drives MightyBoost is a mere $12.95 at time of writing, hardly something to argue about as far as savings. I think it’s a good tradeoff for modularity and separation of concerns, and allows maximum flexibility. If changes are required on the MBoost Moteino, just power it off, plug in your FTDI, upload the sketch, then power back on. As simple as that. Here is the final install of this upgrade:

The full writeup is on my blog and the laser cut plans are on github along with source code for the gateway firmware. See the previous blog entry that goes into more detail about the laser cutting.

Discussions