Week 3, Sensors-Yuxuan Li (Leon)

Recitation 3: Sensors

Circuit 1: Moisture Sensor

schematic diagram

Finished circuit

video:

Problems

  • The sensor didn’t work when we put water on one leg.
  • We didn’t know how to turn on the buzzer when writing the code.

Solutions

  • The moisture sensor test the currency between two legs. Water serves as a conductor to make it a closed circuit where currency flows. So we put two legs into water together.
  • Use “tune(9,1000) and noTune(9)” in the loop. 9 means the pin which the buzzor is inserted into, and 1000 means the frequency.

Result

  • When putting the two legs of the sensor into water, analog value rose.
  • If analog value reached 600 or lager, the LED lighted and the buzzer rang.

Circuit 2: 3-Axis Analog Accelerometer

schematic diagram

Finished circuit

video:

Problems

  • We wrote “(x > 500 or x<100)” in the code
  • The LEDs didn’t turn on when analog value satisfied the condition

Solutions

  • Use “||” instead of “or”
  • simplify the code in order to find out mistakes
  • write” int x = analogRead(xpin); int y = analogRead(ypin); int z = analogRead(zpin);” in the loop instead of in the beginning.
  • choose a appropriate number to trigger the LED

Result

  • move the sensor quickly
  • If its acceleration is enough on the x-axis, the red LED turns on
  • If its acceleration is enough on the y-axis, the green LED turns on
  • If its acceleration is enough on the z-axis, the yellow LED turns on

Question 1:

What did you intend to assemble in the recitation exercise? If your sensor/actuator combination were to be used for pragmatic purposes, who would use it, why would they use it, and how could it be used?

circuit 1

  • a LED and a buzzer controlled by the moisture sensor
  • Collector can use it to warn themselves if there is ponding in warehouses, thus ensuring an appropriate environment for their collection. In daily life, people can use it to know if water flows into their garbages on rainy days, especially for those who live in coastal or low-lying areas.

circuit 2

  • three LEDs separately controlled by the accelerometer
  • a 3D-speed game; an sports equipment to lose weight

Question 2:

Can you identify your circuit with any device you interact with in your daily life? How might your circuit be used to have a meaningful interaction?

circuit 1

  • voice-activated sensor light (use a sensor to control the outputs); automatic sprinkler (use moisture sensor to interact)
  • Due to the different conductivity of different liquids, the sensor can trigger different interactions through different analog value. Therefore, We can write different lights and music for different values. This allows the liquid to interact with humans through vision and hearing.

circuit 2

  • virtual reality speed games
  • When we move the sensors in different directions and at different speeds, multiple sets of data are generated. Experiencers can record their movements in the software by wearing these sensors.

Question 3:

How is code similar to following a recipe or tutorial?

To begin with, they all have an inherent logical sequence and format. When we are writing code, we must follow this logic and format, just as we can’t put food first and then put oil when cooking. Moreover, they all provide relatively clear instructions. Not only let us understand the specific meaning of the code, but also guide us to the physical computing. Most importantly, it allows us to adapt and create our own codes on the basis of correct logic and language format. That’s how code becomes vaious and practical.

Question 4:

In Language of New Media, Manovich describes the influence of computers on new media. In what ways do you believe the computer influences our human behaviors?

As a student, the most obvious impact I feel is that we are increasingly relying on technology and electronic devices in our academic life. For instance, we always use electronic devices to input articles instead of writing ideas on paper. Also, we use the software such as oneNote to take notes in class because they are free to edit and contain multiple medias.

Additionally, social media accounts for an increasing proportion of social activities. We are used to writing blogs, editing videos, and uploading our own experience and moods online though computers, on which case, it has greatly promoted the rise of the media.

Moreover, the invention and application of the computer greatly improved the efficiency of the individual, eliminating the production of a large amount of manual labor for low-level labor. Therefore, the way people work have changed a lot as well.

Reference

Recitation 3: Sensors

http://wiki.seeedstudio.com/Grove-Moisture_Sensor/

 

Circuit 1: Moisture Sensor
int sensorPin = A0;
int sensorValue = 0;
int Alexis = 11;

