Pybricks-style robotics, on open hardware

openbricks is a MicroPython firmware you flash to a commodity ESP32 board. Wire up off-the-shelf servos and sensors, and drive robots with a clean Python API — motor control runs at 1 kHz in native C inside the firmware.

from openbricks.drivers.st3032 import ST3032Motor
from openbricks.robotics import DriveBase

left  = ST3032Motor(servo_id=1, tx=14, rx=6)
right = ST3032Motor(servo_id=2, tx=14, rx=6,
                     invert=True)

db = DriveBase(left, right,
               wheel_diameter_mm=56,
               axle_track_mm=114)

db.straight(500)  # millimetres
db.turn(90)       # degrees

A firmware, not a library

Pybricks gives LEGO users a delightful Python API, but only on LEGO hubs with LEGO motors. openbricks takes the same shape — a custom MicroPython firmware with the robotics library baked into the runtime — and targets parts you can buy anywhere.

Native control loops

The motor scheduler, trapezoidal trajectory planner, state observer, and 2-DOF drivebase controller are compiled C inside the image, ticking at 1 kHz off a hardware timer. Python is for your program, not the hot path.

Commodity hardware

ESP32-S3 and classic ESP32 boards, Feetech serial-bus servos, DC gear motors with encoders, and I2C sensors from any electronics shop. No proprietary hubs, no vendor lock-in.

Batteries-included tooling

One CLI does it all: openbricks flash over USB, then run, upload, stop, and log over BLE — plus a MuJoCo-backed simulator so you can develop without a robot on the desk.

Up and running in three steps

Full walkthrough in the installation guide.

Install the tooling

pipx install 'openbricks[sim]'

CLI + simulator. Drop [sim] for flash/run/log only.

Flash a hub

openbricks flash --name RobotA \
  --port /dev/ttyUSB0 \
  --firmware openbricks-esp32s3.bin

Prebuilt images for ESP32-S3 and ESP32 on every release.

Run your program

openbricks run -n RobotA main.py

Pushed over BLE, output streamed back live. Or try it first in the sim: openbricks sim run main.py

Supported components

Every driver ships frozen into the firmware — import openbricks and go. New components just implement one of the abstract interfaces. Wiring notes in the hardware guide.

ComponentTypeModule
ST-3032 (Feetech STS3032)Serial bus servo — recommended drive motordrivers.st3032
ST-3215Serial bus servo — arms / grippersdrivers.st3215
JGB37-520 / MG370DC gear motors with quadrature encodersdrivers.jgb37_520, drivers.mg370
L298N / TB6612FNGH-bridge motor driversdrivers.l298n, drivers.tb6612
BNO0559-DOF IMU with onboard fusiondrivers.bno055
TCS34725RGB + clear color sensordrivers.tcs34725
HC-SR04 / VL53L0X / VL53L1XUltrasonic & laser distance sensorsdrivers.hcsr04, drivers.vl53l0x, drivers.vl53l1x
TCA9548A8-channel I2C multiplexerdrivers.tca9548a
SSD1306OLED displaydrivers.ssd1306