Stressed Out? – Final Project

Link to sketch: https://editor.p5js.org/Hazpaz/full/1zy63dQBC

Concept

The finals week is here and stress is something that comes along with it. To soothe everyone’s nerves, I have come up with this project through which anyone can unleash their stress. Simple yet powerful. Inspired by one of the previous works related to stress done by previous students, I’ve decided to take advantage of the stress and anger of the students to create beautiful patterns. The idea is to use a stress ball to measure stress levels. When you squeeze the ball, it tells you how much stress you’re letting out. The project then shows a spiral pattern in action according to the pressure applied.

Images

User testing Video

How does the implementation work

Materials Used

  1. Arduino Uno
  2. Breadboard
  3. flex sensor
  4. jumper wires
  5. 330 ohms resistors
  6. Cardboards
Description of interaction design

When you squeeze the the stress ball, the spiral pattern in p5 starts animating and when the pressure applied on the stress ball increases, the Arduino reads it using the flex sensor and the speed of the spiral animation increases and the color changes to a dark red from a soft color, thus making it feel intense.

Arduino code
const int flexPin = A0;  // Analog pin for the flex sensor

int flexValue = 0; // Variable to store flex sensor value
int pressure = 0;  // Variable to store pressure level (mapped from flex sensor value)
int pressureMin = 10; // Minimum pressure value
int pressureMax = 1023; // Maximum pressure value

void setup() {
  Serial.begin(9600);
}

void loop() {
  // Read flex sensor value
  flexValue = analogRead(flexPin);
  
  // Map flex sensor value to pressure scale (0-100)
  pressure = map(flexValue, pressureMin, pressureMax, 0, 100);
  
  // Send pressure value to p5.js
  Serial.println(pressure);

  
  delay(100); // Adjust delay as needed
}

The A0 pin is used as the analog pin for the flex sensor.

// Map flex sensor value to pressure scale (0-100) 
pressure = map(flexValue, pressureMin, pressureMax, 0, 100);

This code maps the flex sensor reading to a range between 0-100.

// Send pressure value to p5.js 
Serial.println(pressure);

the above code is the communication from Arduino to p5.

p5.js code
function draw() {
  
  if (!patternsPage) {
    
    // Display starting page
    image(startingPage, 0, 0, windowWidth, windowHeight);
    
  } else {
    
    // Display patterns page
    image(bg, 0, 0, windowWidth, windowHeight); // Background image

    // Update and draw circles
    for (let i = 0; i < cols; i++) {
      
      for (let j = 0; j < rows; j++) {
        
        circles[i][j].display();
        circles[i][j].move(circleSpeed * pressure); // Update speed based on pressure
        
      }
    }

    
    // Draw pressure scales
    pressureMeterLeft.draw(pressure);
    pressureMeterRight.draw(pressure);

    
    // Draw texts
    fill('#704402'); // Set text color
    textAlign(CENTER, CENTER); // Align text to center
    text("Pressure: " + pressure, width / 2, 30); // Display pressure value
    

    // Display connection status
    if (!serialActive) { // If serial connection is not active
      fill('red'); // Set text color to red
      text("Press Space Bar to select Serial Port", windowWidth / 2, windowHeight - 20); // Display message to select serial port
    } 
    else {
      
      // If serial connection is active
      fill(0, 255, 0); // Set text color to green
      text("Connected", windowWidth / 2, windowHeight - 20); // Display connected message
      
    }
  }
}

This function controls the visualization and text elements. If on the starting page, it displays the `startingPage` image, and if on the patterns page, it shows the `bg` image. It updates and draws stress-relief circles, adjusting their movement speed according to the pressure level. Pressure scales are drawn on the left and right sides using `pressureMeterLeft` and `pressureMeterRight`, representing the pressure level visually. The pressure value is displayed at the top center, and a message about the status of the serial port connection is shown at the bottom center. If the serial connection is inactive, it prompts the user to press the space bar to select the serial port; otherwise, it indicates that the connection is established.

// Circle class for moving circles
class Circle {
  
