Week 11 – Reading Reflection

This week’s reading “Design meets Disability” seemed to capture the essence of a good design through the lens of disability. The author begins with the conversation regarding the traditional absence of design or focus on appearance in goods created to aid a disability. With an emphasis on discretion, the object often serves contrary to its purpose by depriving the wearer of a positive image and instead stigmatizing the disability of relevant aid. Through this observation I was reminded of a previous reading that sparked a conversation about form or function in a design. Once again, I believe that an ideal design would be one that is able to strike a balance between the two. In today’s world where people are overly self-conscious of their looks, incorporating design into objects can help boost the self confidence of people.

I also resonated with the argument about a simple vs complex design based on the reading on the importance of user-centric design. It is important to ensure that while trying to accommodate the needs of people, the object does not end up being complex to understand its use.

Final Project Draft 1

Reading through the examples given for the final project, I was inspired to explore the idea of creating an assistive device using the arduino and p5 communication. I believe this theme would allow me to apply the interactivity in coming up with something that is practical and useful. A concept that I found interesting is the creation of a sensory enhancement model for the visually impaired to provide feedback of their surrounding through different arduino sensors. However, I am still exploring existing assistive devices to get a better understanding of the requirements of a model and hope to come up with something unique for the final project.

 

Week 11 – Assignment (Rujul and Mariam Al Khoori)

Exercise 1: ARDUINO TO P5 COMMUNICATION

Using the potentiometer the ellipse is moved across the screen while also changing its opacity.

P5.js Sketch:

// variable to control x-coordinate
let x = 0;
function setup() {
  createCanvas(640, 480);
  textSize(18);
}
function draw() {
  // sets background
  background(255);
  stroke(0);
  // draws ellipse on canvas
  fill(0,255,0,map(x, 0, 1023, 0, 255))
  ellipse(map(x, 0, 1023, 0, width), height / 2, 100, 100);
  
  // checks if serial communication has been established
  fill(0)
  if (!serialActive) {
    text("Press Space Bar to select Serial Port", 20, 30);
  } else {
    text("Connected", 20, 30);
  }
  
}
// sets up serial connection
function keyPressed() {
  if (key == " ") {
    // important to have in order to start the serial connection!!
    setUpSerial();
  }
}
// This function will be called by the web-serial library
// with each new *line* of data. The serial library reads
// the data until the newline and then gives it to us through
// this callback function
function readSerial(data) {
  ////////////////////////////////////
  //READ FROM ARDUINO HERE
  ////////////////////////////////////
  if (data != null) {
    x = int(trim(data));
  }
  
}

Arduino Sketch:

void setup() {
  // Start serial communication so we can send data
  // over the USB connection to our p5js sketch
  Serial.begin(9600);
  // We'll use the builtin LED as a status output..
  pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
  // gets sensor reading
  int sensor = analogRead(A0);
  delay(5);
  // indicates data transfer
  digitalWrite(LED_BUILTIN, HIGH);
  // sends data to p5
  Serial.println(sensor);
  
  // indicates data transfer
  digitalWrite(LED_BUILTIN, LOW);
  
}

VIDEO – Exercise1

 

Assignment 2: P5 TO ARDUINO COMMUNICATION

Brightness of the LED changes when pressing the UP and DOWN keys.

P5.js Sketch:

let brightness=0;

function setup() {
  createCanvas(640, 480);
  textSize(18);
}

function draw() {
  background(255);
  fill(0);

  if (!serialActive) {
    text("Press Space Bar to select Serial Port", 20, 30);
  } else {
    text("Connected", 20, 30);
  }
  fill(255,0,0,brightness)
  square(width/2-150,height/2-30,50)
  fill(0)
  text("Brightness: "+str(brightness),width/2-50,height/2)
  text("Use the UP and DOWN arrow keys to adjust the brightness. ",width/2-220,height/2+50)

  if (keyIsPressed) {
    if (keyCode==UP_ARROW) {
      if (brightness<255){
        brightness+=5;
      }  
    } else if (keyCode==DOWN_ARROW) {
      if (brightness>0){
        brightness-=5;
      }
    }
  } 
}

function keyPressed() {
  if (key == " ") {
    // important to have in order to start the serial connection!!
    setUpSerial();
  }
}

