Skip to main content

Hardware Support

ZeroClaw extends beyond software—your AI agents can directly control physical hardware. The hardware subsystem enables microcontrollers (MCUs) and single-board computers (SBCs) to interpret natural language commands, generate hardware-specific code, and execute peripheral interactions in real-time.

Vision

ZeroClaw acts as a hardware-aware AI agent that:
  • Receives natural language commands via channels (WhatsApp, Telegram)
  • Fetches hardware documentation (datasheets, register maps) using RAG
  • Synthesizes Rust code using an LLM (Gemini, Claude, local models)
  • Executes logic to control peripherals (GPIO, I2C, SPI, sensors)
  • Persists optimized code for future reuse
Mental model: ZeroClaw = brain. Peripherals = arms and legs.

Supported Hardware

ZeroClaw supports multiple platforms with different capabilities:

Two Modes of Operation

Edge-Native (Standalone)

Target: Wi-Fi-enabled boards (ESP32, Raspberry Pi) ZeroClaw runs directly on the device. The board communicates with peripherals locally.
Example workflow:
  1. User: “Turn on LED on pin 13”
  2. ZeroClaw fetches board-specific docs (ESP32 GPIO mapping)
  3. LLM synthesizes code
  4. GPIO is toggled; result returned to user
  5. Code is cached for next time
All happens on-device. No host required.

Host-Mediated (Development)

Target: Hardware connected via USB to a host computer ZeroClaw runs on the host and communicates with the target device. Used for development, debugging, and flashing.
Example workflow:
  1. User: “What GPIO pins are available on this USB device?”
  2. ZeroClaw identifies hardware (VID/PID, architecture)
  3. Returns memory map and pin layout

Architecture: Peripheral as Extension Point

Hardware support is built on the Peripheral trait:

Flow

  1. Startup: ZeroClaw loads config, creates peripherals
  2. Connect: Calls connect() on each peripheral
  3. Tools: Collects tools (gpio_write, sensor_read, etc.)
  4. Agent loop: Agent can call hardware tools like any other tool
  5. Shutdown: Calls disconnect() to clean up

Communication Protocols

Serial Protocol (JSON-over-UART)

Simple JSON for Arduino, STM32, ESP32: Request (host → peripheral):
Response (peripheral → host):
Commands: ping, gpio_read, gpio_write, capabilities

Native GPIO (Raspberry Pi)

Direct access via rppal library—no firmware needed.

Quick Start

Connect Arduino

Connect Raspberry Pi GPIO

Connect STM32 Nucleo

Configuration

Add to ~/.zeroclaw/config.toml:

Tools Provided

Each connected peripheral exposes tools to the agent:

RAG Pipeline (Datasheet Retrieval)

ZeroClaw can fetch board-specific documentation to improve code generation:
  • Index: Datasheets, register maps (in docs/datasheets/)
  • Retrieve: On query, fetch relevant snippets
  • Inject: Add to LLM context
  • Result: Accurate, board-specific code
Place datasheets in docs/datasheets/nucleo-f401re.md, esp32.md, etc.

Security Considerations

  • Serial path validation: Only allow /dev/tty* paths
  • GPIO pin restrictions: Avoid power/reset pins
  • No secrets on peripheral: Firmware never stores API keys
  • Sandboxing: LLM-generated code runs in controlled environment

Next Steps

Supported Boards

Full list of supported hardware platforms

Raspberry Pi

Set up Raspberry Pi GPIO

Arduino

Flash and configure Arduino

Robot Kit

Build autonomous robots