PowerZero is a beginner-friendly Raspberry Pi project presented from concept, through development, and into final product. As I write this, I saw my first Raspberry Pi about a week ago. I've fiddled with installing Raspberry Pi OS Lite and trying to run it in headless mode with some success. I'm ready to try and build something.
As my first project, I wanted something that could be useful, at least to someone. I wanted something that could be clearly defined, and could have a logical progression from concept to completion.
The Idea
I want to create something to monitor electrical power while you're away. It must be able to alert you to significant events that may require attention once you return. For example, if you're on holiday and you lose power for a couple of days, you might want to check the contents of your freezer.
Decision Framework
Whenever working on anything I like to have a clear mental framework on which to make decisions. After thinking it through, I have decided on these three force-ranked requirements.
- Objectively Useful: It must solve a real-world problem.
- Accessible Simplicity: It must be easy enough for anyone to use without confusion; and,
- Achievable Scope: All features must be clearly required in service to usefulness and simplicity.
Project Plan
After considering the idea and the decision framework I worked through the key details of the project. This represents the initial plan from before any code is written or I get any real experience. Details are subject to change. With that in mind, I have made a list of the components I think I'll need and why.
Feature | Reasoning |
---|---|
Pi Zero 2W ![]() |
I want it to be small. As small as reasonably possible. As such, have decided on a Raspberry Pi Zero 2 W. You could easily argue that this project is better suited to a micro controller like an Arduino Nano or Pi Pico, but I want to learn about Single Board Computers (SBC). I'm guessing it'll be more accessible to start with. 65mm × 30mm × 5mm, ~$15 USD |
DS3231 RTC ![]() |
Of course the system needs to track when the power is on and when the power is off. I considered various ways to do it with battery backup, detection of active power, etc. Ultimately I decided to try and keep it as simple as possible. Current idea is to save a heartbeat to disk (e.g. every minute save a timestamp to a file). When the system is on, the heartbeat will happen. When the power fails, it won't. Loss of power detected! The problem is that the Pi won't know the time when the power comes back. Ordinarily computers use Network Time Protocol (NTP) to sync time on boot. If I do that, then the user needs to configure Wi-Fi somehow. I think for simplicity (#2) this is a non-starter. The solution is to use a board with a battery that can very accurately save the time and update the Pi when it boots. These batteries should run for 3+ years, even further simplifying the problem for now. 38mm x 22mm x 14mm, ~$2-$5 USD |
![]() |
The system needs to alert you if there was a power issue. An audio alert is more effective than a blinking light. From what I can see, the Pi Zero doesn't have the ability to play audio without a break out board or some additional electronics, and this appears to be a mature easy to use product. Future me discovered that this doesn't work for my intended purposes. This is documented in Hello Sound. |
8Ω 1W Speaker ![]() |
There are too many options around these little speakers that go with the audio board. The PAM8302A connects to the pi, and the speaker connects to the PAM8302A. I'm not clear on the differences between these options yet. I'm just going to order one or two and see what happens. 23mm x 23mm x 5mm, ~$2 USD |
Push Button ![]() |
The system needs a button to disable alerts after a power outage. Two buttons are better than three; one is better than two. Ideally, there would be none, but a single button keeps things simple. 6mm x 6mm x 5mm, ~$0.50 USD |
OLED Display ![]() ![]() |
Thinking about usefulness (#1), and scope (#3), we can get away with just the audio board (PAM8302A). To meet minimum requirements we could use a Text To Speech (TTS) library on the Pi and provide a statement such as "Severe power outage detected on January 10th lasting 4 hours." or something like that. As a stretch goal I want to add a display to provide useful information that would be cumbersome with just TTS. The push button can serve a dual purpose to minimize additional requirements. The display could have different "screens" of information. A single press on the button would change screens, and a long press would activate the option on the screen. One of the screens would provide the ability to clear the alert, or maybe the first button press clears it. I looked at several different screens, such as Freenove I2C IIC LCD 1602 Module (16 chars x 2 lines), as well as some small OLED displays that offer more flexibility. I think I'll defer the decision. Maybe order a few options and play with them once I begin to make progress on the core requirements. |
![]() |
From what I can tell it's advised that you apply a heatsink to the Pi. My hope is that we can create a smaller overall package without the Heatsink. If this is true, to minimize heat we can try underclocking the CPU and reducing cores. This should be feasible since the Pi Zero 2 W is overpowered for this project. ~$2 -> $10 USD |
Next Steps
This seems to be fairly manageable. The absolute minimum (DS3231 RTC, PAM8302A, 8Ω Speaker, Push Button) is well documented and looks straight forward when I watch vides on YouTube. (famous last words?).
As noted above, I really want to add the OLED display as I think it would be fun to do and take it to the next level. I'm also hoping to figure out a way to create a nice looking custom 3d printed case. I think this could add to the overall polish of the final product. For now I'm going to start with the basics and leave this as a problem for future me.
I have the Pi, and I'm excited to order all the components now that I have a plan. I'm also going to order a starter kit (e.g. Miuzei Electronics Component Fun Kit, ~$20) to get a breadboard and the wires and stuff.
Next Up: Hello World