function readSerial(data) {
  if (data != null) {
    writeSerial(brightness+"\n");
  }
}

Arduino Sketch:

int LedPin = 5;

void setup() {
  // Start serial communication so we can send data
  // over the USB connection to our p5js sketch
  Serial.begin(9600);

  // We'll use the builtin LED as a status output..
  pinMode(LED_BUILTIN, OUTPUT);

  // Outputs on this pin
  pinMode(LedPin, OUTPUT);

  // Blink them so we can check the wiring
  digitalWrite(LedPin, HIGH);
  delay(200);
  digitalWrite(LedPin, LOW);

  // start the handshake
  while (Serial.available() <= 0) {
    digitalWrite(LED_BUILTIN, HIGH); // on/blink while waiting for serial data
    Serial.println("0"); // send a starting message
    delay(300);            // wait 1/3 second
    digitalWrite(LED_BUILTIN, LOW);
    delay(50);
  }
}

void loop() {
  // wait for data from p5 before doing something
  while (Serial.available()) {
    Serial.println("0");
    digitalWrite(LED_BUILTIN, HIGH); // led on while receiving data

    int brightness = Serial.parseInt();
    if (Serial.read() == '\n') {
      analogWrite(LedPin, brightness);
    }
  }
  digitalWrite(LED_BUILTIN, LOW);
}

VIDEO – Exercise2

 

 

 

 

 

Assignment 3: BI-DIRECTIONAL COMMUNICATION

The LED glows up when the ball touches the ground. The ultrasonic sensor is used to change the direction of the wind.

P5.js Sketch:

let velocity;
let gravity;
let posit5
let acceleration;
let wind;
let drag = 0.99;
let mass = 50;
let LED=0;
let wind_speed=0;

function setup() {
  createCanvas(640, 360);
  noFill();
  position = createVector(width/2, 0);
  velocity = createVector(0,0);
  acceleration = createVector(0,0);
  gravity = createVector(0, 0.5*mass);
  wind = createVector(0,0);
}

function draw() {
  background(255);
  fill(0)
  if (!serialActive) {
    text("Press RIGHT key to select Serial Port", 20, 30);
  } else {
    text("Connected", 20, 30);
  }
  applyForce(wind);
  applyForce(gravity);
  velocity.add(acceleration);
  velocity.mult(drag);
  position.add(velocity);
  acceleration.mult(0);
  fill(205,104,219); 
  ellipse(position.x,position.y,mass,mass);
  if (position.y > height-mass/2) {
      velocity.y *= -0.9;  // A little dampening when hitting the bottom
      position.y = height-mass/2;
    }
  
  if (position.y==height-mass/2){
    LED=1
  }else{
    LED=0
  }
  
  if (position.x>=width || position.x<=0){
    position.x=width/2
  }   
}

function applyForce(force){
  // Newton's 2nd law: F = M * A
  // or A = F / M
  let f = p5.Vector.div(force, mass);
  acceleration.add(f);
}

function keyPressed(){
  if (key==' '){
    
    mass=random(15,80);
    position.y=-mass;
    velocity.mult(0);
  }
  if (keyCode==RIGHT_ARROW){
    setUpSerial();
  }
}

function readSerial(data) {
  ////////////////////////////////////
  //READ FROM ARDUINO HERE
  ////////////////////////////////////

  if (data != null) {
    let fromArduino = trim(data);
    distance= int(fromArduino);
    if (distance>10){
      wind.x=2
    }
    else{
      wind.x=-2
    }
    
    let sendToArduino = LED+"\n";
    writeSerial(sendToArduino);
  }
}

Arduino Sketch:

int LedPin = 2;
int trigPin = 9;
int echoPin = 10;
long duration;
int distance;

void setup() {
  // Start serial communication so we can send data
  // over the USB connection to our p5js sketch
  pinMode(trigPin, OUTPUT); 
  pinMode(echoPin, INPUT);
  Serial.begin(9600);
  pinMode(LED_BUILTIN, OUTPUT);

  // Outputs on these pins
  pinMode(LedPin, OUTPUT);

  // Blink them so we can check the wiring
  digitalWrite(LedPin, HIGH);
  delay(200);
  digitalWrite(LedPin, LOW);



  // start the handshake
  while (Serial.available() <= 0) {
    digitalWrite(LED_BUILTIN, HIGH); // on/blink while waiting for serial data
    Serial.println("0,0"); // send a starting message
    delay(300);            // wait 1/3 second
    digitalWrite(LED_BUILTIN, LOW);
    delay(50);
  }
}

