Arducase V2: OTA Updates & A New Brain
Project: Arducase
It’s been a while since I first hung the Arducase on my wall. While it looked cool, using it has been… clunky. The biggest annoyances were:
- Power Instability: The boards would randomly reset, especially when multiple displays or relays turned on at once. It was clear the power distribution was “noisy.”
- Updating Firmware: This was the real nightmare. To update a module, I had to take the entire case off the wall, plug each of the five Arduino boards into my computer one-by-one, and manually flash the new firmware. It was so tedious that I just… didn’t.
I decided it was time for a major overhaul.
A Brain Transplant: Introducing the Raspberry Pi
The core of the problem was decentralization. Each module was its own island. The solution? A central brain. I added a Raspberry Pi 4 into the mix, nestled into Slot 4.
This Pi runs Node-RED, which has become the heart of the entire Arducase. It handles all the logic, serves as the MQTT broker, and, most importantly, acts as a centralized server for a new, streamlined update process.
OTA Updates: The Right Way
The original ArduinoOTA library used a “push” method, where my computer would send the update directly to the board over WiFi. This was the source of my update woes.
The new system is a “pull” model, and it’s infinitely better:
- Central Firmware Store: All compiled firmware
.binfiles are now stored in a singlefirmware/directory on the Raspberry Pi. - Version Manifest: A simple
versions.jsonfile on the Pi holds the latest version number for each module. - HTTP Endpoints: A Node-RED flow exposes two simple web endpoints: one to get the
versions.jsonfile, and another to download a specific.binfile. - Smarter Modules: I rewrote the firmware for each Arduino module. Now, after completing its main task, each board phones home to the Pi, fetches the
versions.jsonfile, and compares the “latest” version with its own. If it’s outdated, it automatically downloads the new binary, updates itself, and reboots.
Now, to update a module, my workflow is:
- Compile the new firmware.
scpthe.binfile to the Raspberry Pi.- Update the version number in
versions.json.
That’s it. The next time the module checks in, it updates itself. No more taking the case off the wall.
Solving the Power Problem
With the brains sorted out, I tackled the stability issues.
First, I added a UPS HAT to the Raspberry Pi. This keeps the Pi running smoothly even if I unplug the case to move it.
Second, I went through and added capacitors across the power lines for every single module.
- A 100uF electrolytic capacitor for each slot to act as a small reservoir, smoothing out the large voltage drops from power-hungry components like relays and LED matrices.
- A 0.1uF ceramic capacitor right at the power input for each microcontroller to filter out high-frequency noise that could cause the processor to crash.
The difference is night and day. The random resets are gone, and the whole system feels robust.
The Future
For the first time since I built it, the Arducase feels like a finished, maintainable project rather than a fragile prototype. The hardware is stable, and the software can be easily updated.
Now I can finally get back to the fun part: adding more features and interactions between the modules!
← Back to blog