DEV Community

TANIYAMA Ryoji
TANIYAMA Ryoji

Posted on

The CloudAIoT 3-Layer Reference Architecture

A Separation-of-Concerns Approach for Real-Time IoT and Robotics Systems

Ryoji Taniyama

CEO & Founder, Takumi Labs Inc.

38 years in network engineering | RISS Certified


Introduction

When a single device is responsible for sensing, control, networking, and cloud synchronization, failure is not a possibility—it is inevitable. The failure mode is not one problem, but the impossibility of troubleshooting which one.

After deploying IoT nodes to enterprise customers for years, I reached an uncomfortable conclusion: the conventional approach to IoT architecture is fundamentally flawed.

The industry has embraced single-board computers like Raspberry Pi as the default solution for edge computing. Tutorials, courses, and countless GitHub repositories reinforce this pattern. Yet in production environments—where systems must run 24/7 for years without intervention—this approach consistently fails.

This article presents the CloudAIoT 3-Layer Reference Architecture, born from real-world failures and iterative refinement. It is not theoretical. Every principle described here emerged from deploying, failing, replacing, and ultimately succeeding in customer environments.

The core insight is simple: real-time control, edge processing, and cloud connectivity must be strictly separated. When they are mixed on a single device, stability becomes impossible to guarantee.


Why We Abandoned Raspberry Pi

We initially deployed Raspberry Pi units as edge nodes for enterprise customers. The appeal was obvious: full Linux environment, GPIO access, strong community support, abundant documentation.

Within months, the problems began.

Thermal Instability

Raspberry Pi units in enclosed spaces—server rooms, factory floors, retail back offices—experienced thermal throttling under sustained load. CPU temperatures regularly exceeded safe thresholds. Passive cooling was insufficient; active cooling introduced noise, moving parts, and additional failure points.

We tried heat sinks. We tried cases with ventilation. We tried duty cycle management. None provided the reliability our customers required.

Non-Deterministic Behavior

Worse than thermal issues was unpredictability. A Pi running motor control, sensor polling, network communication, and data logging simultaneously exhibited random latency spikes. OS updates could stall real-time loops. Wi-Fi reconnection attempts blocked critical code paths.

When a failure occurred, diagnosis was difficult. Was it thermal? Network? SD card corruption? Kernel scheduling? The monolithic design made root cause analysis nearly impossible.

The Decision

We replaced every Raspberry Pi node deployed to customers. This was expensive and embarrassing, but necessary. The architecture itself was the problem, not the implementation details.


Why GL-INET Was Also Retired

After abandoning Raspberry Pi, we evaluated GL-INET routers as edge nodes. Running OpenWrt, they offered network-centric functionality with lower power consumption and better thermal characteristics.

For a time, this worked. But the solution was still unsatisfying.

Limitations of OpenWrt

GL-INET devices run a constrained Linux environment. Package availability is limited. Development and debugging are cumbersome. Integration with modern tooling requires workarounds.

More fundamentally, GL-INET occupies an awkward middle ground: more capable than a microcontroller, less capable than a full Linux system.

The Economic Shift

The decisive factor was market evolution. By 2024, MiniPCs with full x86 Linux environments became available at price points comparable to GL-INET devices. Quad-core processors, 8GB RAM, NVMe storage, multiple USB ports, Gigabit Ethernet—all in a compact, passively cooled form factor.

The question became: why accept OpenWrt limitations when a full Ubuntu or Debian system costs the same?

We retained GL-INET devices only for specialized use cases—specifically, wireless network probing where their radio characteristics are advantageous. For general edge computing, MiniPC is now the standard.


The 3-Layer Architecture

The CloudAIoT 3-Layer Reference Architecture is built on a strict separation of concerns across three layers:

┌─────────────────────────────────────────────────────────────┐
│                    CLOUD / UPSTREAM LAYER                    │
│         Aggregation, Analytics, Dashboards, AI, Storage      │
│                   (Completely non-real-time)                 │
└─────────────────────────────────────────────────────────────┘
                              ▲
                              │ MQTT / HTTP / WebSocket
                              │
┌─────────────────────────────────────────────────────────────┐
│                 EDGE / NEAR-REAL-TIME LAYER                  │
│      Data preprocessing, Buffering, Network communication    │
│                    (Tolerates mild latency)                  │
│                                                              │
│                  [ Linux MiniPC / Uno Q CPU ]                │
└─────────────────────────────────────────────────────────────┘
                              ▲
                              │ USB (Primary) / Serial
                              │
┌─────────────────────────────────────────────────────────────┐
│                     REAL-TIME LAYER                          │
│            Motor/Servo/PWM control, Safety loops             │
│               (Must NEVER depend on networking)              │
│                                                              │
│              [ Arduino MCU: Uno Q, XIAO, etc. ]              │
└─────────────────────────────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Layer 1: Real-Time (MCU)

The bottom layer handles safety-critical, timing-sensitive operations: motor control, servo positioning, PWM generation, current sensing, emergency stops.

This layer runs on bare-metal microcontrollers—Arduino Uno Q, Seeed XIAO, or similar. There is no operating system to interrupt execution. There is no network stack to block on. There is no filesystem to corrupt.

Critical principle: This layer must operate correctly even if all network connectivity is lost. A robot arm must not swing wildly because Wi-Fi dropped. A motor must not overheat because the cloud is unreachable.

Layer 2: Edge / Near-Real-Time (Linux)

The middle layer handles data preprocessing, buffering, protocol translation, local decision-making, and upstream communication.

This layer runs on a MiniPC with full Linux (Ubuntu/Debian). It communicates with MCU nodes via USB. It communicates upstream via MQTT, HTTP, or WebSocket.

