Skip to main content
ZeroClaw can control physical hardware through peripherals — microcontrollers, Raspberry Pi GPIO, sensors, and actuators. Peripherals expose their capabilities as tools that the agent can invoke.

Overview

Peripherals implement the Peripheral trait, which provides:
  • Connection management: Connect to hardware over serial, native GPIO, or network
  • Tool exposure: Each peripheral exposes tools the agent can use
  • Health monitoring: Check device connectivity and status

Supported Hardware

ZeroClaw supports multiple hardware platforms:

Raspberry Pi GPIO

Native GPIO control via rppal (BCM pin numbering)

STM32 Nucleo

Serial-connected microcontrollers (Nucleo-F401RE, etc.)

Arduino

Arduino Uno and compatible boards

Arduino Uno Q

WiFi-connected Arduino via Bridge app

Step-by-Step Setup

Raspberry Pi GPIO Example

Here’s how the Raspberry Pi GPIO peripheral is implemented (src/peripherals/rpi.rs):

GPIO Read Tool

GPIO Write Tool

Serial Peripheral Communication

For STM32 and Arduino boards, ZeroClaw uses a serial protocol to communicate with firmware:

Protocol Format

Commands are JSON-based over serial:
Responses:

Serial Transport

From src/peripherals/serial.rs:

Arduino Uno Q (WiFi Bridge)

For wireless control, use the Arduino Uno Q Bridge:

Setup Bridge

This configures the Bridge app to forward commands to the Arduino.

Bridge Configuration

The bridge exposes the same GPIO tools but communicates over HTTP instead of serial.

Creating Custom Peripherals

Best Practices

  • Serial: STM32, Arduino, ESP32 (reliable, wired)
  • Native: Raspberry Pi GPIO (fastest, direct access)
  • Bridge/Network: Wireless devices (flexible, may have latency)

Troubleshooting

Add your user to the dialout group:
Run with appropriate permissions or add user to gpio group:
Check baud rate, connection, and firmware:
Press reset button on the board after flashing:

Next Steps

Creating Tools

Learn how to create custom tools

Gateway Setup

Expose your agent via HTTP