void loop() {
  // wait for data from p5 before doing something
  while (Serial.available()) {
    digitalWrite(LED_BUILTIN, HIGH); // led on while receiving data

    int LED = Serial.parseInt();
    if (Serial.read() == '\n') {
      digitalWrite(LedPin, LED);
      digitalWrite(trigPin, LOW);
      delayMicroseconds(2); 
      digitalWrite(trigPin, HIGH);
      delayMicroseconds(10);
      digitalWrite(trigPin, LOW);
      // Reads the echoPin, returns the sound wave travel time in microseconds
      duration = pulseIn(echoPin, HIGH);
      // Calculating the distance
      distance = duration * 0.034 / 2;
      Serial.println(distance);
    }
  }
  digitalWrite(LED_BUILTIN, LOW);
}

VIDEO – Exercise3 Wind

VIDEO – Exercise3 LED

Lecture Reflection

Professor Neil’s lecture titled “Alien Intelligence” was a thought-provoking experience. From his beliefs about the terror of AI attributed to the fast-developing nature of technology to his reasoning that behind the success of AI is the triumph of human beings, I found myself engrossed in a period of reflection and understanding of what the future holds. With the debate surrounding AI overtaking humans, I particularly liked Professor’s emphasis on the term “Alien Intelligence” and how human beings may no longer be at the center but their capacity to think remains unmatched. Listening to impact of AI on our lives seems to instill a sense of helplessness and a sincere hope that we are able to grapple with the self-created dangers as AI continues to grow in the hands of human beings.

Week 10 – Reading Reflection

A Brief Rant on the Future of Interaction Design

Bret Victor prompts us to question whether the future of interaction design in the form of screens is visionary. Through his unique take on the topic, with a focus on human capabilities to understand the ideal nature of design, the author emphasizes the need to incorporate the use of hands in design. This would not only lead to a true sense of interaction but also prevent the mighty capabilities of our hands from being reduced to tapping a screen. Throughout the reading, I was able to resonate with the argument as I reflected on my reading experience. While a Kindle does offer a sustainable solution, in my opinion, it can never replace the experience of reading a physical book. When I read a book, I enjoy engaging my sense of touch with the pages. Feeling the thickness of the divided pages between my fingers provides a sense of the passage of time in the reading, along with an anticipation of what lies ahead. All these involuntary thoughts seem to vanish as I slide to turn page after page on a Kindle and find myself distanced from the story.
What I inferred from the reading and the responses to it was that the author does not deny the development of technology in the form of screens for it has certainly simplified our lives. However, he is against the idea of limiting ourselves to this model for future innovations and urges redefining visionary in terms of making the best use of human capabilities in addition to technology.

Week 10 – Assignment – Music Box

For the assignment we were required to use an analog sensor and a digital sensor to create a musical instrument. We came up with the idea of using an ultrasonic sensor as our analog input and also incorporated the servo motor to add a physical dimension to the instrument. The overall concept of our project is inspired from a music box that is wound to play the music.

We created a disc with small stick figures placed around at different distances and attached it to the servo motors. As the servo motor rotates the different positions of the figures serve as an input to the sensor to change the delay between the notes of the tune being played through the piezo speaker. Additionally, we have used a button as the digital sensor to restart the rotation of the disc from its initial position.

 

#include <Servo.h>

#define TRIG_PIN 7
#define ECHO_PIN 6
#define SPEAKER_PIN 8
#define BUTTON_PIN 2 

Servo myservo;
bool soundProduced = false;
int servoSpeed = 3; // Initial servo speed
unsigned long debounceDelay = 50;
unsigned long lastButtonPress = 0;
bool buttonState;
bool lastButtonState = LOW;