void setup() {
    Serial.begin(9600);
    pinMode(11,OUTPUT);
}
void loop() {
    // read the value from the sensor:
    sensorValue = analogRead(sensorPin);
    int sensorValueMap = map(sensorValue,0,1023,0,4000);
    Serial.print("Moisture = " );
    Serial.println(sensorValueMap);
    delay(1000);
    if (sensorValueMap > 600) {
      digitalWrite(Alexis,HIGH);
      tone(9,1000);
    } else {
      digitalWrite(Alexis,LOW);
      noTone(9);
    }
}

Circuit 2: 3-Axis Analog Accelerometer
/*
  ADXL3xx

  Reads an Analog Devices ADXL3xx accelerometer and communicates the
  acceleration to the computer. The pins used are designed to be easily
  compatible with the breakout boards from SparkFun, available from:
  http://www.sparkfun.com/commerce/categories.php?c=80

  The circuit:
  - analog 0: accelerometer self test
  - analog 1: z-axis
  - analog 2: y-axis
  - analog 3: x-axis
  - analog 4: ground
  - analog 5: vcc
 
  created 2 Jul 2008
  by David A. Mellis
  modified 30 Aug 2011
  by Tom Igoe

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/ADXL3xx
*/

// these constants describe the pins. They won't change:
const int groundpin = 18;             // analog input pin 4 -- ground
const int powerpin = 19;              // analog input pin 5 -- voltage
const int xpin = A3;                  // x-axis of the accelerometer
const int ypin = A2;                  // y-axis
const int zpin = A1;                  // z-axis (only on 3-axis models)
int Redled = 9;
int Greenled = 10;
int Yellowled = 11;


void setup() {
  // initialize the serial communications:
  Serial.begin(9600);

  // Provide ground and power by using the analog inputs as normal digital pins.
  // This makes it possible to directly connect the breakout board to the
  // Arduino. If you use the normal 5V and GND pins on the Arduino,
  // you can remove these lines.
  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW);
  digitalWrite(powerpin, HIGH);

  pinMode(Redled,OUTPUT);
  pinMode(Greenled,OUTPUT);
  pinMode(Yellowled,OUTPUT);
  
}

void loop() {
  // print the sensor values:
  int x = analogRead(xpin);
  int y = analogRead(ypin);
  int z = analogRead(zpin);
  // print the sensor values:
  Serial.print(analogRead(xpin));
  // print a tab between values:
  Serial.print("t");
  Serial.print(analogRead(ypin));
  // print a tab between values:
  Serial.print("t");
  Serial.print(analogRead(zpin));
  Serial.println();
  // delay before next reading:
  delay(100);

  if (x > 400 ) {
    digitalWrite(Redled,HIGH);
  }
 if (y > 400) {
   digitalWrite(Greenled,HIGH);
  }
  if (z > 400) {
    digitalWrite(Yellowled,HIGH); 
 }
}

recitation 3 sensors (Leon)

In this recitation, we learned how to build a circuit using a sensor. We chose the Moisture sensor and used tips from seeed studio.

 

diagram:

materials:

1* Arduino uno

1* moisture sensor

2* led ( yellow and green)

2* 220 ohm resistor

1* breadboard

jumper cables

 

process and intention:

With my partner Alice, we build the circuit together. At first, we follow the instruction in the code provided in the website to test whether the moisture sensor works. We can see the value presented in the screen become larger when we touch the sensor with our hands. But since my hand is much dryer than my partner’s, my value is much lower than hers. Mine is around 50 to 60 while hers is around 100-120. After the professor checks it, we continue to build our new circuit.

Our idea is to use the output of different lens to test who is using the sensor. To be more detailed, when I touch the sensor, the yellow led should be turned on, and when Alice touches the sensor, the green led should be turned on. So together with the fade code provided in the Arduino, I use the Condition code to control the led. When the sensor value is below 50, neither the leds should light up. When the sensor value is between 50-100, usually the value when I touch the sensor, the yellow light should light up and fade and move in circles. When the sensor value is above 100, usually the value when Alice uses the sensor, the yellow light should be turned down and the green light should light up and fade and move in circles.

Our problem appears when we find the sensor is not so flexible as we expected, which cause sometimes the light is turned on later and when Alice touch the sensor, the yellow light will blink several times because we can not control the humidity of our hands. However, our main purpose is achieved.

