DESGN-650-01 Mechatronics, Spring 2015, CCA

DESGN-650-01 Mechatronics T 12:00PM 03:00PM SANF 107 (Hybrid Lab)
Industrial Design MFA
Spring 2015

Instructor: Michael Shiloh
Office hours: Office hours: Tuesday 3:00PM-3:30PM, Thursday 11:00AM-11:30AM, or by appointment

Jump to current homework assignment

Course Objectives

The purpose of this course is to teach you the practical tools you will need to design and build robust and functional interactive electromechanical devices. This course will cover programming (Processing, Arduino, others), electronics (basic circuits, Arduino, sensors and actuators), and construction techniques. Electronic and programming theory will be covered as necessary to support the practical needs of this class. The goal will be to give you the tools and the confidence to combine basic hardware, software, and mechanical building blocks (such as those taught in this class or those you might garner from the internet) into functional realizations of your ideas.

A strong theme of this class will be learning how to design and build for reliability, flexibility, testability, ease of repair and modification, robustness, transportability, etc. The approach of this class will be to build as much as possible, to learn and to iterate.

Another theme is documentation. Obviously it’s important for your own studies, and it’s especially important when dealing with electronics and programming that become opaque very quickly. In addition, we all benefit tremendously from the projects others have shared freely on the internet and in other places, and it’s important to pay forward to this pool. As a side effect, you might receive excellent feedback and even recognition and fame for work you publish. To this end, everyone is required to have ongoing online documentation. This can be a blog (e.g. WordPress), a wiki, a website, or any other mechanism as long as it  allows feedback and is publicly searchable and accessible.

Finally, I want to make this class responsive to your needs and interests. Please ask questions, make suggestions, and tell me what you’d like to learn. In particular, some of you have prior experience in some of these areas. To allow you to learn as well, projects will be designed with a “low floor and high ceiling”, that is, beginners will implement projects at a basic level, while those with more experience will be expected to involve increased complexity in their projects.

You are encouraged to be very broad, adventurous, and creative. You should take advantage of the freedom you’re given and craft your explorations to spread your wings and get the most from the experience, resources, and the support that are available at CCA in general and in this course in particular.

Learning Outcomes

  • Know how to conceptualize, design, and build a project involving some or all of sensors, actuators, Arduino, Processing, and possibly other programming languages
  • Know how to use advanced interfaces such as I2C and SPI to communicate with sensors and actuators that use those
  • Know how to communicate between Arduino and a computer using your own protocol or Firmata, to implement a larger project requiring both Arduino and laptop capabilities
  • Know how to access the internet from your project
  • Know how to chose the right motor for your project, and how to control it
  • Know how to design and construct circuits and software for robustness and ease of maintenance, repair, and modification
  • Know how to tap into an existing device for control by or input to for a larger project
  • Know how to document your project so others can understand, duplicate, and build on your work
  • Know how to research and understand topics beyond what is taught in class

Required Equipment

  • Arduino Uno R3, either SMT or not (SparkFun, Maker Shed, Adafruit, Oddwires)
  • Solderless breadboard, full size (also known as 830 tie point) (SparkFun, Maker Shed, Adafruit, Oddwires)
  • Laptop (Windows, Linux, or Macintosh)

The Arduino Uno and solderless breadboard are available from multiple sources. Many vendors grant discounts for educational purposes so ask before you purchase. I encourage you to organize a group purchase to save on shipping fees, but do so immediately so we have the equipment on hand.

 Optional equipment