  constructor(cx, cy, angle) {
    
    this.angle = angle;
    this.cx = cx;
    this.cy = cy;
    this.baseColor = color('#F0D6B0'); // Green color for low pressure
    this.highPressureColor = color('rgb(179,1,1)'); // Red color for high pressure/
    
  }

  display() {
    
    push();
    translate(this.cx, this.cy);
    noFill();
    let c = map(abs(this.angle % TWO_PI), 0, TWO_PI, 0, 255);
    c -= map(pressure, 0, maxPressure, 0, 100); // Darken color based on pressure
    c = constrain(c, 0, 255);
    let currentColor = lerpColor(this.baseColor, this.highPressureColor, pressure / maxPressure); // Interpolate between green and red based on pressure
    
    noStroke();
    fill(currentColor);
    let x = r * cos(this.angle);
    let y = r * sin(this.angle);
    arc(x, y, size, size, this.angle, this.angle + PI / 2);
    pop();
    
  }

  move(speed) {
    
    this.angle -= speed;
    
  }
}

The `Circle` class defines the behavior and appearance of the patterns. Each circle is constructed with parameters for its center position (`cx` and `cy`) and its starting angle (`angle`). It has properties for colors representing low and high pressure, where green indicates low pressure and red indicates high pressure. The `display()` method draws the circle, adjusting its color based on the current pressure level. The circle’s position is translated to its center, and its color is determined by interpolating between the base color and high pressure color. The `move()` method updates the angle of the circle, causing it to rotate at a speed determined by the pressure level.

// PressureMeter class for the pressure scale
class PressureMeter {
  
  constructor(x, y, width, height) {
    
    this.x = x; // X position
    this.y = y; // Y position
    this.width = width; // Width
    this.height = height; // Height
    
  }

  draw(pressure) {
    
    // Draw pressure scale box
    noFill();
    stroke(10);
    rect(this.x, this.y, this.width, this.height); // Draw the rectangle outline\
    

    // Fill the pressure scale rectangle based on pressure
    let fillAmount = map(pressure, 0, maxPressure, 0, this.height); // Map pressure to the height of the rectangle
    
    fill('#985B00'); // Set fill color to brown
    noStroke();
    rect(this.x, this.y + this.height - fillAmount, this.width, fillAmount); // Draw the filled rectangle
    
  }
}

The `PressureMeter` class contains the visual representation of the pressure scale. It is initialized with parameters for its position (`x` and `y`), as well as its width and height. The `draw()` method is responsible for rendering the pressure scale on the canvas. It first draws the outline of the pressure scale box using the provided position, width, and height. Then, it calculates the fill amount based on the current pressure level, mapping it to the height of the rectangle. The fill color is set to brown, and a filled rectangle is drawn inside the outline, representing the current pressure level.

Embedded sketch

Description of communication between Arduino and p5.js

A stress ball is connected to a flex sensor, which is connected to A0 pin in Arduino Uno. The Arduino is connected to p5 using serial connection. When the stress ball is squeezed, the Arduino reads it with the help of the flex sensor and then maps the sensor reading between 0-100. The Arduino sends this mapped sensor readings to p5 through serial connection and the p5 uses this sensor readings to adjust the speed and color of the animation of the spiral pattern.

// Send pressure value to p5.js 
Serial.println(pressure);

the above code is the communication from Arduino to p5.

Aspects of the project I’m proud of

I’m especially proud of the pressure meter scale and the responsive pattern animation in the project.

// Initializing the two pressure scales
let scaleRectXLeft = 100; // X position of the pressure scale rectangle for the left side
let scaleRectXRight = windowWidth - 100 - rectWidth; // X position of the pressure scale rectangle for the right side

pressureMeterLeft = new PressureMeter(scaleRectXLeft, scaleRectY, rectWidth, rectHeight);
pressureMeterRight = new PressureMeter(scaleRectXRight, scaleRectY, rectWidth, rectHeight);

This block of code shows the initialization two pressure scales, one for the left side and one for the right side of the canvas. I like this because it allows for a visually balanced presentation of the pressure levels on both sides of the screen, creating a sense of symmetry and organization. By positioning the scales at specific x-coordinates, we ensure they are consistently placed regardless of the canvas size. This contributes to the overall aesthetic appeal and user experience of the project.