What I want to mention is that when I try to turn on the leds, I use the analog output because I want to get the fade effect. However, when I try to turn down the leds, I just use the digital output which can meet my expectations.

Video:

Question 1:

What did you intend to assemble in the recitation exercise? If your sensor/actuator combination were to be used for pragmatic purposes, who would use it, why would they use it, and how could it be used?

I intended to learn to use some sensors and try to do some programming to present my ideas of using the sensor. My idea is to test the humidity of our skin to show if the state of our skin is good. So I use mine and Alice’s hand to do the test, because our hands present two states of our skin. If my sensor combination were to be used for pragmatic purposes, I think all people who want to know whether their skin is good by using a really fast and convenient equipment would use it, and it will not cost them much and can be adjusted to personal statement easily, by changing some numbers in the code. All the combination just need assembling in a small equipment which can provide 5V power and then can be used.

Question 2:

Can you identify your circuit with any device you interact with in your daily life? How might your circuit be used to have a meaningful interaction?

My circuit is a simple model of the daily skin tester which we can use at home or maybe at the cosmetics store. But it can not show any data except the led’s color. My circuit can be used every morning or night when people want to know whether their skin is well cared, since sometimes people will not want to know much datas about their skin. In that way, I think it will be a meaningful interaction.

Question 3:

How is code similar to following a recipe or tutorial?

The code is just like the process of my thought. First, I want to define some pins used, so the setup code help me to do that. Then I want to made the conditional choice, the code help me to let the Arduino read the value to the sensor and do what should be done at that value. The code’s process is really clear, just like a recipe or tutorial.

Question 4:

In Language of New Media, Manovich describes the influence of computers on new media. In what ways do you believe the computer influences our human behaviors?

As Manovich suggested in Language of mew media, “computerization turns media into computer data.” I believe that the computer will finally turn anything in our daily life into datas and then process it. For instance, all the payment we made online or through credit cards or Alipay will be turned into datas that can be analyzed. Our preference and dislikes will be turned into datas too. By processing and analyzing these datas, anyone who can get access to these datas can easily learn anything about us. It’s true that computer has made our life more convenient, but I think what it influences our behavior is that it has turned our life into digital datas, which will make our behavior open in public.

int sensorPin = A0;
int sensorValue = 0;
int led = 9;           // the PWM pin the LED is attached to
int ledd = 10;      // the PWM pin the LEDd is attached to
int brightness = 0;    // how bright the LED is
int fadeAmount = 5;    // how many points to fade the LED by

void setup() {
    Serial.begin(9600);
     pinMode(led, OUTPUT);
     pinMode(ledd, OUTPUT);
}
void loop() {
    // read the value from the sensor:
    sensorValue = analogRead(sensorPin);
    Serial.print("Moisture = " );
    Serial.println(sensorValue);
    delay(1000);
    
    
    if ( sensorValue > 50) {
    analogWrite(led, brightness);
    
// change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;
  // reverse the direction of the fading at the ends of the fade:
  
if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  // wait for 100 milliseconds to see the dimming effect
  delay(10);
} 
  

if (sensorValue < 50) {
  digitalWrite (led, LOW);
  digitalWrite (ledd, LOW);
}

if (sensorValue > 100) {
    analogWrite(ledd, brightness);
    digitalWrite (led, LOW);   

  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;

  // reverse the direction of the fading at the ends of the fade:
  if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  // wait for 100 milliseconds to see the dimming effect
  delay(10);
} 
  

}

Recitation 3: Sensors (Rudi)

In today’s recitation, we are supposed to pick a sensor, then build a circuit that integrates this sensor with our Arduino. We chose 3-Axis Analog Accelerometer and used the ADXL3xx example.

Components: 

1.Breadboard;

2.3-Axis Analog Accelerometer;

3.LED;

4.220 ohm Resistor;  

5.Jumper Cables (Hook-up Wires)

 

 

Process: 

We first connected the 3-Axis Analog Accelerometer with the circuit according to the schematic. The 3-Axis Analog Accelerometer works as soon as we uploaded the example code. As we changed the position of the 3-Axis Analog Accelerometer at different speeds, the serial monitor changed as well. So that means our 3-Axis Analog Accelerometer can work alone.

