Skip to main content

Arduino Setup

Arduino boards are widely used microcontrollers perfect for education and hobby projects. ZeroClaw supports Arduino via USB serial with JSON protocol communication.

Supported Boards

Arduino Uno (Classic)

Hardware Features

  • MCU: AVR ATmega328P, 16 MHz
  • GPIO: 14 digital pins (6 PWM), 6 analog inputs
  • Serial: USB (CH340 or ATmega16U2 USB-to-serial)
  • LED: Pin 13 (built-in LED)
  • Firmware: firmware/zeroclaw-arduino/zeroclaw-arduino.ino

Quick Start

1. Flash Firmware

2. Find Serial Port

3. Add to Configuration

4. Test Connection

Pin Mapping

Wiring Examples

External LED

Button Input

Arduino Uno R4 WiFi (Uno Q)

The Uno R4 WiFi has a unique architecture:
  • Main MCU: Renesas RA4M1 (ARM Cortex-M4, 48 MHz)
  • WiFi: ESP32-S3 co-processor
  • Transport: Bridge mode (WebSocket to Arduino Cloud)

Setup

Uno R4 WiFi uses a bridge transport that connects to the Arduino Cloud IoT platform. This is different from direct serial communication.

Serial Protocol

The firmware implements a JSON-over-UART protocol:

Request Format

Response Format

Supported Commands

Testing Manually

Firmware Source

The Arduino firmware is written in C++ (Arduino sketch format): Location: firmware/zeroclaw-arduino/zeroclaw-arduino.ino Key features:
  • Newline-delimited JSON parsing (no libraries)
  • Pin 0-13 support (digital I/O)
  • Built-in LED (pin 13) support
  • Dynamic capabilities discovery
  • ~2KB compiled size

Tools Provided

When an Arduino is connected, ZeroClaw exposes:

Advanced: Custom Firmware

To add custom features:
  1. Edit firmware/zeroclaw-arduino/zeroclaw-arduino.ino
  2. Add new command handlers in handleLine()
  3. Upload via Arduino IDE or ZeroClaw
Example: Add analog read

Troubleshooting

Serial port not found

Permission denied (Linux)

Upload fails

No response from firmware

CH340 driver issues (macOS)

Wrong board type

Arduino Shields & Add-ons

Popular shields that work with ZeroClaw:

Performance Notes

  • GPIO speed: ~100 kHz toggle rate
  • Serial latency: ~20ms round-trip
  • Flash size: 32KB (firmware uses ~2KB)
  • RAM: 2KB (firmware uses ~500 bytes)
  • Boot time: ~2 seconds after reset

Next Steps

Supported Boards

Compare all hardware platforms

STM32 Nucleo

More powerful ARM-based alternative

ESP32 Setup

Arduino-like board with WiFi

Hardware Architecture

Understand the peripheral system

Reference