← BackJan 7, 2026

From a Busy‑Indicator to a BLE‑Enabled Home Automation Device: A Case Study in Over‑Engineering

The author describes how a simple annoyance—family members interrupting work time—led to the design of a custom device that reports camera status, remaining meeting time, and more. Using an ESP32, an OLED display, mDNS, and a bespoke binary protocol, the project evolved from a quick hack to a professionally packaged solution. The narrative highlights the trade‑offs between software and hardware, the learning curve of 3‑D modeling, and the temptation of over‑engineering.

The impetus for this project was an everyday inconvenience: a parent repeatedly entered a home‑office space during a video call. The author needed a reliable way to signal the presence of an active webcam and the remaining duration of a meeting. Conventional approaches—shared calendars or phone calls—proved inadequate because the parent often lacked a phone, and not all interactions were scheduled. ### The Initial Hack An abandoned ESP32 module and a personal computer were the starting points. The goal was to surface the webcam status on a small screen nearby. The author built a minimal server in Bun that monitored macOS system logs for the notification strings “AVCaptureSessionDidStartRunningNotification” and “AVCaptureSessionDidStopRunningNotification” via the `log stream` command. When the ESP32 polled the server every half‑second, the OLED display would blink green or red to indicate whether the camera was running. This simple prototype succeeded, demonstrating that the hardware was capable of exposing the desired state. ### Escalating Complexity #### Dynamic IPs and mDNS The hardware design was limited to a local address that changed whenever the router assigned a new IP. The author leveraged mDNS to expose a persistent hostname—e.g., “Apoorvs‑MacBook‑Pro.local:1337”—thus decoupling the device from the network’s DHCP churn. #### Eliminating Polling: BLE Polling was bandwidth‑inefficient and introduced latency. Rewriting the communication stack to use Bluetooth Low Energy allowed the Mac to push updates to the ESP32 asynchronously. BLE’s connection‑based model also added the potential for proximity sensing via RSSI values. #### Custom Binary Protocol JSON packets are convenient but verbose. The author designed a minimalistic, single‑byte protocol called DoorFrame. A two‑byte handshake (“DF” as a magic byte and a version number) initiated communication. Subsequent packets carried status codes such as 0xC0 (camera off) and 0xC1 (camera on), and encoded time in a compact form: an hour byte (offset from midnight) and a minute byte (5‑minute increments). The protocol was documented in a short RFC, and edge‑case handling was developed with the help of an LLM. ### Hardware Design Having a floating ESP32 and display was unsightly. The author returned to 3‑D printing after months of avoiding mechanical work. Using Fusion 360, sketches, extrusions, and chamfers were learned through video tutorials, and digital calipers ensured millimetre‑level tolerances. The first iteration produced a snap‑fit enclosure that held the board securely; minor gaps were patched with transparent tape, proving that iterative design was more valuable than perfection at this stage. ### Over‑Engineering as a Mindset The author intentionally pursues extra features: custom macOS menu‑bar icons inspired by SF Symbols, animated wave effects for connection status, and a future roadmap that might include facial recognition or audio alerts. While these additions appear excessive for a single‑user solution, they serve as an educational exercise in bridging software and hardware, and in cultivating a “professional” mindset that values polish and thorough documentation. ### Lessons Learned * **Hardware constraints demand disciplined design**: Physical tolerances, power supply stability, and signal integrity are not as forgiving as software abstractions. * **Protocol design balances readability and efficiency**: A 2‑byte header plus single‑byte commands can dramatically reduce bandwidth and simplify parity checks. * **Continuous learning is essential**: The author re‑engaged with CAD, network protocols, and BLE programming after a long hiatus, demonstrating that multidisciplinary fluency is a valuable asset. ### Conclusion The current device, now integrated into the home‑office doorway, reliably indicates webcam status and meeting time, and can be powered through the laptop’s USB port for instant shutdown upon leaving the room. Future enhancements are open to discussion, but the core architecture already showcases a fully functional, self‑contained system that marries embedded hardware with desktop software. The project stands as a testament to turning a simple annoyance into a showcase of engineering curiosity, disciplined problem‑solving, and a taste for over‑engineering.