Later, we intended to use the 3-Axis Analog Accelerometer to control the brightness of the LED. In other words, we expected that the brightness of the LED change while we are putting the 3-Axis Analog Accelerometer in different spot at different speed. Therefore, we put one 220 ohm Resistor and an orange LED on the breadboard, then connected them to the Arduino UNO. But we got trouble about how to map an analog input. Professor Rudi came to help. He suggested us to search for more instructions on Arduino’s website and explained that there should only be one setup and one loop in the code. So we adjust the code and tried, the circuit works beyond imagination. When we switch 3-Axis Analog Accelerometer, the brightness of the LED exactly changed. However, the brightness only ranged in a very limited scope. That’s to say, the change of the brightness is not quite obvious. Professor Rudi advised us to check the code again. This time, we found that the serial monitor actually ranging from 200 to 400, not that huge as the code default designed. Consequently, we changed the original code 0-1023 to 200-400. After the adjustment, the LED’s brightness varied quite obvious.

 

 

 

Question 1:

What did you intend to assemble in the recitation exercise? If your sensor/actuator combination were to be used for pragmatic purposes, who would use it, why would they use it, and how could it be used?

I intended to assemble LED and 3-Axis Analog Accelerometer.

I think our sensor can be used to adjust the light stage effect in a concert. DJs, directors, and singers can use it. Simply by turning the 3-Axis Analog Accelerometer up and down, they could use it to create a special atmosphere which supports the stage, so that audiences can enjoy the performance in a visual aspect. 

   

Question 2:

Can you identify your circuit with any device you interact with in your daily life? How might your circuit be used to have a meaningful interaction?

I believe that my circuit can identify with a speed tester in my daily life. Their working methods are really similar.

I think my circuit can be fit in various meaningful fields, such as it can be used in a music concert as I have discussed above. Furthermore, it can also be used to design games. Take the 3-Axis Analog Accelerometer as a control center, the brightness of the light may change based on the speed and position of the 3-Axis Analog Accelerometer which a player uses it.

 

Question 3:

How is code similar to following a recipe or tutorial?

Code is similar to following a recipe or tutorial in a certain degree. Both of them are generally following instructions given by somebody else. However, differences also exist. For instance, while following a recipe or tutorial, people do not need to understand every single word. To get the main idea is the purpose. But computer have to follow the code strictly. It continues only if every code is right. Otherwise, the task can not be done.

Question 4:

In Language of New Media, Manovich describes the influence of computers on new media. In what ways do you believe the computer influences our human behaviors?

From where I stand, computers can influence our life in various ways. To start with, computers have already changed our ways of communicating, obtaining information and transacting. The development of technology has changed the world to a more fast and convenient place. So that human behaviors become more simplified and easier. However, one disadvantageous impact is that people gradually become lazy. They are longing for a method which the computers can do anything they want for them. In conclusion, influences can be varied and beyond imagination. We need to find a way to balance the current situation and the development.

/*
  ADXL3xx

  Reads an Analog Devices ADXL3xx accelerometer and communicates the
  acceleration to the computer. The pins used are designed to be easily
  compatible with the breakout boards from SparkFun, available from:
  http://www.sparkfun.com/commerce/categories.php?c=80

  The circuit:
  - analog 0: accelerometer self test
  - analog 1: z-axis
  - analog 2: y-axis
  - analog 3: x-axis
  - analog 4: ground
  - analog 5: vcc

  created 2 Jul 2008
  by David A. Mellis
  modified 30 Aug 2011
  by Tom Igoe

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/ADXL3xx
*/

// these constants describe the pins. They won't change:
const int groundpin = 18;             // analog input pin 4 -- ground
const int powerpin = 19;              // analog input pin 5 -- voltage
const int xpin = A3;                  // x-axis of the accelerometer
const int ypin = A2;                  // y-axis
const int zpin = A1;                  // z-axis (only on 3-axis models)
float val = 0;
void setup() {
  // initialize the serial communications:
  Serial.begin(9600);

  // Provide ground and power by using the analog inputs as normal digital pins.
  // This makes it possible to directly connect the breakout board to the
  // Arduino. If you use the normal 5V and GND pins on the Arduino,
  // you can remove these lines.
  pinMode(groundpin, OUTPUT);
  pinMode(powerpin, OUTPUT);
  digitalWrite(groundpin, LOW);
  digitalWrite(powerpin, HIGH);
 pinMode(9, OUTPUT);
  
}

