Physical Computing and Fabrication

Day 1: Arduino

What is Arduino?

An Arduino is basically a tiny computer that can be programmed to process certain forms of input and output. Arduino is built for the user to play around with, try things out, and utilize reused materials for different interactive projects. In other words, it’s made for tinkering and prototyping, but can also be used as a dedicated component in a project (hence the lowish cost). Arduino combines open-source hardware with an integrated development environment (IDE) software that uses a simplified version of the C/C++ programming languages that even non-programmers can use to write code for the Arduino board.

Some Terminology

Basic Elements of Arduino

The board:

The software:

Setup Step 1 – Install Arduino and Familiarize with IDE

Setup Step 2 – Serial Port and Board Selection

Exercise 1 – Blinking LED

Image 1: 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)

Exercise 2 – Incorporating a Button

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.

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

Image 3: Schematic from Arduino Tutorials (http://www.arduino.cc/en/Tutorial/Button)

Exercise 3 – Using a Potentiometer for Analog Input

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 1024.

Image 4: Potentiometer Circuit Schematic and Visual from Spark Fun Inventor’s Guide (https://www.sparkfun.com/tutorial/AIK/ARDX-EG-SPAR-WEB.pdf)

Image 5: Potentiometer Circuit Sheet from Spark Fun Inventor’s Guide (https://www.sparkfun.com/tutorial/AIK/ARDX-EG-SPAR-WEB.pdf)

Exercise 4 – Using a Potentiometer to control a servo motor

For this sketch, we will use a different actuator—a servo motor—and control its position using a potentiometer. As in the previous exercise, the analog input of the potentiometer will translate voltage into numbers between 0 and 1023. The sketch we use will translate the position of the potentiometer as a degree of rotation between 0 and 179. This coordinate will instruct the servo to rotate its drive shaft to that fixed position.

Image 5: Potentiometer-controlled Servo Circuit from Arduino.cc (http://www.arduino.cc/en/uploads/Tutorial/knob_BB.png)

Image 6: Potentiometer-controlled Servo Circuit schematic from Arduino.cc (http://www.arduino.cc/en/uploads/Tutorial/knob_schem.png)