// Set initial positions
 scaleRectY = height / 2 - rectHeight / 2; // Y position of the pressure scale rectangle
 cols = floor(width / (size * 1.5)); // Number of columns
 rows = floor(height / (size * 1.5)); // Number of rows

 
 // Initialize circles array
 circles = [];
 
 // Loop for the columns
 for (let i = 0; i < cols; i++) {
   
   // Initialize an array for each column
   circles[i] = [];
   
   // Loop for the rows
   for (let j = 0; j < rows; j++) {
     
     // Calculate the x and y positions for the circle
     let x = size / 2 + i * (size * 1.5);
     let y = size / 2 + j * (size * 1.5);
    
     // calculate the distance from the center of the canvas
     let d = dist(x, y, width / 2, height / 2);
     
     // Calculate the angle based on the distance and constant k
     let angle = d / k;
     
     //storing in the array
     circles[i][j] = new Circle(x, y, angle);

This block of code sets the initial positions for the pressure scale and initializes the circles for the pattern animation. I like it because it ensures that the pattern is evenly distributed across the canvas, regardless of its size. By calculating the number of columns and rows based on the canvas dimensions and the size of the circles, it dynamically adjusts to fit the available space. This allows for a consistent and visually pleasing pattern layout, enhancing the overall aesthetic appeal of the project.

Schematics

resources used

Challenges faced and overcoming them

I’ve faced a number of challenges with this project.

  • Initially, there were challenges with implementing a circle pattern. The code for the circle pattern didn’t function correctly and didn’t respond to the sensor readings as intended.
  • To address this issue, I decided to draw inspiration from a spiral pattern which I found online, which proved to be more responsive to the sensor readings.
  • Another challenge was adding the option for users to choose from a variety of patterns. Despite attempts, I encountered difficulties in running multiple patterns simultaneously.

future improvements

  • Offer a variety of stress-relief patterns for users to choose from, catering to different preferences and moods.
  • Enhance the experience by adding soothing music or relaxing sounds to accompany the patterns. For example, if users select a pattern resembling waves or clouds, they can listen to calming nature sounds that match the theme.

IM show documentation

Final Project Proposal Draft 1

Introduction

For my final project I’ve decided to work on something which is relatable for us all students: Stress.  Drawing inspiration from some previous works, especially the one which used stress levels to create patterns, I’ve come up with a new concept. Given that it’s finals week and students are feeling highly stressed, my project will allow them to use a stress ball to gauge their stress levels, which will be represented by a stress scale in p5.js. If their stress levels reach the maximum, the p5.js sketch will display calming patterns and play soothing music to help the user feel calm.

Concept

The idea is to use a stress ball to measure stress levels. When you squeeze the ball, it tells you how stressed you are. The project then shows your stress level using a stress scale in p5, plays relaxing music and soothing patterns if you’re very stressed.

Components

  • Stress Ball
  • Flex Sensor
  • Arduino Board
  • Breadboard
  • Jumper Wires
  • Resistors
  • Speaker

How it works

  1. Stress Sensing:
    • stress ball with a sensor inside to measure how hard you’re squeezing.
  2. Arduino Interaction:
    • An Arduino board talks to the stress ball sensor.
    • The Arduino reads how hard you’re squeezing and tells the computer.
  3. p5.js Visualization:
    • The computer shows your stress level on a scale.
  4. Interactive Response:
    • If you get really, really stressed, the project shows calming patterns.
  5. Audio Feedback:
    • If you’re super stressed, it plays calming music to help you relax.

 

Week 12 – Serial Communication (Group Assignment)

Team Members: Muhammed Hazza, Yaakulya Sabbani

Exercise 1: ARDUINO TO P5 COMMUNICATION

Something that uses only one sensor on arduino and makes the ellipse in p5 move on the horizontal axis, in the middle of the screen, and nothing on arduino is controlled by p5.

Arduino Code

void setup() {
  Serial.begin(9600);
  //pinMode(LED_BUILTIN, OUTPUT);

//start the handshake
  while (Serial.available() <= 0) {
    //digitalWrite(LED_BUILTIN, HIGH);
    Serial.println("0,0"); // send a starting message
    delay(300);
    //digitalWrite(LED_BUILTIN, LOW);
    delay(50);

  }
}

void loop() {
  // wait for data from p5 before doing something
  while (Serial.available()) {
     //digitalWrite(LED_BUILTIN, HIGH);
    int isMoving = Serial.parseInt();
    if (Serial.read() == '\n') {
      int photoVal = analogRead(A0); 
      delay(5);
      Serial.println(photoVal);
   }
  }
  //digitalWrite(LED_BUILTIN, LOW);
}

P5 code

// Initialize variables to store values from Arduino
let rVal = 0; // Stores the received value from Arduino
let xPos = 0; // Stores the mapped x-position value
let rad = 50; // Radius of the ellipse to be drawn

// Setup function - runs once at the beginning
function setup() {
  // Create a canvas with dimensions 400x400
  createCanvas(400, 400);
  // Set text size to 18 pixels
  textSize(18);
}  

// Draw function - runs continuously
function draw() {
  // Set background color to white
  background(255);

  // Check if serial communication is active
  if (!serialActive) {
    // Display message to prompt user to press Space Bar to select Serial Port
    text("Press Space Bar to select Serial Port", 20, 30);
  } else {
    // If serial communication is active, display "Connected" message
    text("Connected", 20, 30);
    
    // Map the received value (rVal) to the x-position within the canvas
    xPos = map(rVal, 0, 900, 0, 400);
    // Display the current received value (rVal)
    text('rVal = ' + str(rVal), 20, 50);
    // Draw an ellipse at the mapped x-position with fixed y-position (200) and radius (rad)
    ellipse(xPos, 200, rad, rad);
    // Display the mapped x-position (xPos)
    text('xPos = ' + str(xPos), 20, 70);
  }
}

// Function to handle key presses
function keyPressed() {
  // Check if Space Bar is pressed
  if (key == " ") {
    // Call setUpSerial() function to start serial connection
    setUpSerial();
  }
}

// Function to read data from Arduino
function readSerial(data) {
  // Check if data is not null
  if (data != null) {
    // Split the received data into an array using comma as delimiter
    let fromArduino = split(trim(data), ",");
    
    // Check if the array contains only one element
    if (fromArduino.length == 1) {
      // Update rVal with the received value from Arduino
      rVal = fromArduino[0];
    }
    
    // Send a handshake message to Arduino
    let sendToArduino = 1 + "\n";
    writeSerial(sendToArduino);
  }
}

Schematic

Video Demonstation

Exercise 2: P5 TO ARDUINO COMMUNICATION

Something that controls the LED brightness from p5.

Arduino Code

//Exercise 2 Arduino Code

const int ledPin =9;
int brightness = 0;
void setup() {
  Serial.begin(9600); // This will start serial communication at 9600 bps

  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(ledPin, OUTPUT);
// start the handshake
  while (Serial.available() <= 0) {
    digitalWrite(LED_BUILTIN, HIGH); // on blink when waiting for serial data
    Serial.println("0,0"); // sending a starting message 
    delay(300);            // waiting for the delar
  }
}
void loop() 
{
  // wait for data from p5 before doing something
    while (Serial.available()) 
    {
    digitalWrite(LED_BUILTIN, HIGH); // led on while receiving data
    int brightness = Serial.parseInt(); //get slider value from p5
    Serial.println(brightness); //just to view the value
    
     if (Serial.read() == '\n') {
       analogWrite(ledPin, brightness); // will set brightness of LED
     
      }else
      {
        digitalWrite(LED_BUILTIN, HIGH);
      }
    }
}

P5 Code

//Exercise 2 - P5js Code
let slider;
function setup() {
   createCanvas(400, 400); // Creating canvas of 400x400 pixels
  slider = createSlider("0, 255, 0");
  slider.position(100, height/2); // Set the position of the slider
  slider.style('width', '80px'); // Set the width of the slider 
 
  
  noStroke(); // No stroke for the ellipse initially
}
function draw() {
  
  background(255); // Refresh background on each frame
  
  if (!serialActive) {
    text("Press Space Bar to select Serial Port", 20, 30);
  } else {
    text("Connected", 20, 30);}
}
function keyPressed() {
  if (key == " ") {
    // setting the serial connection!!
    setUpSerial();
  }   
}
// this callback function
function readSerial(data) {
    ////////////////////////////////////
    //READ FROM ARDUINO HERE
    ////////////////////////////////////
    //////////////////////////////////
    //SEND TO ARDUINO HERE (handshake)
    //////////////////////////////////
    console.log(slider.value());
    let sendToArduino = slider.value() + "\n";
    writeSerial(sendToArduino);
  
}

Video Demonstration

 

Schematic

Exercise 3: BI-DIRECTIONAL COMMUNICATION

Every time the ball bounces one led lights up and then turns off, potentiometer is used as the analog sensor to control the wind.

Arduino Code

//Exercise 3 Arduino Code

const int poten_pin = A0;
const int ledPin = 2;
void setup() {
 Serial.begin(9600); // Start serial communication at 9600 bps
 pinMode(LED_BUILTIN, OUTPUT);
 pinMode(ledPin, OUTPUT);
 pinMode(poten_pin, INPUT);
 // 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);
     digitalWrite(ledPin, LOW);
//read the position of ball from p5
     int position = Serial.parseInt();
  
     if (Serial.read() == '\n') {
       // Read potentiometer value
     int sensorValue = analogRead(poten_pin);
     //send value to p5
     Serial.println(sensorValue);
     }
//if ball is touching the ground i.e. height is zero, turn LED on
     if (position == 0)
     {
       digitalWrite(ledPin, HIGH);
     }
     else{
       digitalWrite(ledPin, LOW);
     }
   }
     digitalWrite(LED_BUILTIN, LOW);
   }

p5 Code

//Exercise 3 - P5js Code

let velocity;
let gravity;
let position;
let acceleration;
let breeze;
let drag = 0.99;
let mass = 50;
let heightOfBall = 0;
function setup() {
  createCanvas(640, 360); // Create a canvas of 800x400 pixels
 
  noFill();
  position = createVector(width/2, 0);
  velocity = createVector(0,0);
  acceleration = createVector(0,0);
  gravity = createVector(0, 0.5*mass);
  breeze = createVector(0,0); 
}
function draw() {
  background(215);
  fill(0);
  
  if (!serialActive) {
    text("Press the space bar to select the serial Port", 20, 30);
  }
  else 
  {
    text("Arduino is connected! Press b to jump.", 20, 30);
  
  applyForce(breeze);
  applyForce(gravity);
  velocity.add(acceleration);
  velocity.mult(drag);
  position.add(velocity);
  acceleration.mult(0);
  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;
    
    heightOfBall = 0;
    
    } 
    else {
      heightOfBall = 1;
    }
  }
}
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 == " ") {
    // important to have in order to start the serial connection!!
    setUpSerial();
  }   
  else if (key=='b'){
    mass=random(15,80);
    position.y=-mass;
    velocity.mult(0);
  }
}
// this callback function
function readSerial(data) {
    ////////////////////////////////////
    //READ FROM ARDUINO HERE
    ////////////////////////////////////
  
     if (data != null) {
    // make sure there is actually a message
    
    let fromArduino = split(trim(data), ",");
    
       // if the right length, then proceed
    if (fromArduino.length == 1) {
//sensor value is the input from potentiometer
      let sensorVal = int(fromArduino[0]);
      
//potentiometer value ranges from 0 - 1023
//for values less than 400,wind blows to right
      if (sensorVal < 400){
        breeze.x=1
      }
//if value between 400 and 500, wind stops so ball stops
      else if(sensorVal >= 400 && sensorVal < 500){
        breeze.x = 0
      }
//if value greater than 500, wind blows to left
      else {
        breeze.x = -1
      }
          //////////////////////////////////
          //SEND TO ARDUINO HERE (handshake)
          //////////////////////////////////
    }
//height of ball sent to arduino to check if ball on floor or not
    let sendToArduino = heightOfBall  + "\n";
    writeSerial(sendToArduino);
  }
}