void loop() {
  // print the sensor values:
  Serial.print(analogRead(xpin));
  // print a tab between values:
  Serial.print("t");
  Serial.print(analogRead(ypin));
  // print a tab between values:
  Serial.print("t");
  Serial.print(analogRead(zpin));
  Serial.println();
  // delay before next reading:
  delay(100);
  val = map(analogRead(0), 200, 400, 0, 256);
  analogWrite(9, val);
}

Week 3: Sensors (Jiaqi Hu)

Professor: Eric&Young

Partner: Frank Wang

 

Components:

  • Joystick Module
  • Breadboard
  • Arduino uno
  • LEDs ( red, yellow, green)
  • 220 ohm resistors
  • wires

Diagram:

Video:

Problems:

  1. Forget to connect resistors with LEDs.
  2. Do not know how to write codes which enable different axises of joystick module control LEDs in one to one correspondence.
  3. LEDs can’t light when connected to joystick module because we mistake the output pins of LEDs for input pins and connect the wrong wires.

Solutions:

  1. Connect 220 ohm resistors in parallel with LEDs.
  2. Test the joystick module and measure each value of its axises. Follow examples to write basic codes(such as input pins, analogWrite and digitalWrite) and ask instructors for help to complete the map codes.
  3. Change the wires and connect each LEDs to corresponding axises of joystick module.

Results:

The red LED light when joystick is turned right and when it’s turn left slowly the LED fades. The yellow LED is the same when joystick is turned upwards or downwards. The green LED light when the button is pressed and turns off when button is pressed again.

Question 1:

What did you intend to assemble in the recitation exercise? If your sensor/actuator combination were to be used for pragmatic purposes, who would use it, why would they use it, and how could it be used?

We intended to use different axises of joystick module to control different LEDs.

Car warning lights. When people are parking cars, LEDs with different colors light to represent different directions in which cars move. The visualized signals can be more clear to convey messages for people when they are unable to keep watching the directions while parking.

Question 2:

Can you identify your circuit with any device you interact with in your daily life? How might your circuit be used to have a meaningful interaction?

The keypad (especially dial pad), which makes different sounds when you dial different numbers, could be a more complicated version of our circuit.  In my view they share a similar mechanism.

Our circuit might be further improved such as by using more complicated lights which can show the changes in colors and brightness better. Converting the sense of direction into visual scene, when we are changing the directions from right to left or up to down, we can closely observe the brightness of lights and shad of colors to have a better understanding without using a conventional way.

Question 3:

How is code similar to following a recipe or tutorial?

First, both code and recipe or tutorial have clear instructions and steps. We are required to follow them step by step but cannot skip some of them or change the sequences. Second, they all need to follow certain format rather than do whatever we want. Third, you can add, subtract or change some parts of the steps to express personal appetites or ideas. Last but not least, once one step of them is wrong, the whole system may not work normally and need you to fix the small errors.

Question 4:

In Language of New Media, Manovich describes the influence of computers on new media. In what ways do you believe the computer influences our human behaviors?

First of all, computer has greatly influenced the way we communicate with each other. Communications are not limited by time or space any more, and have developed more forms than we could imagine before. Second, computer changes the perspectives by which we view the world. Computer is like another eye of humans, with both new and dead angles. On the one hand human perceive the world more likely through a numerical lens, while on the other such lens blocks something important and we just leg behind even computer brings as much convenience as possible at present.

Sample code of joystick module:

// # 
// # Editor     : Lauren from DFRobot
// # Date       : 17.01.2012

// # Product name: Joystick Module
// # Product SKU : DFR0061
// # Version     : 1.0

// # Description:
// # Modify the Sample code for the Joystick Module 

// # Connection:
// #        X-Axis  -> Analog pin 0
// #        Y-Axis  -> Analog pin 1
// #        Z-Axis  -> Digital pin 3
// # 


