So we have been using our CuPID RF Controller all over the place. We use it at home, for automation and monitoring, at the shop for keeping an eye on things and connecting everybody, and most recently in industrial control panels. One issue that keeps coming up is reliability, and a few related sub-issues. As a result, we have decided to incorporate a battery and power management solution into our standard controller. This addresses these main issues:
One thing guaranteed to eventually corrupt the operating system of a Raspberry Pi (and most OS, for that matter), is memory corruption. A great way to corrupt the memory on the OS is to remove power, have it fluctuate above or below the recommended voltage (nominally 4.75-5.2V on Raspberry Pi), or otherwise halt operations in an unknown state. Unfortunately, even AC power fluctations can cause problems. The Pi is notoriously picky about power supplies and their ability to maintain voltage under load. And, sometimes, you accidentally knock the power supply, something upstream fails … you get the picture. You can’t always choose when power is removed/changed, and you certainly don’t get to pick when it corrupts your OS. And when it does … you get to rebuild. Even if this just means writing an existing image, it’s still a pain, especially in a mission-critical embedded system.
Continuous operation during brief power outages
During commissioning of systems, testing power supplies, or for things as simple as moving your sensor gateway across the house, it is VERY convenient to be able to handle a brief power outage while the Pi still chugs away. And if you lose power for too long? it shuts itself down. For example, our control panels automatically cut all power to the system when the front door is closed. If we didn’t have some sort of UPS, we’d have to shutdown and reboot our CuPID every time we opened the door! Obviously this doesn’t work. What about if you blow a fuse or breaker? No problem.
This follows from the above, but line voltage is not always guaranteed. Our first warehouse space monitoring CuPID was continually going offline. The culprit? The neighbor was running high power equipment and pulling our line voltage below where our AC/DC converter could handle it on short intervals. Our battery and boost converter ensure that momentary drops below where our AC/DC converter is comfortable will not give our gateway problems.
External, Field-serviceable power control
One necessary feature of a deployed device is the ability to treat and diagnose. Worse comes to worse, sometimes you need to reset. A great feature of the UPS-enabled CuPID is the ability to reboot, shutdown, and hard reset. Ideally, this is not necessary, but things happen. The MightyBoost gives us a functional button, programmable actions, and an LED to give us status of our CuPID gateway.
Real-time power monitoring
The least important (but still cool) feature of the CuPID UPS gateway is the ability to monitor voltage in real time. You can see just how bad your power supply or building power is, or when things got bad.
The hardware here is quite simple: we take our standard CuPID HAT build and put a MightyBoost on top. Luckily the MightyBoost has the same footprint for the Moteino, so it’s a pretty easy fit. Here is a very abbreviated assembly procedure:
The board with EEPROM, DS2483 and a few passives installed:
With a Moteino on top:
Mightboost loaded up on the Moteino headers:
Here, we added in a shutdown jumper to GPIO20, power from the MightyBoost output, and a battery:
With a few more components, the stack fits nicely into an enclosure. Here, we’ve also added an RS485 board:
And finally, the CuPID lives in its native environment with On/Off switch, IO connected, and 5V supply in from a DIN mount AC/DC converter.