If network connectivity is lost, this layer continues operating. It buffers data locally. It maintains MCU communication. When connectivity returns, it synchronizes with upstream.

Layer 3: Cloud / Upstream

The top layer handles aggregation across multiple edge nodes, long-term storage, analytics, dashboards, AI inference, and alerting.

This layer has no real-time requirements. Latency of seconds or even minutes is acceptable. It can run on VPS, LXC containers, or public cloud services.


Implementation Mapping

The 3-layer architecture maps cleanly to specific hardware:

Layer Hardware Role
Real-Time Arduino Uno Q (MCU side), XIAO Motor control, PWM, safety loops
Edge MiniPC, Uno Q (CPU side) Data collection, preprocessing, network
Upstream VPS, LXC, Cloud Storage, analytics, dashboards

Why Arduino Uno Q

The Arduino Uno Q is particularly well-suited to this architecture. It combines an MCU (for real-time control) and a Linux-capable CPU (for edge processing) in a single board. The two processors communicate via internal serial, but can operate independently.

This means a single Uno Q can serve as both real-time and edge layers for simple deployments. For complex systems, dedicated MCU nodes connect to a central MiniPC.

USB as Primary Interconnect

We use USB rather than Wi-Fi for MCU-to-Edge communication. This provides:

  • Reliability: No wireless interference, no reconnection delays
  • Power: MCU nodes can be bus-powered
  • Simplicity: Standard serial-over-USB, no network configuration
  • Scalability: USB hubs allow many nodes per edge device
        Edge MiniPC
            │
    ┌───────┼───────┬───────┬───────┬───────┐
    │       │       │       │       │       │
   USB     USB     USB     USB     USB     USB
    │       │       │       │       │       │
┌───┴───┐┌──┴──┐┌───┴───┐┌──┴──┐┌───┴───┐┌──┴──┐
│ Motor ││Sensor││Current││Relay││  PWM  ││ ... │
│Control││ Node ││Monitor││Node ││ Node  ││     │
└───────┘└─────┘└───────┘└─────┘└───────┘└─────┘
Enter fullscreen mode Exit fullscreen mode

Each node has a single responsibility. Adding capacity means adding nodes. The architecture scales horizontally without redesign.

Wi-Fi is reserved for upstream communication only, where its unreliability is tolerable.


Design Principles

Principle 1: Network Independence for Safety

Real-time control must never depend on network availability. If the network fails, safety-critical operations continue unchanged. This is not a nice-to-have; it is a fundamental requirement.

Principle 2: Hot-Swappable Nodes

Any MCU node should be replaceable within 4 minutes without configuration. This requires:

  • Standardized hardware (Grove connectors, common pinouts)
  • Configuration stored at edge layer, not on MCU
  • Automatic node discovery on USB connection

Field technicians should not need programming skills to replace a failed node.

Principle 3: Single Responsibility per Node

Each MCU node handles one clear function: PWM control for motors, current sensing, environmental monitoring, actuator control. Combining multiple responsibilities on one node reintroduces the complexity we are trying to eliminate.

Principle 4: Horizontal Scalability

Adding capacity means adding nodes, not replacing hardware. A system with 4 motors and 8 sensors uses 12 MCU nodes. A system with 40 motors and 80 sensors uses 120 nodes connected to multiple edge devices. The architecture is the same; only quantity changes.


When Do You Need This Architecture?

If your system meets any of these criteria, a single-board computer approach will fail:

  • [ ] Must survive network outages without disruption
  • [ ] Must run 24/7 unattended for months or years
  • [ ] Requires hot-swappable nodes without reconfiguration
  • [ ] Controls motors, relays, servos, or actuators
  • [ ] Is deployed at remote customer sites
  • [ ] Must be maintainable by non-programmers

If you checked even one box, Raspberry Pi is not suitable. The 3-layer architecture is required.


Deployment Patterns

Small Systems

For simple deployments, a single Arduino Uno Q is sufficient:

  • MCU side: Real-time control
  • CPU side: Edge processing and upstream communication

No additional hardware required.

Medium Systems

For moderate complexity:

  • Multiple Arduino/XIAO MCU nodes
  • One MiniPC as edge aggregator
  • Upstream to VPS or cloud

Large Systems

For enterprise scale:

  • Many MCU nodes organized by function
  • Multiple MiniPCs as regional aggregators
  • Hierarchical upstream to cloud infrastructure

The architecture scales without fundamental changes.


Conclusion

The CloudAIoT 3-Layer Reference Architecture is not a product. It is a set of principles for designing IoT and robotics systems that are safe, scalable, and maintainable.

The core insight is separation of concerns:

  • Real-time control belongs on dedicated MCUs with no network dependency
  • Edge processing belongs on Linux systems that can tolerate network interruption
  • Cloud integration belongs upstream where latency is irrelevant

We arrived at this architecture through failure. Raspberry Pi taught us that mixing concerns creates instability. GL-INET taught us that half-measures satisfy no one. Production deployments taught us that elegant theory means nothing if systems fail at customer sites.

The market has finally provided hardware that makes this architecture economically viable. MiniPCs are cheap. Arduino-compatible MCUs are ubiquitous. USB hubs cost almost nothing.

There is no longer any excuse for deploying IoT systems that fail when the network hiccups, overheat in summer, or require expert intervention to replace a sensor node.

CloudAIoT Re-Defined is our contribution to the industry: a proven architecture, freely shared, for building systems that actually work.


About the Author

Ryoji Taniyama is the CEO of Takumi Labs Inc., with 38 years of network engineering experience spanning AI research, router development, and large-scale retail deployments.

Contact: cloudaiot.tech


© 2025 Takumi Labs Inc. This document is released under CC BY 4.0. Attribution required for derivative works.

Top comments (0)