250a architecture

From CCRMA Wiki
Jump to: navigation, search

A quick overview on the architecture of the Physical Interaction Design's architectural setup.


Architecture Diagram

Very broadly, a PID setup allows computers to react progammatically to events in the physical world. Diagram1.png

Actions, events and states are detected by sensor circuits, which convey signals to an embedded microcontroller, which in turn addresses a computer program. The computer program can then respond by producing sound and graphics, or it can pass commands back to an embedded processor, which can effect action, sound, or display through the use of electronics.

Diagram1b.png

Sensor circuit

A circuit is an interconnection of electrical elements such as resistors, inductors, capacitors, voltage sources, current sources, and switches in a network that has a closed loop, giving a return path for the current. A sensor circuit incorporates a sensor which varies resistance, inductance, capacitance, or otherwise varies voltage or current to produce signals indicating the state of the sensed phenomena.

Here is an example of a very basic sensor circuit:

Circuit1.png

Microcontroller

A microcontroller is essentially a small computer on a chip. Like any computer, it has memory, and can be programmed to do calculations, receive input, and generate output. Unlike a PC, it incorporates memory, a CPU, peripherals and I/O interfaces into a single chip. Microcontrollers are ubiquitous, found in almost every electronic device from ovens to iPods.

More on Microcontroller Architectures.

PID 2009 setup

For this class, we will be using breadboards and Arduino Nanos running Firmata, as platforms for the sensor circuit and embedded microcontroller, respectively. On your computer, you will be using PD, graphical programming environments that use a patch-programming model and enable sound synthesis.

Diagram3.png


Arduino

The Arduino is an electronics prototyping platform with a hardware and software component.

The Arduino software application is an IDE for programming firmware for the Arduino hardware. Its programming language is based on C; it has some structures, variables and functions specially designed for managing microcontroller electronics. It is open source and can be downloaded for free.

The Arduino hardware is based on the Atmel AVR microcontroller family. There is not one Arduino board, but, rather, a host of boards based on the same basic open-source design. Ours, the Arduino Nano, is based on the Arduino Decimila design, but is smaller, and breadboard-mountable.

The Arduino hardware has the advantage of being mass-produced, relatively low-cost and readily and widely available. More importantly, there is a wide community of folks using Arduino, which makes it easier to get support after this workshop.

Firmata

Firmata is a generic protocol for microcontrollers to communicate with software on a host computer. Firmata firmware is available for the Arduino and PIC platforms; Firmata host software is available for Pd and Max/MSP, as well as for Processing, C++, Python, Flash, SuperCollider, Perl and Visual Basic.

Firmata is not as widely used as Arduino; people usually write custom Arduino firmware to suit their application. Because Firmata works generically, it is generally not as efficient in time or bandwidth as custom firmware. However, by using Firmata, we can abstract away many of the details of microcontroller programming to focus our efforts on our Pd programs. We will be using the default implementation of Firmata firmware; it is also possible to write your own firmware using Arduino but use the Firmata protocol and libraries (see here).

Alternative platforms

As a point of reference, the table below shows some alternatives to the platforms we are using in this workshop.

PID platforms
Electronic circuit platformMicrocontroller platformProgramming Environments
Breadboarded Circuits
Printed Circuit Board
Off-the-shelf Components
Arduino
Other AVR-based systems (like Buddha Board)
PIC based systems
Basic Stamps
ICubeX
PD
Max/MSP

Processing
Visual Basic
Super Collider
ChucK
Flash