Schematic

Video Demonstration

 

 

Reading Reflections – Week 12

Design Meets Disability

Reading this text about design meets disability has been eye-opening for me as a designer. It reminds me of the struggle to find the right balance between making products functional, looking good, and fitting in socially.

One thing that stood out to me was the idea of the “flying submarine,” which means adding too many features to a product. I’ve faced this problem before, where trying to include everything makes designs too complicated and less effective. It’s interesting to see how James Leckey’s approach of focusing on specific designs instead of trying to please everyone addresses this problem. I wonder how this idea could apply to other kinds of designs, not just those for disabilities.

I also found the examples of the iPod shuffle and the wall-mounted CD player interesting. They show how simplicity can make products easier to use, even if it means losing some features. I’ve struggled with this balance in my own work—how do we decide which features are really necessary and which ones we can leave out?

As a designer, this text reminds me to think more about how my designs can meet everyone’s needs while still being creative. How do we make sure our designs work for everyone? It’s a challenge I’m excited to take on, and I look forward to learning more about inclusive design.

Musical Instrument – Week 11 Assignment

Group members: Muhammed Hazza, Iqra Bano

Concept

For our assignment, we’ve decided to create a musical instrument, and we settled on making a piano with four keys. Each key, when pressed, will produce a different tone. Our circuit is straightforward, utilizing four push buttons and a buzzer. However, we’ve added an extra component: a potentiometer. This potentiometer allows us to change the frequency of the tones produced by the buzzer. By turning the potentiometer, we can adjust the pitch of the notes, adding more flexibility and range to our piano.