As you develop your projects and interests, you might need to purchase additional components and devices. This is impossible to predict as the range of projects you might approach are indeed infinite. At the low end, you can build amazing projects from discarded electronic devices such as printers at absolutely no cost; at the high end there is no limit; a complicated robotic project could easily start at hundreds of dollars. Some lessons I’ve learned:

  • Projects will cost more than you think they will
  • Projects will take longer than you think they will
  • You will order parts that are wrong or that you simply decide not to use. Be ready to accept this. Consider these items you might trade with other students (or the larger maker community) for parts that you do need, especially when you need that part urgently.
  • You will spend less time and money if you are flexible about your concept. Allow prototype iterations to modify your concept, not just your execution. The reverse is also true: If you strongly want to stick to your concept, be prepared to spend more time and money. The common way of looking at this is to consider that there is a relationship between time, money, and features. You can choose any two of them, and the third will grow (or shrink) to accommodate.


  • Introduction (or re-introduction) to Arduino and Processing
  • Electronic theory: understanding current limitations
    • How much current does an LED consume, and how to limit it
    • How much current does a motor consume, and how to control it from Arduino
  • Introduction to dataflow programming languages such as Max/MSP or PureData
  • Construction techniques
  • Debugging and asking for help
  • Electronic circuits: soldering, printed circuit boards (PCBs); CAD software (Fritzing)
  • Intermediate programming concepts: Arduino/Processing communication, classes, arrays, state machines, etc.
  • Firmata on the inside
  • Networking via Ethernet or WiFi
    • web interface
    • RESTful API
  • Other wireless options
  • Connecting to the internet with services such as IFTTT or Temboo
  • Intermediate hardware topics: other interfaces, filtering noisy data, motor controllers, etc.
  • Servo loops
  • Extending or combining Arduino with other circuits: multiplexers, shift registers, etc.
  • Telemetry data: Gathering information and storing on local SD card or on remote computer
  • Survey of other similar embedded options: Raspberry Pi, Beagle Board, Edison, Galileo
  • Advanced options
  • Motors: servo, PM, stepper, H-bridge
  • Gears, pulleys, levers
  • Power considerations and distribution


  1. Arduino control system: Taking input from at least 1 analog sensor and two digital sensors and controlling two digital outputs and one analog output, all of which will be represented by LEDs. The system must have at least 5 different states and must indicate, via the serial monitor, the current values of the inputs and outputs and the current system state.
    Skills: Basic Arduino IO: analog/digital read/write; conditionals; serial print; schematics; LEDs; resistors; multimeter; debugging software; debugging hardware
  2. Communication: Processing and Arduino: Sensors on Arduino control sound  and graphics on Processing and mouse or keys on Processing controls motor on Arduino
    Skills: Bidirectional communication; parsing; handshaking; motors; transistors
  3. Extending Arduino: Adding an external chip (Integrated Circuit or IC) to an Arduino to accomplish a specific task beyond the capabilities of Arduino
    Skills: Integrated Circuits; datasheets; soldering; layout; offboard connections; protoshield; oscilator; motor controller; I2C; SPI; mutliplexer; shift register
  4. Personal project

Week 1

  • Where are you
    • programming
    • electronics
    • physics
    • math
  • Intro to or review of Arduino, electronics, and Processing

Homework due on week 2

  1. Order your Arduino and solderless breadboard before class so that they arrive by week 3.
  2. Create your online presence and email me the URL
  3. Bring your laptop to class every week

Week 2

  1. Basic Arduino IO: analog/digital read/write
  2. Serial.print (AnalogReadSerial)
  3. Conditionals (Combine analog sensor with a pair of LEDs)
  4. Schematics
  5. Multimeter (measure analog input and digital output)

Homework due on week 3 February 3

1. Review what we did in class, as necessary