int JoyStick_X = 0; //x
int JoyStick_Y = 1; //y
int JoyStick_Z = 3; //key

void setup() 
{
  pinMode(JoyStick_Z, INPUT); 
  Serial.begin(9600); // 9600 bps
}
void loop() 
{
  int x,y,z;
  x=analogRead(JoyStick_X);
  y=analogRead(JoyStick_Y);
  z=digitalRead(JoyStick_Z);
  Serial.print(x ,DEC);
  Serial.print(",");
  Serial.print(y ,DEC);
  Serial.print(",");
  Serial.println(z ,DEC);
  delay(100);
}

Week 1: Research Topic Proposal— The Beyond

Do you believe in souls? Have you ever wondered that there’s an afterlife? As alive human beings, it is impossible for us to experience the experience after we die (or maybe there’s no experience at all). This question haunts human beings from the very first start. A common theme throughout every religion is the discussion of the afterlife. In Buddhism, there’s 轮回, which refers to a cycle of different lives that one has to suffer through in order to finally reach heaven. In Christianity, if you do good you go to heaven after you die, but otherwise, you get burned for eternity in hell. Whether or not the talking about the afterlife is of the purpose of advice people to do good deeds during this life, many people strive for their afterlife through hard work in this life. We always want our lives to be more than this one. But is there really a place for the souls after death?

In Museum “The Beyond”, we try to investigate what happens after we die through different approaches. Through representations, real-life accounts from people who have had near-death experiences(one thing they all described is feeling love and free when in the state), through visual exhibitions of the afterlife of different religions and beliefs, through scientists effort to explain the beyond and the near-death experiences, we try to present a comprehensive picture of “The Beyond’.

Located in Shanghai, the exhibition also tries to open up the conversations about death, which is often banned in the Chinese culture. We hope to, through different means, let the audiences’ opinion about death and the afterlife be part of the exhibition. We also try to fill the gap in death education in China. We believe that better living comes from better thinking and accepting death.

Sensor by Crystal (Yujia Liu)(Pro : Marcela)

This week we learn about some kinds of Sensors.

Firstly, we choose vibration sensor.

Hardwares:

Arduino board*1 to connect the computer getting code

LED*1 to show signal

220 ohm resistor*1 to make V lower for LED

hook-up wires to connect each component 

1 megohm resistor *1to protect sensor

Piezo electric disc *1 to be the sensor

Process :

This is a pretty easy circuit to build, we just added a LED to let us know the function of sensor. Then we just touched the sensor and the light was on, which was interesting.

Secondly we used Moisture Sensor

Hardwares:

Arduino *1

Moisture sensor *1

Wires 

Process :

The only thing we confused is the colors’ meanings, then we clicked the link and found it on the website. Finally we succeeded. Then we used it to test the moisture of the plants and we found that the value is far more than the value of our hands.

Question 1

I use vibration sensor and moisture sensor. I think weather bureau might use moisture sensor to measure atmospheric humidity and predict weather more precisely. As for vibration sensor, academic staff might use it to detect object motion to do some researches. Because they are more  sensitive than human and more precise, so it’s better for them to use it to feel something that is really hard to observe.

Question 2

 My circuit of vibration sensor can be used in touch switch in our daily life. We can use it on security net. If someone without permission and touch the net it will set the alarm.

Question 3

All of them tell instruction and every step you need to take. 

Question 4

In the article the author said that media becomes programmable. Also I think with the large-scale application of computers, human may become thinking in a more programmable way. What’s more, as we use technology to achieve interaction among us, we can have more colorful forms of interaction and more interactive objects. However, it might  also cause interaction to be less imaginary but more formulated, just as every coin has 2 sides

 

1. for moisture sensor
int sensorPin = A0;
int sensorValue = 0;

void setup() {
    Serial.begin(9600);
}
void loop() {
    // read the value from the sensor:
    sensorValue = analogRead(sensorPin);
    Serial.print("Moisture = " );
    Serial.println(sensorValue);
    delay(1000);
}