Video Demonstration

Materials we used

  1. Arduino Uno board
  2. Breadboard
  3. 330-ohm resistor
  4.  4x Tactile push-button switch
  5. Potentiometer
  6. Jumper wires
  7. Piezo buzzer

TinkerCad Diagram

Code

#include <Tone.h>

// Define the notes with more distinguishable frequencies.
#define NOTE_C 262 // Middle C (C4)
#define NOTE_G 392 // G above Middle C (G4)
#define NOTE_C_HIGH 523 // One octave above Middle C (C5)
#define NOTE_G_HIGH 784 // G above C5 (G5)

#define ACTIVATED LOW

const int PIEZO = 11;
const int LED = 13;

const int BUTTON_C = 10;  // Will play Middle C
const int BUTTON_D = 9;   // Will play G (above Middle C)
const int BUTTON_E = 8;   // Will play High C
const int BUTTON_F = 7;   // Will play High G

const int POTENTIOMETER = A0; // Analog input pin connected to the potentiometer

Tone toneGenerator;

void setup() {
  pinMode(LED, OUTPUT);
  
  pinMode(BUTTON_C, INPUT_PULLUP);
  pinMode(BUTTON_D, INPUT_PULLUP);
  pinMode(BUTTON_E, INPUT_PULLUP);
  pinMode(BUTTON_F, INPUT_PULLUP);

  toneGenerator.begin(PIEZO);
  digitalWrite(LED, LOW);
}

