School bell automation sits at an interesting boundary: schedules are soft real-time, but relay timing and safety interlocks are not negotiable. In our bench prototypes we often pair an ESP32 for Wi-Fi management, TLS and smartphone-facing workflows with an STM32 focused on deterministic GPIO and actuator control.
The ESP32 handles schedule sync, authorised API calls and persistent storage of holiday calendars. It forwards a compact binary command set to the STM32 over UART rather than toggling relays directly. That separation means a Wi-Fi stack stall does not block the bell interlock logic running on the secondary MCU.
On the STM32 side, interrupt-driven debouncing and minimum off-time enforcement protect amplifiers and relays from rapid cycling. Watchdog timers reset the actuator state if communication stalls. When a manual override arrives, the STM32 verifies the signature or sequence number before energising outputs—mirroring the authorised change model described in GitLeaf Bell documentation.
Either chip can host the full stack for simpler installs; the dual-MCU split is an engineering option when field serviceability and hard real-time guarantees matter more than bill-of-materials cost. The right choice follows measurement: relay bounce, network latency and maintenance access at the site.