The Firmata library implements the Firmata protocol (a Midi-like communications protocol) for communicating with software on the host computer. This allows you to write custom firmware without having to create your own protocol and objects for the programming environment that you are using. To use this library use this in your Arduino sketch:

#include <Firmata.h>

See also: PyMata Express On Arduino (an experiment)


Based on a cursory look at what's available (summarised below), depending on whether or not one wants async IO or not it seems that either PyMata4 or PyMata Express is the best candidate. One would be communicating in either StandardaFirmata or FirmataExpress (AIO).

FirmataExpress adds support for:

  • HC-SR04 Ultrasonic Distance Sensors using a single pin
  • Stepper Motors
  • Piezo Tone Generation
  • Baud rate of 115200

but apparently has a significantly higher learning curve than StandardFirmata.

There are implementations of Firmata in most programming and scripting languages. Below are listed some of the known Python implementations (since that's what we're using for the KR01 robot).

Firmata Protocol#

Includes a list of known implementations in many languages.

Pymata Express#

This is an asynchronous IO version of PyMata4.

The User Guide has a section on why one would choose Express over PyMata.

PyMata 4#

A current project; dozens of examples; good documentation, including user guide.

Supports both an enhanced version of StandardaFirmata 2.5.8, called FirmataExpress, as well as StandardFirmata.


Compliant with Firmata 2.1; reasonably good documentation; latest commit 2019.

Outdated or Superceded Python Implementations#


The project is current archived, replaced by Pymata Express.


The project is current but archived, replaced by PyMata 4.

Python Firmata#

A dead project; relatively complete implementation, two trivial examples; latest commit 2010.


A dead project; only two files; latest commit 2009.


Tags:  Arduino