void setup() {
  Serial.begin(9600);
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
  pinMode(SPEAKER_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  myservo.attach(9);
}

void loop() {
  // Read the button state
  buttonState = digitalRead(BUTTON_PIN);

  // Check for button press
  if (buttonState == HIGH && lastButtonState == LOW && millis() - lastButtonPress > debounceDelay) {
    // Change servo speed
    servoSpeed += 1; // Increase servo speed by 1 degree
    lastButtonPress = millis();
  }

  lastButtonState = buttonState;

  // Rotate the servo in a carousel motion with adjustable speed
  for (int pos = 0; pos <= 360; pos += servoSpeed) {
    myservo.write(pos % 180); // Limit the position within the 0-180 degrees range
    delay(5);
    checkDistanceAndSound();
  }
}

void checkDistanceAndSound() {
  int duration, distance;

  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  duration = pulseIn(ECHO_PIN, HIGH);
  distance = (duration * 0.0343) / 2;

  // Play different melodies for different distance ranges
  if (distance > 0 && distance <= 5 && !soundProduced) {
    playMelody1();
    soundProduced = true;
    delay(2000); 
  } else if (distance > 5 && distance <= 10 && !soundProduced) {
    playMelody2();
    soundProduced = true;
    delay(2000); 
  } else if (distance > 10 && distance <= 20 && !soundProduced) {
    playMelody3();
    soundProduced = true;
    delay(2000); 
  } else {
    noTone(SPEAKER_PIN);
    soundProduced = false;
  }
}

void playMelody1() {
  int melody[] = {262, 294, 330, 349, 392, 440, 494, 523}; // First melody
  int noteDurations[] = {250, 250, 250, 250, 250, 250, 250, 250};

  for (int i = 0; i < 8; i++) {
    tone(SPEAKER_PIN, melody[i], noteDurations[i]);
    delay(noteDurations[i]);
  }
}

void playMelody2() {
  int melody[] = {392, 440, 494, 523, 587, 659, 698, 784}; // Second melody
  int noteDurations[] = {200, 200, 200, 200, 200, 200, 200, 200};

  for (int i = 0; i < 8; i++) {
    tone(SPEAKER_PIN, melody[i], noteDurations[i]);
    delay(noteDurations[i]);
  }
}

void playMelody3() {
  int melody[] = {330, 330, 392, 392, 440, 440, 330, 330}; // Third melody
  int noteDurations[] = {500, 500, 500, 500, 500, 500, 1000, 500};

  for (int i = 0; i < 8; i++) {
    tone(SPEAKER_PIN, melody[i], noteDurations[i]);
    delay(noteDurations[i]);
  }
}

It was an interesting experience to use the ultrasonic sensor with the speaker and I hope to explore their working in more detail in future projects.

Week 9 – Assignment – Caution Coaster

For this assignment we were required to apply the concepts and components used so far to create a project involving an analog sensor, a digital sensor and two LEDs. I decided to explore the functioning of the TMP36 Temperature sensor and have used it as the analog sensor to develop a simple temperature detection model that may be employed in beverage holders to warn the people of the temperature of the contents of the glass.

Using the RGB LED, I have depicted temperature ranges from hot to cold by changing the colors from red to green to blue. Apart from this I have used a switch along with a yellow LED which may be turned on or off. As the program runs, the corresponding temperature value is printed in the Serial Monitor.

I have demonstrated the working of this circuit using glasses containing water of different temperatures ranging from ice cold to boiling hot and was able to achieve the desired color code.

Assignment Video

I particularly enjoyed figuring out the connections and coding for the temperature sensor through a video and the datasheet provided.

Overall, I believe the assignment helped me delve deeper into creating simple circuits and the commands of Arduino IDE.

int RED=9;
int GREEN=10;
int BLUE=11;
int PIN=A0;
void setup() {
  Serial.begin(9600);
  pinMode(RED,OUTPUT);
  pinMode(BLUE,OUTPUT);
  pinMode(GREEN,OUTPUT);
}

void loop() {
  int sensorValue=analogRead(PIN);
  delay(200); //delays the frequency of temperature readings
  float mv = sensorValue*4.9; //converts the analog input into mV
  float temp = (mv-500)/10; //calculates the final temperature value
  Serial.print("Temperature: ");
  Serial.print((mv-500)/10);
  Serial.print("°C\n");
  if (temp>27){
    digitalWrite(RED,HIGH);
    digitalWrite(GREEN,LOW);
    digitalWrite(BLUE,LOW);
  }
  else if (temp>21){
    digitalWrite(GREEN,HIGH);
    digitalWrite(RED,LOW);
    digitalWrite(BLUE,LOW);
  }
  else if (temp>16){
    digitalWrite(BLUE,HIGH);
    digitalWrite(GREEN,LOW);
    digitalWrite(RED,LOW);
  }
  
}

 

Week 9 – Reading Reflection

In this week’s reading, “Making Interactive Art: Set the Stage, Then Shut Up and Listen” the author set out the fundamental nature of interactive art as free and uncontrolling. He argues that artists should never impose or provide their intentions or interpretation of the artwork to the viewer. This field of art calls for the complex nature of human thought to allow the viewer to explore unique interpretations impacted by personal experiences. I found this idea to be particularly relatable as I often witness people having entirely different viewpoints regarding pieces of art. I also feel that if an artist provides their interpretation or explanation, it limits the viewer from exploring their thoughts as they begin to believe that there is only one right understanding of the art. Providing viewers with the freedom to think brings out their true reaction and adds greater depth to the interactive art. It may also be possible for the artist to discover a new dimension of their own work which they may not have previously considered. Hence, I completely agree with the argument presented by the author and firmly believe that the world of interactive art is all about exploring yourself through the displays.

The second reading, “Physical Computing’s Greatest Hits (and misses)”, felt like an unexplored world of opportunities. I was intrigued to read about the numerous projects created using various aspects of physical computing. It has also provided with an inspiration to think more creatively for future assignments. It was interesting to note that all involved relatively similar components and yet were so diverse in concept and implementation.

Week 8 – Reading Reflection

Emotion & Design: Attractive things work better

The article serves as a response to the feedback of Norman’s previous argument in “The Design of Everyday Things” where he had emphasized on the importance of user centered design. In this paper, Norman clarifies that by usability focused design he did not mean the absence of aesthetics. An ideal design would no doubt be something that combines both pleasure and usability. This aspect reminded of the architecture of the Louvre Museum in Abu Dhabi. I believe the dome of the museum is an example of ideal design. While it rightly captures the essence of Arabic design with the creation of the “rain of light” effect, it also serves a sustainable purpose of reducing the energy consumption inside the buildings by shading it from the intense heat. Such a design is the right balance having practical functionality and being visually appealing. Another idea presented by Norman that I found interesting was the different ways in which a design can be interpreted depending on the situation and context.

Her Code Got Humans on the Moon – And Invented Software Itself

The article recounts the remarkable contributions of Margaret Hamilton in the field of software engineering. Her continuous efforts to strive despite the comments of people around her that tried to pull her back, serve as a source of inspiration to the women who face similar situations in male dominated fields of work. I feel the article also sheds lights on the power of creativity which can unexpectedly lead to great inventions. It is important for us to stay focused on our work with utmost dedication and passion. At the same time, it is necessary to remember that our path may not come without obstacles, like the errors that Hamilton encountered, and hence we must remain adaptable to change gears according to what the situation demands. An attitude that combines creativity as well as presence of mind is crucial to design and computing. What I found most inspiring in the article was Hamilton’s perseverance and her approach to try and provide a prevention for every possible error to make the mission as close as possible to being perfect. I believe such stories ought to be brought to light to create an awareness about the individuals behind ground breaking missions and the struggles they had to deal with.

Week 8 – Assignment – Unusual switch – Sailboat

As we begin exploring physical computing, I find it extremely interesting to create simple circuits in replicating mechanisms. This week’s assignment to create an unusual switch provided me the opportunity to get creative. After a lot of contemplation to come up with an idea, I finally decided to create a boat using origami with a sail that flutters with the wind. The idea is inspired from the scenic view of sailboats along Abu Dhabi Corniche. The working of the project is such that when the sail comes in contact with the pole at the back, the circuit is completed and the LED bulb glows.

 

 

 

 

To implement the simple circuit, I have used a resistor, an LED, a breadboard, the Arduino and connecting jumper wires. The pole and the sail have been covered with Aluminium foil to serve as conductors. The model was tested outdoors, and was observed to successfully work with the wind.

I found this assignment to be particularly interesting, as it involved more ideation than implementation of the concept. I am satisfied with the end result of achieving a switch without the use of hands.