void loop() {
  int potValue = analogRead(POTENTIOMETER); // Read the potentiometer value
  int frequencyAdjustment = map(potValue, 0, 1023, 0, 255); // Map to a quarter of the full range for adjustment
  
  if (digitalRead(BUTTON_C) == ACTIVATED) {
    toneGenerator.play(NOTE_C + frequencyAdjustment); // Adjust Middle C frequency
    digitalWrite(LED, HIGH);
  } else if (digitalRead(BUTTON_D) == ACTIVATED) {
    toneGenerator.play(NOTE_G + frequencyAdjustment); // Adjust G frequency
    digitalWrite(LED, HIGH);
  } else if (digitalRead(BUTTON_E) == ACTIVATED) {
    toneGenerator.play(NOTE_C_HIGH + frequencyAdjustment); // Adjust High C frequency
    digitalWrite(LED, HIGH);
  } else if (digitalRead(BUTTON_F) == ACTIVATED) {
    toneGenerator.play(NOTE_G_HIGH + frequencyAdjustment); // Adjust High G frequency
    digitalWrite(LED, HIGH);
  } else {
    toneGenerator.stop();
    digitalWrite(LED, LOW);
  }
}

Functionality

  • Upon pressing a button, the Arduino reads which button is pressed and plays a specific tone. The potentiometer’s position adjusts the base frequency of this tone, making the sound higher or lower based on its rotation.
  • The piano uses the Arduino’s built-in “tone” library to handle tone generation, which simplifies the creation of audible frequencies through digital pins.

