It's estimated that nearly 90% of the world's homes have access to electricity, meaning nearly 90% of us inevitably become annoyed when our power goes out. 😖

While most of the time it is merely an annoyance, losing power (especially when we aren't aware of it while away or asleep) can lead to disastrous outcomes. This could mean anything from equipment loss due to current surges when power is restored, to lives literally being on the line in critical care settings.

In this project, we're going to walk through how to build what I believe is the simplest globally-available, cellular-enabled power outage detector, complete with instant SMS notifications powered by Twilio.

What's in the Box? 📦

Put away your soldering iron for this project folks, because it doesn't get much easier!

We're going to take a Blues Wireless Cellular Notecard, attach it to a Blues Wireless Notecarrier-A, and use a newly-released Notecard firmware feature that allows for autonomous reporting of GPIO state changes without a host microcontroller.

We'll also need a small LiPo battery with a JST connector (any capacity will do), and a micro USB cable (with a wall outlet adapter).

Why Cellular? And Why Notecard? 📶

When a power outage occurs, we can't rely on local networking hardware to be up and running (e.g. Wi-Fi). Cellular is the only reliable option in this scenario.

The Blues Wireless Notecard comes in both Wi-Fi and Cellular varieties. The cellular models work globally on LTE-M, NB-IoT, and Cat-1protocols and are different from traditional cellular IoT offerings as they come prepaid with 500MB of data and 10 years of global cellular service.

The secret to the Notecard's success (well, one secret) is the fact that it knows where to go as soon as you power it on. The Notecard doesn't live on the public Internet and only communicates through private VPN tunnels (making it an incredibly secure device). No certificate management or manual key rotations are required.

And what does the Notecard communicate with? It automatically syncs with the Blues Wireless cloud service, Notehub.io, which in turn can securely route data to quite literally any cloud service (like AWS, Azure, Google Cloud), RESTful endpoint, or MQTT-enabled service.

You simply power on the Notecard, use one of the commands from the JSON-based Notecard API, and it is able to communicate with the cloud.

Let's Build a Power Outage Detector 🛠

As mentioned, we will be using the Notecard along with a Notecarrier-A. Notecarriers are development boards that allow you to easily prototype an IoT solution with the Notecard. The Notecarrier-A provides onboard antennas, JST connectors, Qwiic connectors for peripherals, and exposes all the pins on the Notecard.

To begin, we simply slot the Notecard into the M.2 edge connector on the Notecarrier-A:

We then connect the MAIN u.fl connector on the Notecarrier-A to the MAIN u.fl on the Notecard. This allows use of the onboard cellular antennas on the Notecarrier:

NOTE: You can optionally connect the GPS u.fl connector as well, which lets you utilize the GPS module on the cellular Notecard.

Next, we need to run a short jumper wire to connect VUSB to AUX1 on the Notecarrier-A. Why? Well, with the right card.aux Notecard API request, the Notecard can automatically report state changes on any AUX pin (1-4). By connecting VUSB to AUX1, we are setting ourselves up to be able to report on a state change of a power loss to VUSB:

Connect the LiPo battery to the Notecarrier via the LIPO JST connector. Another advantage of the Notecarrier is that it will maintain a charge on the connected LiPo battery while it's powered over USB:

Finally, the Notecarrier...

Read more »