This page is under construction.

Physical Computing and Robotics

Using the I²C bus with Processing

"Processing is an open source programming language and environment for people who want to program images, animation, and interactions. It is used by students, artists, designers, researchers, and hobbyists for learning, prototyping, and production. It is created to teach fundamentals of computer programming within a visual context and to serve as a software sketchbook and professional production tool. Processing is developed by artists and designers as an alternative to proprietary software tools in the same domain. Processing is free to download and available for GNU/Linux, Mac OS X, and Windows." (from

"I²C is a multi-master serial computer bus invented by Philips that is used to attach low-speed peripherals to a motherboard, embedded system, or cellphone. The name stands for Inter-Integrated Circuit and is pronounced I-squared-C". (from For more information about using the I2C bus, look at the document here.

I have used the USB to I2C interface module supplied by to connect to a sonar module and display the results in Processing, running under Windows XP. It is a low-cost and simple way to control I2C devices from a PC. I2C is a communication standard that is used to communicate with a number of modules and ICs which are of interest to interaction designers and robotics engineers. Using the interface module, the devices appear to the PC like a standard serial port, so serial routines are used in software to communicate with the devices. The range of device that may be connected to a I2C devices include:

and many more...

You can even design your own I2C devices by using the Picaxe microcontrollers (28X1, 28X2, 40X1, 40X2 models only) in I2C slave mode (look at the hi2csetup command). You could, for instance, do some pre-processing of a sensor's data before making it available on the bus.

Processing program examples to follow...

email me: Alex Zivanovic (Editor of this site)