Future Improvements

For future improvements we would like to:

  • Enhance the clarity and volume of the piano’s notes.
  • Add more keys and different types of tones to the piano.
  • Integrate LEDs to make it look more attractive and visually appealing.

Reading Reflections- Week 11

A Brief Rant on the Future of Interaction Design

In this reading, the author criticizes current ways we interact with technology, saying they’re not very imaginative and don’t use our skills well. He argues that technology should help us do things better by using our hands and bodies. For example, he talks about the importance of our hands by pointing out that current touchscreens don’t let us feel things, which is important for doing our day to day activities like cleaning, cooking, playing video games etc. The author wants us to think bigger and create technology that works more like our hands and bodies do, giving us more natural and useful ways to interact with it.

Reading this made me think about times when I’ve been frustrated with technology that doesn’t feel intuitive. I remembered struggling with a graphic design program that felt disconnected from how I usually use my hands. It’s interesting to think about how much we rely on our sense of touch in everyday tasks. The author’s idea of creating technology that feels more natural and responsive is something I want to learn more about.

I’m curious about how we can make technology feel more like using our hands. It makes sense that if technology felt more like real life, it would be much easier to use. I wonder what kinds of new inventions might come out of thinking this way, and how they could change the way we do things every day.

A follow-up article

The author’s first article made me think about how I get frustrated with technology that doesn’t feel like how I do things in real life. He said that technology should help us use our hands and bodies better, which I totally agree with. Now, reading the follow up article, I like their ideas even more.

In this follow-up article, he talks more about how technology should work with our natural abilities. He gave examples of how our hands and fingers do things easily, like opening a jar. It made me think about how technology could be more like that. I’m excited about the idea of technology feeling more like real life. But I also wonder how we can make it happen. How can we make technology that really helps us do things better? And how might these advancements impact not just our daily tasks, but also our creativity and well-being?

Week 10 – EID Decoration

Concept

For this assignment, the task is to get information from at least one analog sensor and at least one digital sensor (switch), and use this information to control at least two LEDs, in both digital and analog way. Since its EID and after drawing some inspirations from previous works done by a student, I’ve decided to make an EID decoration using the LED lights.

Materials I used

  1. Arduino Uno board
  2. 2 LEDs (RED)
  3. 2 x 220-ohm resistors
  4. 10k-ohm resistor
  5. Tactile push-button switch
  6. Photocell
  7. Breadboard
  8. jumper wires
  9. A piece of cardboard

How it works

The goal is to turn on both LEDs to light up the Eid decoration. To do this, you press one button to light up one LED. Then, to turn on the other LED, you block the photocell’s light by placing your finger over it. When you do both actions together (pressing the button and blocking the photocell), both LEDs will light up at the same time.

Code

int led = 11;
int brightness = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(led, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:

  int sensorValue = analogRead(A2);
  Serial.println(sensorValue); //prints the sensorValues

  sensorValue = constrain(sensorValue, 410, 450);
  brightness = map(sensorValue, 410, 450, 255, 0); //mapping the sensorValues

  analogWrite( led, brightness);

  delay(30);

}

Video Demonstration

Future Improvements

In future updates, I want to include a condition where simply activating the button or just the photocell won’t turn on the LEDs. Instead, both the button and photocell need to be activated simultaneously to light up the LEDs.

Reading Reflections- Week 10 (2 Readings)

Physical Computing’s Greatest Hits (and misses)

As I read about the common themes in physical computing, I was amazed by the variety of projects possible in this field. Each idea seemed to offer its own unique possibilities for creativity and learning.