2. Learn about switches and digitalRead

  1. Describe the following process on your website/blog/wiki/whatever in your words, accompanied by schematics, drawings (nothing fancy – simple hand sketches are fine), and programs, so take notes and save programs as you go along.
  2. Build the photoresistor circuit that we used in class, upload the sketch, open the serial monitor, and verify that the numbers change as you allow more or less light to fall on the photoresistor. Make note of the smallest and biggest numbers you get, very roughly (say rounded to the nearest 50). Remember that the diagrams I showed in class are here.
  3. Remove the photoresistor, and in it’s place put a pair of wires that go off the breadboard and connect to nothing. In the picture and diagram below the wires are white and blue:20150128_182110arduinoWireSwitch_bbarduinoWireSwitch_schem
  4. Observe the numbers in the serial monitor. They should be close to zero. Does this make sense? Remember what I said about the voltage divider: the voltage in the middle of the divider (at the Analog Input pin A0) will be somewhere between zero and five volts, depending on the ratio of the two resistors. The fixed 10k ohm resistor is still there, but the photoresistor is gone and in it’s place are a pair of wires that aren’t connected to anything, in other words, an open circuit. The resistance of an open circuit is infinite, and compared to infinity, the 10k ohm resistor is very small, so it pulls the middle voltage down, close to zero.
  5. While watching the numbers in the serial monitor, touch the ends of the white and blue wires to each other. The numbers should jump up to close to 1023. Again, remember that the voltage in the middle of the divider (at the Analog Input pin A0) depends on the ratio of the two resistors. This time in place of the photoresistor we have a pair of wires that are connected to each other, in other words, a closed circuit, and specifically, a circuit with no resistance. Compared to a circuit with no resistance, the 10k ohm resistor is very big, so the closed circuit pulls the middle voltage up, close to 5V.
  6. The blue and white wires are a switch. A switch simply makes a connection, in which case you have a circuit with no resistance, or opens the circuit, in which case you have an infinitely high resistance. Every switch is a variation on this basic principle.A switch can be either open or closed, resulting in a reading of close to zero or close to 1023. The Analog Input, which is designed for measuring voltages with many possible values, is wasted on this sort of input. Much more suited to a switch is a Digital Input, which is designed to only measure one of two values: LOW and HIGH.
  7. In the program, replace the analogRead() command with digitalRead() and upload the program. Close and open your switch, and see what you get in the serial monitor. You should see zero with the switch opened, and one with the switch closed. Zero represents LOW, and one represents HIGH.

3. Learn about analogWrite()

  1. Read and do the Arduino Fade tutorial. Note that the example is in File -> Examples -> Basics -> Fade.
  2. For another perspective, this is also described here.
  3. Note that analogWrite() only works on certain digital pins. On the Uno, these are: 3, 5, 6, 9, 10, and 11.

4. Combine a pair of switches and an LED

  1. Build a circuit with two switches (you can use wires or switches, as you prefer) and an LED. The LED must be on one of the digital pins that works with analogWrite.
  2. Write a program that continuously fades the LED up and down when neither of the switches is closed. This is exactly what the Fade example does.
  3. When one of the switches is closed, the LED should be off. Use digitalWrite() for this.
  4. When the other switch is closed, the LED should be on at some intermediate brightness.
  5. Describe your work on your website/blog/wiki/whatever in your words, accompanied by schematics, drawings (nothing fancy – simple hand sketches are fine), and the program.

5. Other places to look

  1. Excellent introduction to Arduino: Arduino in a Nutshell
  2. Arduino overview with links to many other sources of information
  3. Endless resources on the web

Week 3 February 3

