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);
} 
  

}

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);
}

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

 

Recitation 3: Sensors By Tian Qin(Rudi)

Components:

Arduino, Ultrasonic Ranger, Wire, LED, 220 ohm Resistor

Diagram

Question 1

I would like to assemble a circuit with an ultrasonic ranger. For pragmatic purpose, the ultrasonic ranger can be used in the car backing radar which can be used by every driver. The car backing radar can make it much easier for the drivers to back the car and avoid some accidents , such as accidentally hit someone when backing. The radar will make some noise if there is anything behind the car.

Question 2

Car backing radar, automatic door and the distance sensor in our phones. The ultrasonic ranger can be used in a device which can help the blind to detect the obstacles around them and avoid accidents.

Question 3

Code is partially similar to following a recipe or tutorial because the computer will follow the code step by step. However, they are also different because when following a recipe or tutorial, you don’t necessarily need to completely follow the instruction and can make some adjust to them, but  when a computer following the code, it can only follow it strictly and the code must obey the rule, or the computer can’t figure it out.

Question 4

With the emergence of the computer, human gradually became lazy because of the help of the computer in almost every fields of our life. With the development and the spread of the computer, human also gradually became accustomed to the exist of the computer and lost some of the abilities. And the convenience of the information online made human relay on the search engine and other Internet too much and lose the ability to remember.

/*
  Ping))) Sensor

  This sketch reads a PING))) ultrasonic rangefinder and returns the distance
  to the closest object in range. To do this, it sends a pulse to the sensor to
  initiate a reading, then listens for a pulse to return. The length of the
  returning pulse is proportional to the distance of the object from the sensor.

  The circuit:
 - +V connection of the PING))) attached to +5V
 - GND connection of the PING))) attached to ground
 - SIG connection of the PING))) attached to digital pin 7

  created 3 Nov 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/Ping
*/

// this constant won't change. It's the pin number of the sensor's output:
const int pingPin = 7;
int ledPin = 9;

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  pinMode (ledPin,OUTPUT);
}

void loop() {
  // establish variables for duration of the ping, and the distance result
  // in inches and centimeters:
  long duration, inches, cm;

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);

  // The same pin is used to read the signal from the PING))): a HIGH pulse
  // whose duration is the time (in microseconds) from the sending of the ping
  // to the reception of its echo off of an object.
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

  // convert the time into a distance
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);
  
  Serial.print(inches);
  Serial.print("in, ");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();
  if (duration <= 1000){
     analogWrite (ledPin,map(duration,100,1000,0,255));
  }
  else{
    analogWrite(9,0);
  }
 

  delay(100);
}

long microsecondsToInches(long microseconds) {
  // According to Parallax's datasheet for the PING))), there are 73.746
  // microseconds per inch (i.e. sound travels at 1130 feet per second).
  // This gives the distance travelled by the ping, outbound and return,
  // so we divide by 2 to get the distance of the obstacle.
  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf
  return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds) {
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the object we
  // take half of the distance travelled.
  return microseconds / 29 / 2;
}

Week 3 Documentation by Jannie Zhou(Leon)

Recitation 3: Sensors

Date:  09/21/2018

Documented by: Jannie Zhou

Instructor: Leon & Rudi

Partner: Antonia

Circuit 1:

We built a circuit with vibration sensor. Despite of the original circuit we put a LED into this.

 

 

Circuit 2:

We built a circuit with moisture sensor. At first we didn’t know how to do with the 4 wired hooked on the sensor. But then we found out that we only need to connect 3 of them to the Arduino board.

 

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?

Take our second circuit as an example, we intend to use this sensor to detect the humidity. For pragmatic use, this circuit can be used by some cosmetic companies. If they claim that their products could moisturize the skin they can use this sensor to detect the moisture before and after using their products so that the customers would actually  believe them.

 

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 thermometer. The thermometer can sense the temperature and the moisture of the air. And our moisture sensor could be used in some VR experience to interact with the user to provide a perfect experience.

 

Question 3:

How is code similar to following a recipe or tutorial?

Code is the recipe for the computer. The computer read the code and follow it. They cannot create anything else beside the code. All they can do is follow it.

 

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?

Computer changed the way we think and reshaped our views of the world. For example, before the age of computer, no one would actually believe that you can FaceTime with someone who is 10,000 miles away from you. And no one would think that you can know there’s an earthquake or terrorism attack 5 minutes after it happens. And as we become more and more dependent on computers, we become more and more forgetful and impatient. We need our computer to organize our work, to create our schedule,  to remind us to do this or that. And we don’t want to wait any longer because the computer could send your message out in 1 second, and they can do calculating in an unbelievable speed.

Recitation 3: Sensors—Ziying Wang (Leon)

Moisture Sensor

Component: LED, Moisture Sensor, Arduino micro controller, USB cable

Code:

int sensorPin = A0;

int sensorValue = 0;

int led=13;

void setup() {

    Serial.begin(9600);

    pinMode(13, OUTPUT);

}