One theme that particularly caught my attention was the concept of theremin-like instruments. As a musician myself, the idea of creating music through physical gestures rather than traditional methods intrigued me, especially considering the simplicity of the setup. However, I couldn’t help but wonder about the potential for incorporating more complex gestures or interactions to enhance the musical experience further. Another interesting theme was using video mirrors to reflect movements. While this sounded cool, I wondered if there were ways to make these projects more engaging beyond just reflecting movements. I was also intrigued by the idea of mechanical pixels, where small parts move to create artwork. It sounded challenging but exciting. I wondered how artists could use this technique to tell stories or convey emotions.

Overall, I was struck by the balance between simple and complex projects in physical computing. Some ideas were easy to understand, while others seemed more intricate. I’m excited to explore these concepts further and see what new ideas I can come up with!

Making Interactive Art: Set the Stage, Then Shut Up and Listen

Reading this article about making interactive art really changed how I see my role as an artist. Instead of just expressing myself, I now understand that my art can be a conversation with the people who experience it. I learned that I should set the stage for interaction without telling people what to think or do. It’s like creating a performance where the audience completes the work through their actions.

I realized that I tend to explain my art too much, which can limit how people engage with it. Now, I want to give the audience space to form their own interpretations. I’m curious about how I can use performance and interactivity to make my art more engaging. I think it’s important to listen to the audience’s reactions and learn from them to improve my future projects.

This article inspired me to take a more collaborative approach to my art. I want to create pieces that encourage people to participate and explore, while still conveying my message. I’m excited to experiment with new ideas and see how they resonate with viewers.

Week 9 – Unusual Switch

Concept

For this assignment, the task is to create an creative switch that doesn’t require manual activation or coding. Drawing from a personal challenge of frequently and leaving the essential cards like the room and NYUAD access cards in my dorm room, the aim is to design a solution that addresses this issue. The proposed idea is to create a switch that lights up when the wallet is kept in the room and dims when it’s taken out.

Process

So for this project the materials and components used were red LED light, 330 ohm Resistor, 4 Wires, Aluminum foil, tape, Breadboard, and Arduino board. The breadboard circuit connection is shown below:

Video Demonstration

Future Improvements

Sound Effects: I would like to add music or sound effects for a more engaging experience. For example, a pleasant tune could play when the wallet is detected, enhancing user interaction.

Aesthetic Enhancements: I would like to add visual appeal with colorful LEDs or creative casing designs. This will make the device more attractive and blend better with the room decor.

Blinking Lights: I would also like to modify the lights to blink continuously instead of remaining constantly on, which would need some coding integrations.

 

Reading Reflections- Week 8a (2 Readings)

Emotions & Attractive by Donald A.Norman

Reading about the author’s teapot collection and the talk about design was really thought provoking. I never realized how much design can affect how we feel about things. For example, the different teapots the author has are all for different reasons – some are pretty, some are just practical. It made me think about the things I have in my home. Do I choose the things because they look nice, or because they work well?

The part about how color screens were introduced in computers got me thinking about the things that I have with me. Do I like them more because they look cool, even if they don’t work perfectly? And then, there’s the talk about emotions and how they affect our choices. It made me think about the times when I bought something just because it made me happy and gave satisfaction, even if it wasn’t really practical.

Overall, this text made me realize that design is more than just how something looks. It’s about how it makes us feel and how well it works. It made me want to pay more attention to the things I buy and think about why I choose them.

Her Code Got Humans on the Moon

Learning about Margaret Hamilton’s role in the Apollo space program was really inspiring. It’s amazing how she broke stereotypes by being a working mom in a field dominated by men. Seeing how Hamilton faced various challenges and still made groundbreaking contributions to software engineering makes me think about the countless times that I doubted myself when faced with obstacles. She reminds me that determination and hard work can lead to amazing achievements, even in the face of difficulty.

Moreover, Hamilton’s leadership and problem-solving skills during critical moments, like the Apollo 8 mission, inspire me to be a better leader in my own life and encourages me to challenge myself, believe in my abilities, and strive for excellence in everything I do.