Interaction Lab Recitation 2 documentation

Sunny Song
Partner: Lily Yu
Professor: Marcela Godoy

 

Components:

  • 1 * Breadboard
  • 1 * Arduino Uno
  • 3 * Push-Button Switch
  • 1 * LDR
  • 3 * 220 ohm Resistors
  • LEDs
  • 3 * 10K ohm Variable Resistors (Potentiometers)
  • 1 * USB A to B Cable
  • Jumper Cables (Hook-up Wires)

 

Exercise 1

Part A

Step1: Using a Pushbutton

I built up the circuit based on the diagram step by step. But when I uploaded the sketch to my Arduino, the circuit failed to work. The first problem I noticed was that I forgot to put the push-button switch diagonally. The second fault was that I did not revise the pin numbers in the sketch. The last mistake was that the resistor was connected to the positive side of LED. After reconnecting the circuit and revising the sketch, the circuit worked successfully.

Step 2- Blinking an LED using a Pushbutton

In this step, I did not need to change the circuit but just need to write a new sketch. Basic example sketches BUTTON and BLINK should be combined together. The first question was that how to put them into a whole. Since I have learned Python, I tried to read and understand the two sketches by myself. After understanding, I added a part of BLINK into BUTTON. Then it came to a new question: why did the LED blink when I was not pressing the button? This result was counter to the requirement. So I asked professor for help and became realize that I should change the button status in the “if” conditions from HIGH to LOW. Finally, the circuit worked.

Step 3: Fading an LED with a Pushbutton

I tried to understand the example sketch and revised some part to make it fit the circuit. Then the circuit worked.

Step 4: Make your own Circuit!

I designed a parallel circuit in which pushbutton switches controlled LEDs to blink. The problem I met was that the LEDs could not blink but just brightened when I press the button. After a long time of testing, I found that I misconnected the LED’s direction again. By reversing all the LEDs, the circuit worked and all LEDs would blink when the button was pressed.

The picture of this circuit is below.

Part B

Step 1: Fading an LED with a Potentiometer

Potentiometer was a new component. The biggest problem was how to connect the potentiometer. I searched on the Internet as well as learned the method in the following lecture so this step finished very smoothly.

Step 2: Multiple Outputs with Multiple Inputs

The circuit was similar to what I have done in Part A Step 4. I just changed the pushbutton switches to potentiometers. By repeating the codes in step 1 for other two times and revised the variables, this task was also finished successfully.

Exercise 2

  1. During the assembly of the circuits, we used many electronic components as inputs and outputs. Which components do you recognize in the city?

The pushbutton switch and potentiometers are widely used in our daily life. To turn on/off the lights or change the temperature of AC, we may need to use them. Also, LEDs are very familiar with us as well. The red, yellow, green LEDs are just like the traffic lights.

 

  1. If you have 100000 LEDs of any brightness and color at your disposal, what would you make and where would you put it?

If I have 100000 LEDs, I want to build up a huge LED wall. Since the brightness and colors are not limited, I can build a wall with any pictures I want. And I can build up a complex system to control those lights, which makes the wall more vivid and beautiful. It will be a big artistic work so I would like to put it in some most fashionable malls and museums as a moving exhibition.

 

  1. Which reflections about the nature of interaction can you make about the Figure I.1 in the Physical Computing reading?

The Figure 1.1 showed that due to the simple input and output devices of computer, a computer’s image of human beings might just look like a hand with one finger, one eye, and two ears. This limits human beings’ interaction with the computers. Our body languages, facial expressions, and many other actions cannot have an interaction with the computer. But the reality is that all those elements should be taken into consideration. Interaction is something can be related to every part of human’s body. If more technologies are innovated and developed, we may find out more fields to use the ideas of interaction.

//PART A STEP 4
// constants won't change. They're used here to set pin numbers:
const int buttonPin1 = 2;     // the number of the pushbutton pin
const int ledPin1 =  3;      // the number of the LED pin
const int buttonPin2 = 4;     // the number of the pushbutton pin
const int ledPin2 =  5;      // the number of the LED pin
const int buttonPin3 = 8;     // the number of the pushbutton pin
const int ledPin3 =  9;      // the number of the LED pin

// variables will change:
int buttonState1 = 0;         // variable for reading the pushbutton status
int buttonState2 = 0;         // variable for reading the pushbutton status
int buttonState3 = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin1, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin1, INPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(buttonPin2, INPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(buttonPin3, INPUT);
}

void loop() {
  // read the state of the pushbutton value:
  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);
  buttonState3 = digitalRead(buttonPin3);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (buttonState1 == LOW) {
    // turn LED on:
    digitalWrite(ledPin1, HIGH);
    delay(100);                       // wait for a second
    digitalWrite(ledPin1, LOW);    // turn the LED off by making the voltage LOW
    delay(100);
  } else {
    // turn LED off:
    digitalWrite(ledPin1, LOW);
  }

  if (buttonState2 == LOW) {
    // turn LED on:
    digitalWrite(ledPin2, HIGH);
    delay(100);                       // wait for a second
    digitalWrite(ledPin2, LOW);    // turn the LED off by making the voltage LOW
    delay(100);
  } else {
    // turn LED off:
    digitalWrite(ledPin2, LOW);
  }

  if (buttonState3 == LOW) {
    // turn LED on:
    digitalWrite(ledPin3, HIGH);
    delay(100);                       // wait for a second
    digitalWrite(ledPin3, LOW);    // turn the LED off by making the voltage LOW
    delay(100);
  } else {
    // turn LED off:
    digitalWrite(ledPin3, LOW);
  }
}



//PART B STEP 2
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
analogWrite(11, analogRead(A0)/4);
Serial.println(analogRead(A0)/4);
analogWrite(10, analogRead(A1)/4);
Serial.println(analogRead(A1)/4);
analogWrite(9, analogRead(A2)/4);
Serial.println(analogRead(A2)/4);
}

One thought on “Interaction Lab Recitation 2 documentation

  1. Hi Sunny,
    when you say:

    The last mistake was that the resistor was connected to the positive side of LED.

    this is not a mistake, the resistor can be placed to the positive side or the negative, this is not going to change anything.

    Regarding to your answer to the question of the 100000 LEDs, I think it would be much more interesting to create an interactive screen that can react to the people in front of it maybe, since you are thinking to instal it in a mall and you clearly know how to control them now.

    Your documentation is pretty well done, I’d only recommend you to draw the circuit instead of showing a photo of the connections you made, because it is really difficult to understand the circuit with all those jumper cables. Besides that, you did a great post.

Leave a Reply