void loop() {

    // read the value from the sensor:

    sensorValue = analogRead(sensorPin);

    Serial.print(“Moisture = ” );

    Serial.println(sensorValue);

    delay(1000);

if (sensorValue>=50){

  digitalWrite(13,HIGH);

}

else if (sensorValue<200){

  digitalWrite(13,LOW);

}

Result: When the value of the sensor goes above 50 (including 50), LED lights up; If not, it doesn’t light up.

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 use the moisture sensor to build a draft fan for bathroom. People can assemble it in their bathrooms. After they take a shower, the bathroom can get very moist and uncomfortable. With this sensor, when the moisture reaches a fixed value, the sensor will turn on the draft fan and exhaust the hot air out of the bathroom.

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 would like my circuit to be connected with my balcony’s shed. When it’s raining, the sensor can detect the moisture value and control the shed to cover the balcony. It can prevent my things on the balcony from getting wet.

Question 3:

How is code similar to following a recipe or tutorial?

Most of the code is the same with the code of the moisture sensor. I adjust a part of it and put in a conditional code which controls the LED in the end of the code.

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?

One of the most important behaviors of human beings that was influenced by the computer is our willingness to think. With the existence of computer, we are too lazy to do even the most basic calculus. When coming across a problem, we wouldn’t think of the solution ourselves, our only solution is to put the questions in the internet and follow the instructions online. Nevertheless, computer still influence us in a good way. It makes our lives more efficient and vastly saves our time. It’s like our second body that can do things according to our orders.

Week #2, Arduino Basics (Leon)

Circuit 1: Fade

Materials

  • 1 Arduino  board
  • 1 LED
  • 1 220 ohm resistor
  • Hook-up wires
  • 1 breadboard

Description. My partner and I, connected the positive leg of the LED, to pin number 9 on the breadboard, through a 220-ohm resistor. In addition, we had to connect the negative side of the LED  to the GRD (ground) on the breadboard.

Figure 1.

Circuit 2: toneMelody

Materials

  • 1 Arduino  board
  • 1 piezo buzzer or a speaker
  •   Hook-up wires

Video 1. toneMelody 

 

Circuit 3: Speed Game

Materials. To play the game we used  Serial Monitor in Arduino IDE. (https://www.tinkercad.com/things/9reyJ6uTVoY-race-the-led/editel?sharecode=qMMfF_Cz3H5x-Esm7jx3SWGdZiYYLh864n9laKlOxxc=)

  • 1 Arduino board
  • 2  LED
  • 4  220 ohm resistor
  • Hook-up wires
  • 1 Piezo

    Speed Game Schematic

  • 2 Buttons
  • 1 breadboard

Description. With my partner, we made this Circuit a Speed Game, which consisted of a game where we race each other to click a button faster. Whoever clicked the button faster and more times win. I lost in all the stars.

Video 2. Speed Game

Figure 2.

Question 1:

Interactions with technologies that you have observed in your daily life:

  • Automatic doors
  • Fingerprints in phones
  • Turn on/off lights
  • Turn low/high volume of phones, computers…

I believe Interaction is a process between two or more actors (humans, human-computer, etc), where these actors execute a process of listening, speaking and/or thinking between each other. For example, when I use my phone and put my fingerprint, I make an input, then there is a process of recognizing my fingerprints, and the output is the phone unlocked. Therefore, there is an interaction between a human and a phone. Many times, we can have many benefits from interaction between computers and humans, making easier life for people,  such as for communication, entertainment, and many others.

Question 2:

 Electronic components as inputs and outputs:

Input: Push Buttons, Resistors.

Output: LEDs, Buzzer.

Question 3:

If I had  100000 LEDs of any brightness and color at my disposal, I like to make a transparent platform floor, with LEDs lights under. Therefore, with the help of sensors, each time you step LED lights form different colors will turn on depending on the weight of the person, For example, for a weight of 50 kilograms or under,  blue LEDs turn on , and for 70 kilograms above red LEDs turn on.

Question 4:

Reflections of  nature of interaction Figure I.1 in the Physical Computing reading. 

How I mentioned in previous question Interaction is a process between two or more actors (humans, human-computer, etc), where these actors execute a process of listening, speaking and/or thinking between each other. Therefore by looking at Figure I.1 in Physical Computing reading,  this figure represents the way human and computer interact. It looks like the shape of a face with two ears, one eye and one finger going out of this “face”. The human can begin with the simple input of turning on the computer, and the output is the computer on.We interact with computers using three human senses: touch, hearing, seeing. However, we do not use all our sense with computers, as we leave aside taste and smell.  

 

 

Recitation Week3 (Leon)

Question:

  1. Ultrasonic Ranger

This can be used to control flushing toilet, when it detects someone is beyond the fixed distance, it can start flushing. It can keep the bathroom clean and also help the old people flush if they forget.

  1. Automatic flush toilet. Put the sensor in the pubic bathroom.
  2. The code is a conversation between people and computer, but recipe is between people. But they are both processes of giving commands and following the instructions.
  3. It can save a lot of time and trouble, help us with a lot of things. But it also makes us fool and let us depend more on the computers.

Circuit: