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
Supported Hardware
ZeroClaw supports multiple platforms with different capabilities:| Platform | Transport | Use Case | Status |
|---|---|---|---|
| Raspberry Pi | Native GPIO | Production robots, edge AI | ✅ Stable |
| STM32 Nucleo | USB Serial | Development, prototyping | ✅ Stable |
| Arduino Uno | USB Serial | Education, simple projects | ✅ Stable |
| ESP32 | Serial / WiFi | IoT devices, remote control | ✅ Serial stable |
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.- User: “Turn on LED on pin 13”
- ZeroClaw fetches board-specific docs (ESP32 GPIO mapping)
- LLM synthesizes code
- GPIO is toggled; result returned to user
- Code is cached for next time
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.- User: “What GPIO pins are available on this USB device?”
- ZeroClaw identifies hardware (VID/PID, architecture)
- Returns memory map and pin layout
Architecture: Peripheral as Extension Point
Hardware support is built on thePeripheral trait:
Flow
- Startup: ZeroClaw loads config, creates peripherals
- Connect: Calls
connect()on each peripheral - Tools: Collects tools (gpio_write, sensor_read, etc.)
- Agent loop: Agent can call hardware tools like any other tool
- Shutdown: Calls
disconnect()to clean up
Communication Protocols
Serial Protocol (JSON-over-UART)
Simple JSON for Arduino, STM32, ESP32: Request (host → peripheral):ping, gpio_read, gpio_write, capabilities
Native GPIO (Raspberry Pi)
Direct access viarppal 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:| Tool | Description | Boards |
|---|---|---|
gpio_read | Read digital pin value (0 or 1) | All |
gpio_write | Set digital pin high or low | All |
hardware_capabilities | Query available GPIO pins and features | Serial boards |
hardware_memory_map | Get memory layout and peripheral addresses | STM32, ESP32 |
hardware_board_info | Get board type, architecture, VID/PID | All |
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
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
Related Documents
- Hardware Peripherals Design — Full architecture
- Adding Boards and Tools — Extend hardware support
- Robot Kit — Build AI-powered robots