2.for vibration sensor
/*
  Knock Sensor

  This sketch reads a piezo element to detect a knocking sound.
  It reads an analog pin and compares the result to a set threshold.
  If the result is greater than the threshold, it writes "knock" to the serial
  port, and toggles the LED on pin 13.

  The circuit:
	- positive connection of the piezo attached to analog in 0
	- negative connection of the piezo attached to ground
	- 1 megohm resistor attached from analog in 0 to ground

  created 25 Mar 2007
  by David Cuartielles <http://www.0j0.org>
  modified 30 Aug 2011
  by Tom Igoe

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/Knock
*/


// these constants won't change:
const int ledPin = 13;      // LED connected to digital pin 13
const int knockSensor = A0; // the piezo is connected to analog pin 0
const int threshold = 100;  // threshold value to decide when the detected sound is a knock or not


// these variables will change:
int sensorReading = 0;      // variable to store the value read from the sensor pin
int ledState = LOW;         // variable used to store the last LED status, to toggle the light

void setup() {
  pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT
  Serial.begin(9600);       // use the serial port
}

void loop() {
  // read the sensor and store it in the variable sensorReading:
  sensorReading = analogRead(knockSensor);

  // if the sensor reading is greater than the threshold:
  if (sensorReading >= threshold) {
    // toggle the status of the ledPin:
    ledState = !ledState;
    // update the LED pin itself:
    digitalWrite(ledPin, ledState);
    // send the string "Knock!" back to the computer, followed by newline
    Serial.println("Knock!");
  }
  delay(100);  // delay to avoid overloading the serial port buffer
}

Week 2: Arduino Basics – Zeyu Lu (Marcela)

 

Zeyu Lu

Professor Godoy

Interaction Lab Recitation

14 September 2018

Arduino Basics

Week 2 Recitation

  • Circuit 1: Fade

Components:

  • LED

By generating various brightness level of light, the LED creates the fading effect.

  • Resistor 220Ω

By reducing the current flow, the resistor protects the LED from too much voltage.

  • Wires

By conducting electricity, wires connect components.

 

 

It is a simple series circuit. I just put the LED and the resistor in a chain.

 

Process:

  • Build the circuit according to the circuit diagram Success

 

  • Upload the code to the Arduino. Success

#The key to the fading effect is to create a loop.

 

  • Circuit 2: toneMelody

Components:

  • Speaker

By generating different pitch of the sound, the speaker creates the melody.

  • Resistor 220Ω

By reducing the current flow, the resistor protects the LED from too much voltage.

  • Wires

By conducting electricity, wires connect components.

 

IMG_44551

 

It is also a simple series circuit. I just put the speaker and the resistor in a chain.

 

Process:

  • Build the circuit according to the circuit diagram. Success

 

  • Upload the code to the Arduino. Success

#The key to the melody effect is to create a loop and make some change to the pitch.

 

  • Circuit 3: Zelda Simon Says

Components:

  • LED

By generating light, the LED shows the signal to the player.

  • Speaker

By generating different pitch of sound, the speaker tells the player whether he  or she succeeds.

  • Resistor 220Ω

By reducing the current flow, the resistor protects the LED from too much voltage.

  • Wires

By conducting electricity, wires connect components.

  • Switches

By pushing the button, one switch starts the game and others are used as player’s input.

 

 

It looks complicated, but I found some patterns. Firstly, the LED, two resistors, one switch are in one series circuit. And the other three follow the pattern. Then there’s one switch and a resistor connected directly to the power and the ground to control the other four. Finally, I connected the speaker in parallel.

 

Process:

  • Build the circuit according to the circuit diagram. Failure

#I just had four switches but I needed five.

  • Delete one switch in the code.        Failure

#I didn’t fully understand the code, so it was difficult for me to make any change.

  • Borrow one switch and upload the original code. Success

#It turned out that just borrowing one more switch was much easier than reprogramming.

 

  • Reflections

Although I was instructed to do the exercises in pairs, I was reluctant to work with others because I’d rather solve every problem by myself. When it came to Circuit 3, however, I run into the shortage of equipment. I had intended to solve it by modifying the given code, but I failed. At last, I had to ask others for help. Luckily, one friendly student lent me his LED, and I made it finally.

In this recitation, I learned cooperation is important and efficient, but I still prefer to work alone.

 

  • Questions

Question 1:

Reflect on different interactions with technologies that you have observed in your daily life. Pick a few of these and write down your own definition of interaction based on your observations.

Observations:

the checkout counters in the NYUSH cafeteria

I think they’re well-designed in that the user just needs to put the plate on the table and place the card, and then they will check out automatically, which makes the process efficient and accurate. If one forgets to place the card and leave, they will give out a warning. For the checkout counter, it perfectly handles the inputs which are the food plates, processes the data, and outputs the total price. But on the other side, the user’s input is limited to the plates. So it is fantastic for checkout, but I think it isn’t highly interactive.

vending machines

Vending machines are similar to the checkout counters in terms of checkout, but their input is simplified to the numbers the users enter. And it displays how the purchased items fall to the box, which is a kind of fun.

Apple Watch

Apple Watch has various sensors so that it can measure the distance the user walks, the stairs climbed, and so on. Among them, what impresses me most is the LED lights and light-sensitive photodiodes which can monitor the heart rate.

Definition:

I think interaction is an infinite loop consisted of input, process, and output between two subjects.

 

Question 2:

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

Inputs: switches

Outputs: the LED, the speaker

 

Question 3:

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

I would like to use the LEDs to hold an event to raise citizens’ awareness of how much light a city generates every night. This event can be held in any modern building located in the CBD area. All the lights should be turned off. And there are only LED strings on the wall to provide the minimum light for the participants to see their way. The LED lights will finally lead them to one ordinary-bright room. Then they may realize how bright it is. We can use the rest of the LEDs to hold similar events in other metropolitans where people take brightness for granted.

The event is intended to raise people’s appreciation on electricity and light where they have been overlooked and wasted casually.

 

Question 4:

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

It vividly shows the limitation of the input of ordinary computers. People’s other sensors don’t exist from a computer’s perspective because they can’t be the input. According to O’Sullivan and Igoe, there is growing need for the “computers that respond to the rest of your body and the rest of your world” (Introduction). And I think the finger in Figure I.1 may only be a moving stick to computer despite how sensitive human finger actually is.

 

  • Citation

All diagrams except the last one are from:

http://ima.nyu.sh/interaction-lab/category/recitations/

The Zelda Simon Says circuit and code were from:

https://www.tinkercad.com/things/bMAvN7Djoja#/

Physical Computing – Introduction, O’Sullivan and Igoe

Physical Computing’s Greatest Hits (and misses) by Tom Igoe

 

Research on Kinematic sculptures (working with electrons)

The research on Kinematic sculptures for me is done in a time relevant base. I took a look on what’s the character of kinematic aesthetic representation in ancient time, then I tried to compare them with the comtemperory representation.

Among many kenematic representation, I chose one famous painting from Vincent van Gogh as the sign of Kinematic aesthetic in ancient time.

“动态艺术”的图片搜索结果

https://www.google.com.hk/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwjAseDA_MvdAhWHuY8KHbWxAZUQjRx6BAgBEAU&url=https%3A%2F%2Ftwitter.com%2Fwanfuqin%2Fstatus%2F973593097534754817&psig=AOvVaw0F456aim2abacDSD3Iych4&ust=1537614490769722

I chose this picture for one main reason that it shows a very vivid kinematic figure even though it’s actually still. By looking at this picture, one may feel that the clouds, the sky and even the mountain is moving. Actually, this is one main characters for the ancient representation of kinematic figure, which using the static figure to describe the moving object. This is probably due to the technology limitation back then. Compared to the advanced technology and all sorts of energy source, painting may be one of the best ways to accomplish this goal in the ancient time.

For the comtemporary kinematic sculptures, I chose several representatives that I felt really interesting.

佳士得在伦敦推出动态艺术展

“Kinetic sculptures”的图片搜索结果

“Kinetic sculptures”的图片搜索结果

The first one here is done by playing with the shadow and the light source.

The second one is utilizing the power of wind and produce a moving object so that the viewer will observe multiple sides of the sculpture.

The third one is using hundreds of metal. The reflection and the special visual effect of the metal is the main reason why this figure is stunning.

All three kinematic sculptures are very astonishing but all of them are only can be done in the comtemporary society. This also suggests that the technology developement will somehow broaden the way of representation of aesthetic works.