Homework Feedback

  • Website
    • Don’t post screenshots – include code (<code> </code>, <pre> </pre>), etc.)
  • Software:
    • Fade
    • Documentation and Readability
      • Well chosen variable names
      • Titles for blocks of code, especially functions
      • Indentation
    • Using comments to temporarily remove code (“commenting out”)
  • Circuit
    • Sensors that control actuators do so via software and not by direct connection
    • Sensors and actuators should not touch each other except at 5V and GND
    • How you implemented the circuit on your breadboard is an implementation but is not the schematic. Don’t confuse the two! You may include a picture of your implementation, but you MUST include the schematic (any of hand drawn, graphics, or CAD are fine) as well.
  • Schematics
    • GND and 5V labels
    • gnd symbol
  • Sketch


  • Download from
  •  Examples
      • form -> star
      • transform -> arm
      • structures -> createGraphics
    • sketch_001:
      void setup() {
        // parameters are 
        //   x coordinate, 
        //   y coordinate, 
        //   x size, 
        //   y size
        ellipse( 15, 15, 30, 30);
    • sketch_002 change size of canvas:
      void setup() {
        // size of canvas (x, y)
        size(1024, 768);
        ellipse( 100, 200, 30, 30);
        // can change location and size
        // can also make multiple objects
    • sketch_003 mouse variables, draw function:
      void setup() {
        size(1024, 768);
      // draw() is like making a drawing on a new
      // page in a flip book
      void draw(){
        // draw circle wherever the mouse is
        ellipse( mouseX, mouseY, 30, 30);
    • sketch_004 our own variable that varies with every frame:
      void setup() {
        size(1024, 768);
      int myX = 0; // Create a variable and put 0 in it
      void draw(){
        // draw circle 
        ellipse( myX, 300, 30, 30);
        // change the x coordinate so on the next frame 
        // it will be in a different place; this makes
        // it appear to move
        myX = myX + 1;
    • sketch_005 change color of pen; erase behind us:
      void setup() {
        size(1024, 768);
        // change color of pen
      int myX = 0;
      void draw(){  
        // clear the background before drawing each frame
        // draw circle 
        ellipse( myX, 300, 100, 100);
        // change the x number so next frame it will 
        // be in a different place
        myX = myX + 1;

Processing and Arduino

  • Arduino File -> Examples -> Communication -> Dimmer
    • Serial.available()
    • for()
  • Arduino File -> Examples -> Communication -> Graph
    • SerialEvent()
    • map()

Homework due week 4 February 10

  1. Read, watch, and do these tutorials to the extent you require
    1. Introductory video series on Processing
    2. Processing Processing Overview
    3. Hello Processing
    4. Processing Getting Started Introduction to Processing
    5. Coordinate System and Shapes
    6. Color
  2. Write a processing program which will create a simple drawing using lines, ellipses, and rectangles, and whatever else you want. Your picture should include all three of the following:
    1. Some of it should be static
    2. Some of it should change depending on mouse position and/or button clicks, like example sketch_003 I showed in class
    3. Some of it should change with every frame, like example sketch_004 or sketch_005 I showed in class

    The changes can be to position, size, shape, color, etc. of any of the objects in your picture.

  3. Starting with the Graph tutorial, modify the Processing sketch to do something that changes or moves as the light level changes on a light sensor on your Arduino. You may also integrate this with the drawing assignment above
  4. Starting with the Dimmer tutorial, modify either the Processing sketch or the Arduino sketch so that when the mouse is in one half of the window an LED turns on, and when the mouse is in the other half of the window the LED turns off.
  5. Starting with the Arduino Dimmer tutorial, add parts of the Arduino blink tutorial so that the mouse position controls the speed of the blinking.
  6. Starting with your solution to problem 5 above, add a switch and modify the program so that when the switch is NOT pressed the mouse position controls the speed of the blinking, but when the switch is pressed the mouse position controls the brightness of an LED

Week 4 February 10

Upgrade to Arduino 1.6.0

Homework Review


  • What are voltage and current?
  • Resistance and Ohm’s law
  • Resistive vs. non-resistive components
  • Arduino outputs


While() and for() loops

  • Arduino File -> Examples -> Analog -> Fading

Homework due week 5 February 17

Week 5 February 17

Homework Feedback

  • Review, ReadASCIIString, SerialCallResponse, SerialCallResponseASCII, and the simple Processing class example
  • 10 k ohm and 1 k ohm don’t forget the k
  • Schematics:
  • Spelling, grammar, presentation is important. See College Wide Learning Outcomes regarding Written and Oral Communication
  • Wire colors
  • Coding weirdnesses that are not errors, but make your code harder to read and makes you appear to not understand
    • Unused variables
    • Unnecessary variables
    • Indentation
    • Using analog input for digital sensors
  • Why delay is not always good, and  Blink Without Delay
  • Solution to 6 above:
    Starting with the Arduino Dimmer tutorial, add parts of the 
    Arduino blink tutorial so that the mouse position controls 
    the speed of the blinking. Add a switch and modify the program 
    so that when the switch is NOT pressed the mouse position 
    controls the speed of the blinking, but when the switch is 
    pressed the mouse position controls the brightness of the LED 
    // constants won't change. Used here to set a pin number :
    const int ledPin = 9; // the pin that the LED is attached to
    const int pushButton1 = A0; // the  switch
    // Variables will change :
    int ledState = LOW;
    byte inByte;
    // Generally, you should use "unsigned long" 
    // for variables that hold time since the value 
    // quickly becomes too large for an int to store
    unsigned long previousMillis = 0; // last time LED was changed
    void setup() {
      // set the digital pin as output:
      pinMode(ledPin, OUTPUT);
    void loop()
      // First, get the current time and the state of the pushbutton
      unsigned long currentMillis = millis();
      int sensorValue = digitalRead(pushButton1);
      // figure out if it's time to change the state of the LED
      // compare to the current value of inByte
      if (currentMillis - previousMillis >= inByte) {
        // save the last time you blinked the LED
        previousMillis = currentMillis;
        // if the LED is off turn it on and vice-versa:
        if (ledState == LOW)
          ledState = HIGH;
          ledState = LOW;
      // If data has been received from the computer, update inByte
      if (Serial.available()) {
        // read the most recent byte (which will be from 0 to 255):
        inByte =;
      // finally, determine what to do with inByte depending on 
      // whether pushbutton is pressed or not. If 
      if (sensorValue == 1) {
        // if button is pressed, inByte controls brightness
        analogWrite(ledPin, inByte);
      } else {
        // button is not pressed, inByte controls blink rate
        digitalWrite(ledPin, ledState);

Lab: Soldering

  1. Wire
  2. Perforated breadboard

Homework due week 6 February 24

  1. Read the tutorial and watch the videos about H-bridges:
  2. Read (but you don’t need to do) the Arduino Potentiometer tutorial. The potentiometers we have in the lab look like this (also called trimpots) and can be inserted directly into your solderless breadboard like this.
  3. Build the circuit and verify the SerialCallResponseASCII example. Use two potentiometers for the analog sensors. As you manipulate the three sensors attached to Arduino, run the Processing sketch and see the circle move and change color.
  4. Modify the SerialCallResponseASCII example in the following ways:
    1. In the Processing sketch, instead of always sending the letter A, Processing will send back the mouseX position. Map the mouseX position to the range 0-255.
    2. Add an LED to one of the PWM outputs of your Arduino (3, 5, 6, 9, 10, or 11).
    3. Modify the Arduino sketch so that byte you receive from Processing is used to control the brightness of this new LED.

Week 6 February 24


  1. Functions
    1. No arguments; no return value
    2. One or more argument
    3. Return value (only one)
  2. Classes


  1. Sensors
    1. Resistive
      1. Switches
      2. Potentiometers
    2. Analog voltage
    3. Other interfaces
  2. Motors
    1. Permanent Magnet DC (PMDC), also known as Brushed DC (BDC) motors
    2. Servo motors
    3. Stepper motors
    4. H-bridges
  3. Sensing position
    1. Absolute
    2. Relative
    3. Continuous


  1. Case study: model elevator


    1. motor with battery; test
    2. motor with L293D and pushbuttons; test
    3. Unplug motor, add Arduino to read pushbuttons, print what you would do but don’t do it yet; test
void setup() {
  pinMode(8, OUTPUT);
  digitalWrite(8, LOW);
  pinMode(12, OUTPUT);
  digitalWrite(12, LOW);
void loop() {
  int in1 = digitalRead(2);
  int in2 = digitalRead(4);
  Serial.print("in1 = ");
  Serial.print(" in2 = ");
    • Why avoid 3, 5, 6, 9, 10, 11?
    • Why avoid Analog inputs?
    • Why avoid 13?
    • Why avoid 0 and 1?
    • modify code to control L293D; upload, then plug in motor but keep hand on wire to unplug in a hurry; test
    • add top and bottom sensors
    • expect things to take up more space!
    • If at bottom or top turn off motor immediately; move only if not at bottom or top
      • fancier: only move down if not at bottom; only move up if not at top
    • add floor sensors; test with println first then add code to go there
    • reduce delay so as not to miss floor sensor
    • keep println up to date so can see what’s going on
    • functions for frequently used code and for better understanding
const int bottomPin = 6;
const int IRProxPin = 7;
const int callPin = 3;
const int upPin = 4;
const int downPin = 2;
void setup() {
  pinMode(8, OUTPUT);
  digitalWrite(8, LOW);
  pinMode(12, OUTPUT);
  digitalWrite(12, LOW);
void loop() {
  int up = digitalRead(upPin);
  int down = digitalRead(downPin);
  int bottom = digitalRead(bottomPin);
  int irProx = digitalRead(IRProxPin);
  int call = digitalRead(callPin);
  Serial.print("up = ");
  Serial.print(" down = ");
  Serial.print(" IR proximity sensor = ");
  Serial.print(" bottom = ");
  //Serial.print(" top = ");
  Serial.print(" call = ");
  if ((bottom == 1) || ( irProx == 1 ) ) {
  } else if ( up == 1 ) {
  } else if ( down == 1 ) {
void stop () {
  digitalWrite(8, 0);
  digitalWrite(12, 0);
void goUp () {
  Serial.print(" going up ");
  digitalWrite(8, 1);
  digitalWrite(12, 0);
void goDown () {
  Serial.print(" going down ");
  digitalWrite(8, 0);
  digitalWrite(12, 1);

Circuit Construction

  1. Examples
  2. Moving things: sensing position, sensing danger
  3. Strain relief
  4. When to use stranded wire, when to use solid core wire
  5. Connectors and headers
  6. Proto shield
  7. More room than you think you’ll need
  8. Longer wires than you think you’ll need
  9. Design for
    1. Flexibility (ease of modification)
    2. Reliability (what happens if user presses up and down button at the same time?)
    3. Testability
      1. Can you work on the unit while it operates e.g. having to turn unit upside down to access circuit means you can never fiddle with circuit while it’s running
      2. E.g. headers in crucial spots for easy attachment of mutlimeter
      3. E.g. LEDs to indicate what motor is supposed to be doing

Homework due week 7 March 3

I have changed the assignment since our class today:

  1. Build a prototype of a contraption with a motor. It can be an elevator or you may make something up. Use any construction method you wish. Your prototype does not have to look nice.
  2. Build the circuit with the H-bridge chip (L293 / SN754410) with the pushbuttons. Test that you can control the motor with the pushbuttons.
  3. Later you will add sensors. For now, make a first draft of the circuit and write a brief description of how the sensors will protect your contraption from harming itself and will identify one intermediate position.
  4. Work in teams. The teams are:
    1. Nic, Dash
    2. Linda, Aaron
    3. Rob, Tutu
    4. Shihan, Allen
    5. Liam

Week 7 March 3

  1. Review drafts
  2. Learn what you need to finish your project

Homework due week 8 March 10

Finish your mechatronic projects. They don’t need to look pretty, but they do need to be at least 90 % functional.  Most importantly, the sensors need to sense what they are designed to sense, and the device needs to respond appropriately when the sensor senses that event.

Some of you might find your project easier to program if you structure your program as a Finite State Machine. Finite State Machines (FSMs) are described here  and requires that you understand an earlier tutorial  which is a little unclear because of the formatting of the code, but is still excellent. I have provided an example of an FSM here.

Week 8 March 10

  1. Presentation of projects
  2. What topics would you like to learn in the next month, leading up to final projects?
  3. Discussion of FSM
  4. Fritzing for schematic capture and printed circuit board (PCB) layout
  5. Servo project

Homework due week 9 March 17

  1. Finish your schematic and PCB layout in Fritzing
  2. Identify 3 topics you would like to learn more about in the field of mechatronics, broadly defined
  3. Read Getting Started with OtherMill Instructable
  4. Read How to: Fritzing / OtherMill

Week 9 March 17

  • Office hours: Office hours: Tuesday 3:00PM-3:30PM, Thursday 11:00AM-11:30AM, or by appointment

PCB project

  1. Fritzing and Othermill instructions are here
  2. Copy Andrew’s Arduino Shield Layout V2.fzz from here
  3. Save to a different file
  4. Add at least one each LED, pushbutton, and resistive sensor. The sensor will be off-board so use a 2 pin header for connector (use mystery part, select 2 pins and reduce ring thickness). Later, we will learn how to add sensors to the other end.

Homework due week 11 March 31

Design a printed circuit board

  1. Your circuit can be any design you chose as long as it is one of the following:
    1. An Arduino shield with at least one each LED, pushbutton, and resistive sensor. The sensor will be off-board, use header for connector (use mystery part, select 2 pins and reduce ring thickness)
    2. A circuit that has an integrated circuit (e.g. the 754410 dual H-bridge)
    3. A circuit that has at least 12 components, including connectors and headers
    4. Other circuits with my approval. Please email me your circuit early for my feedback. You may use this opportunity to create a board for your final project.
  2. You must follow the rules we learned in class and described here to design a board that can be millled with the limitations of our mill.
  3. Try to get the board cut. I know some of you are out of town but it will allow you to move into your project faster if you get this done before our next meeting.
  4. The Hybrid Lab is open during spring break. Here are the HL Spring break hours:

Saturday (3/21): Closed
Sunday: Closed
Monday: 9AM-5PM
Tuesday: 9AM-5PM
Wednesday: Closed
Thursday: 9AM-5PM
Friday: 9AM-5PM
Saturday: 12PM-8PM
Sunday: 12PM-8PM

Week 11 March 31


There was a great deal of interest in different types of sensors. Sensors and actuators are symettrical in that they both convert information from one form to another. Sensors: physical world information to some kind of electrical signal; Actuators: the other way around.

It is important to understand both of the ends of sensors and actuators:

  1. What physical property is the sensor sensing or the actuator affecting?
  2. How do the sensors and actuators  communicate, or interface, with the computer (or Arduino)?

Understanding interfaces is crucial for understanding sensors, as well as being useful in other ways


Formal interfaces

  1. Digital voltage, either HIGH or LOW (e.g. switch, reed switch)
  2. Analog voltage (what you already know, e.g. photoresistor)
  3. Parallel
    1. LCD
  4. Serial
    1. SPI
    2. I2C
    3. asynchronous serial
  5. PWM
  6. Frequency
  7. Ultrasonic
  8. etc.

Ad-hoc interfaces

  1. Interfacing Arduino to arbitrary electronics


  1. Can be entirely Arduino based or can incorporate laptop and Processing or other language
  2. Can be your own idea or:
    1. An animatronic contraption
    2. Must operate entirely without human touch (unless a sensor requires this e.g. touch sensor or switch)
    3. Must be repeatable


Build your PCB board!

Homework due week 12 April 7

  1. Find at least one sensor that is not yet on this list, and add yours with your name and a brief description. Simple sensors are perfectly acceptable, as well as exotic or obscure. Some places to start your research are here and here.
  2. Chose your final project and describe it on your blog. Some inspiration is here and here.
  3. Your project must not be too simple or too complicated.
  4. Your project must work. This means you should understand what your project needs and feel confident you can achieve it. A great video of a finished project doesn’t tell you anything about how the project was implemented. You need to understand the implementation. Even when projects are well documented, they still might not work. It’s not enough to copy a schematic or library, you need to understand it as you might have to fix it.
  5. Your description must include a block diagram of all the major hardware and software components you think you will need for your project. (Later you will prototype each of these major units to remove any doubt that you can get the project to work.)
  6. If you have any questions email me.

Week 12 April 7


  • Replacing wire (USB or otherwise)
    • XBee
    • Cheap radio modules
    • Bluetooth
      • Hacking existing BT devices
      • Phone? You have to write your own Android/iOS application (very difficult)
  • WiFi
    • WiFi shields
    • Yun
  • BLE
    • BLE shield
    • Blend Micro (Arduino + built-in BLE shield)
    • Phone? You have to write your own Android/iOS application (very difficult)
  • Internet
    • Interface via a web server
    • Storing and retrieving information from the cloud (Parse)
    • Using public APIs (Temboo)
    • Twilio
    • IFTTT
  • Issues
    • Peer-to-peer WiFi (one reason the cloud is so important)


Arduino Yun Parse tutorial

Homework due week 13 April 14

Refine your project definition. You will present this in class next week. Your presentation (which must also be on your blog or web page) must include the following:

  • Description
  • Block diagram of hardware (if used)
  • Block diagram or pseudo-code (described here and here) of software (if used)
  • Block diagram of mechanisms (if used)
  • Parts list
  • Links or references to technical details (hardware, software, or mechanism) that you will be copying
  • Technical details (hardware, software, or mechanism) that you will be developing, creating, or making yourself
  • Identify two areas that you are most concerned about

Week 13 April 14

Project Presentations

  • 5 minute presentation
  • 10 minute discussion
  • 9 students * 15 minutes = 2 hours and 15 minutes

Homework due week 14 April 21

Everyone has to show progress on your projects. In class, I will review these quickly and then we have the rest of the class for lab time and answering specific questions.

Below is the minimum amount of progress I expect you to show. This is based on my notes from your individual project presentations. If you are confused or think this is too much, you must communicate with me. You are encouraged to do more than I’m asking.

All of you should purchase all the parts you need immediately.

Rob: Get mouse interfaced to Arduino. Display, on serial monitor, numbers as mouse and scroll wheel are moved and buttons are clicked. Correctly identify which button/wheel direction has been moved.

Aaron: Prototype your petting detector of 3 photoresistors and demonstrate that you can detect the correct petting motion and then cause the purring.

Tutu: Prototype your mobile mushroom. Decide which motors you are using and buy them. Buy the battery, the DHT11, and the two ultrasonic distance measuring sensors, or whatever sensors you decided to use. Buy anything else you need and prototype the sensors sensing and the motors moving in the appropriate direction.

Linda: Buy the LCD panel and get one of the pong examples working on it

Liam: Prototype a use case of your battery pack with some appropriate device (often called the “load”, because anything that takes power from the battery is a load from the battery’s point of view)

Nic: Prototype your autonomous vehicle and demonstrate that it can 1) identify which direction (angle) is most clear of obstructions and 2) move roughly in that direction. I say roughly because correcting the angle as you travel should not be a concern at this stage. It’s ok to stop and take readings very often.

Shihan: Get your light sensor hooked up to Arduino and Processing, and demonstrate that Processing can create different types of sounds

Allen: Prototype vehicle. Demonstrate that proximity sensors can detect the walls of the maze and that the vehicle can navigate the maze

Last meeting April 28

Present your projects


Discussion: What to prepare for your review next week

  1. Select a few (3-4) of your very best projects from all of your classes to talk about. You only have 10 minutes for this so select carefully. Make notes to keep in your hand during your presentation. You don’t need to prepare a fully written speech, but make note of the key points you want to address that will remind you of everything you want to say. Index cards are often handy for this. Practice your presentation. Speak loudly and clearly, and don’t go too fast.
  2. Bring all (or most) of your work from all of your classes so that you can show them if they come up in the conversation. From this class, you should bring:
    1. Your midterm project
    2. Your PCB
    3. Your final project
    4. Be prepared to show your blog

Final assignment: Final project documented on your blog/website due Sunday 10 May at 10 AM

Assignments received after this deadline will not be accepted. Do not ask for extensions as none will be granted.

Your final project must be documented so that someone else could build it without your help. Your documentation must include at least the following, along with anything else you think is necessary or helpful:

  • Project overview
  • Schematic, if used
  • Arduino code, if used
  • Processing code, if used. If it’s too large store it elsewhere and provide a link
  • Your software must be well documented so that someone reading your code will understand what’s going on
  • Other code, if used. If it’s too large store it elsewhere and provide a link
  • Links to resources you used
  • Describe any problems and solutions, if solutions where found
  • Explain how you tested and debugged the problems that someone trying to follow your instructions might encounter
  • Parts list. Provide specific details and links as necessary

Your documentation must follow all the guidelines that we discussed in class. Review the assignments and your notes.


Topics you are interested in

  • Nic
    • Multi-Variable Bi-Directional Communications (including wireless)  (sending arrays of data between arduino & computer).
    • Other sensors like accelerometer, GPS, compass, environmental.
    • Matrix displays (for displaying alpha-numeric information).
  • Dash
  • Linda
    • 1. some prototypes like game controller. The ones that WII has.
    • 2. studio project prototypes. Related to my studio project.
    • 3. small games using processing and Arduino
  • Aaron
    • How to identify current and voltage limits for found components such as motors
    • Beginnings of making a remote controlled car
    • Tilt sensors and accelerometers
  • Rob
    • More explanation of motors and examples of good use cases
    • Integration / connectivity (WiFi, Bluetooth, RFiD)
    • How to use and communicate with more advanced sensors
  • Tutu
    • Banana Piano
    • Interactive Art
    • Kitchen mixer
  • Liam
    • lithium-ion/polymer batteries
    • using sensors rfid/nfc/btle
    • turning on lights through proximity sensors
  • Shihan
    • I would like to know more about interesting sensors and how I can utilize them for my own design.
    • Use interesting sensors get datas through analogIn, and make the output interesting. Like exhibition of interaction devices in gallery.
    • Combine the manufacturing process of products with technology. Such as 3D printing a kitchen tool or jewelry.
    • Use tech trigger and design short experiences.
  • Allen

Links to student blogs or websites

Print Friendly
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *