Physical Computing and Fabrication

Day 1: Arduino

By Tiffany Chan, based on notes by Nina Belojevic and Shaun MacPherson.

Overview

What is Arduino?

An Arduino is an open source, tiny computer made for tinkering, prototyping. It can also be used as a dedicated component in an interactive project (e.g. soldered to other parts or sewn into clothing)—hence the small size and lowish cost. Arduino combines open-source hardware, an integrated development environment (IDE) software, and a simplified version of the C/C++ programming languages that even non-programmers can use to write code for the Arduino board.

In this module, we will be using the Arduino for physical computing—that is, to sense and interact with the physical world. In practice, this involves converting one form of energy into another: for example, some kind of physical energy (e.g. light, sound, motion) into electrical signals and/or vice versa. When combined with other components or computers (e.g. the Raspberry Pi), the Arduino can do even more complicated things. Arduinos are commonly used for home monitoring projects (e.g. tripwire alarm, thermostat), wearables, and robotics. Throughout this module, I will briefly mention some example projects out in the wild that build on concepts we learn.

Image from Getting Started with Arduino by Massimo Banzi

Some Terminology

Setup A – Install the IDE

Setup B – Serial Port and Board Selection

Setup C - Putting It All Together

Image care of Sravanthi Sinha via SlideShare.net.

The board:

Image of the breadboard, care of learn.sparkfun.com

The breadboard:

Image of the Arduino IDE, care of jeelabs.net

The IDE:

Exercise 1 – Blinking LED

Blinking LED image from Getting Started with Arduino by Massimo Banzi (http://phylab.fudan.edu.cn/lib/exe/fetch.php?media=yuandi:arduino:getting_started_with_arduino_v2.pdf)

Now that we have the LED blinking, let’s add a button as a digital input sensor to control when it turns on or off.

Fritzing Circuit from Arduino Tutorials (http://www.arduino.cc/en/Tutorial/Button)

Further Experiments

Example Projects

Exercise 3 - LED to Piezo

Now we’re going to work with sound instead of light, using a piezo. A piezo is a small device that can both detect and play tones (that is, it can act as a sensor or an actuator). For this exercise, we’re going to use it to play a short melody.

Image of piezo buzzer/sounder care of Adafruit.

Image care of Simon Monk (https://learn.adafruit.com/adafruit-arduino-lesson-10-making-sounds/playing-a-scale).

More Things to Try

Example Projects

Exercise 4 - From Digital to Analog

Next, let’s incorporate analog input. Instead of allowing for only two states (On/Off or High/Low), analog input translates voltage (from 0 to 5 volts) into numbers between 0 and 1023. For this exercise, we’re going to use a potentiometer, or “pot,” to modify the piezo’s pitch.

Image of potentiometer, care of notey.com.

More Things to Try

Exercise 5 - From Light to Sound

You can measure many different kinds of analog input (e.g. temperature, light, moisture) using different sensors for the Arduino. We will now use a different sensor to modify the piezo’s pitch. For this exercise, we’re going to replace the potentiometer with a photocell or photoresistor to create a pseudo-theremin, based on the original theremin instrument. Where the theremin’s pitch varied with the player’s hand position, the pseudo-theremin’s pitch varies with the amount of light that the photocell receives.

Image of a photocell care of Adafruit. (https://learn.adafruit.com/photocells/using-a-photocell)

Diagram care of Simon Monk. (https://learn.adafruit.com/adafruit-arduino-lesson-10-making-sounds/pseudo-theramin)

More Things to Try

Example Projects

Exercise 6 - From Pot to Servo

For this sketch, we will use a different actuator—a servo motor—and control its position using a potentiometer. The sketch we wil use will translate the position of the potentiometer into a coordinate that will instruct the servo to rotate its drive shaft to that fixed position.

Image of servo motor (above) care of inexglobal.com

Example Projects

Exercise 7 - Make Your Own!

For the rest of the session, you can experiment with different combinations of sensors, actuators, and code. We also have foil for touch sensors, flex sensors, LCD displays, and temperature sensors. Here are some tutorials to get started:

Temperature

LCD Displays

Touch Sensors

Other

What other things can Arduinos do? SO MANY things!

Where can I find more Arduino projects and/or tutorials?