This section is about establishing core concepts of computation as related to physical interface. This connects the behavior of the physical world of electrical signals to the logical world of programs, numbers, and symbols.

For the exercises and assignments, we will be using the Arduino, a popular microcontroller for physical computing. The following list is an informal summary of basic concepts related to computation with physical signals and the Arduino.

Takeaway Lessons

An Arduino is a small low-power computer with many conventional elements: read/write memory (RAM), read-only memory (ROM), a CPU which executes logical and mathematical instructions, and input/output peripheral circuitry. This class of computers are called microcontrollers reflecting their use as microprocessors controlling hardware.

Microcontrollers are appropriate for physical computing tasks with low computational requirements. They have low power consumption and input/output peripherals specialized for hardware such as analog-to-digital converters and PWM waveform generators. They have a single-threaded programming model with no operating system so writing hardware-oriented programs can be very simple.

Physical properties such as position and light intensity are intrinsically analog since they have continuity in time and space. In contrast, computational processes involve operations on numbers representing measurements of the physical properties. We use analog to digital converters (ADCs) to make periodic measurements of electrical signals to create digital representations. These numerical digital signals are sampled in both time and value, since ADCs have a finite precision and speed.

The physical world is one of simultaneity: all atoms are constantly in motion, all physical processes are unfolding in parallel. Computation as we know it is essentially serial and local: programs process numbers one at a time (or in small batches). Signal processing programs managing signals at different sample rates must simulate this simultaneity through program structure and time management.

Digital logic signals use voltages to represent discrete symbols, usually just a binary one or zero. More complex symbols, e.g. numbers, require multiple bits, either encoded on a set of wires (a parallel data bus) or over time on a single wire used as a serial data bus. Every digital number is represented using a finite set of bits and thus has finite precision and range.

Digital logic circuits are generally intended only to convey information and are hence designed to output only small currents at logic-level voltages. Controlling enough energy to operate an actuator almost always requires amplification via a driver circuit.

Systems which only manipulate outputs are said to be open-loop. Systems using feedback that measures the physical effect of an output to govern the output are said to be closed-loop. Hobby servos are a simple example of a closed-loop position-controlled servomotor.

Reference Links

  1. Arduino: IDE
  2. Arduino: Getting Started
  3. Arduino: Reference
  4. Arduino: Uno circuit diagram
  5. Arduino Tutorial: Examples (guide to tutorials)
  6. Arduino Tutorial: First Sketch (programming introduction)
  7. Wikipedia: Stepper motor
  8. Wikipedia: Nyquist-Shannon sampling theorem
  9. Wikipedia: Event loop
  10. Wikipedia: PID controller

Lab Exercises

The lab exercises are intended to be performed by pairs of students. These will familiarize you with operating the Arduino software, building circuits to connect between the analog and digital, and digital representation of physical quantities. The exercises will be performed in the lab during class time, but also outside class as needed. The lab exercises are not graded but are essential for developing the vocabulary and skills to fulfill the graded assignments.

The lab exercises are divided into four parts, each containing a number of exercises. The lab exercises are detailed on the course website under assignments and as a set of notes and schematics in the physcomp-examples github distribution. The github files can be checked out to your own computer for reference.


Graded Project: One In - One Out with a microcontroller

The project assignments are intended to be performed by groups of students.

Create a one-in-one-out system using circuitry and a microcontroller. The general goals remain the same as the basic circuits assignment. The system should take advantage of the complex and versatile behavior enabled by software, creating a process in which energy and information are transformed computationally to connect one process to another.

One In - One Out with computation can be many things:

  1. Energy and information enters, information is transformed, energy and information is emitted, all to accomplish a human purpose.
  2. The information itself can be inspected symbolically, however, the output should be a physical effect rather than symbolic information.
  3. Computation can apply arbitrarily complex mappings between input and output if needed.
  4. The information may be easily interpretable or not, i.e. a quantifiable measurement or a signal resulting from a more complex interaction.
  5. The possibilities for using time are broader; computational processes always involve some delay, but now can involve memory and potentially long delays.

The physical project can be built on a breadboard, with actuators and sensors attached to scrap with tape and hot glue.

The deliverables for this graded assignment are defined in the syllabus section titled Grading Rubric.


Challenge Yourself

Any one who completes the basic exercises should consider undertaking some of the optional challenge exercises.

  1. Try the Arduino RCtime tutorial in which a photoresistor-capacitor circuit is used to form an ad-hoc ADC using a single digital pin.
  2. Create a regulatory system, i.e., a controller, which uses information measured from the system, i.e. feedback, to maintain a state of the system.
  3. Create a musical system which focuses on physically creating rhythms or patterns of sound.

Examples

Inspiration for project ideas can be found on the course website.