The Making Centre

Arduino/Processing Firmata Setup Guide

This guide will walk you through the process of connecting an Arduino to Processing, giving you the ability, for example, to use sensors to control Processing sketches and audio, or use your Processing animations to control motors and lights.

If you haven't worked with an Arduino before, we recommend that you have a look at the introductory physical computing materials here, and complete the Arduino Fundamentals badge on my.artdesign before jumping into this guide.

If you haven't worked with Processing before, you'll find an introductory guide and links to relevant resources here.

Download the Arduino IDE

Go to the Arduino downloads page and install the latest version of the free Arduino desktop IDE (Integrated Development Environment) by selecting your OS and then just download. This is where you will compile the example code we'll be uploading to the Arduino.

Firmata

The Firmata library includes a collection of Arduino examples, each of which can be uploaded to your Arduino board to expose its inputs and outputs to other software environments, like Processing. By using these examples, we don't have to write any code in the Arduino editor, as we simply upload the Standard Firmata code to the Arduino and then read the Arduino's inputs and control its outputs from a separate piece of software.

In the Arduino IDE, open the example at File > Examples > Firmata > StandardFirmata and click the tick in the top left hand corner of the window to compile the example. Plug your Arduino in and confirm your selections at Tools > Board and Tools > Port before you upload the code. Once you've successfully uploaded the Firmata example to your Arduino, you're ready to communicate with the Arduino board from other software.

Download Processing

If you haven't already, go to the Processing website, select your operating system and go through the installation process.

Libraries can be downloaded to extend Processing's capabilities in a variety of different ways, and there's a specific library for communicating with an Arduino running the Standard Firmata example.

We install the library in Processing by going to Sketch > Import Library... > Add Library and then searching for arduino. Install the Arduino (Firmata) library, made by David A. Mellis. Any time you install a new library in Processing you need to quit the application and reopen it so that it can find the relevant library files.

Getting started

A good place to start is always the examples folder, which can be found at File > Examples. In the Contributed Libraries section at the bottom of the examples window, you'll find a folder full of Processing examples, with individual programs for using Arduino inputs, outputs, pwm, or Servo motors. Which one is applicable to your project will depend on what you are making and you may find you need to combine elements from multiple examples.

Help!

Getting started with a programming environment like Processing or Arduino can be a bit daunting, but it is good to know going into it that these environments were created with the specific intention of teaching people to program in a creative and fun way. In addition to this, there are very active communities online dedicated to sharing knowledge and getting questions answered. Chances are, if you're running into a problem, someone else has too, and they've probably posted about it online.

These places should be the first ones you check when you run into any issues:

If you would like to book in an appointment at the Hackspace for more targeted assistance, please get in touch or pop in to E110.