Week 10 – Assignment

The project is designed as a competitive game using an Arduino board to determine who can activate their respective LED faster: a player pressing a button or an automated response triggered by a photoresistor detecting darkness. The setup includes two LEDs connected to the Arduino. One LED (connected to pin 10) is controlled by a pushbutton, which, when pressed, signifies the  player’s reaction. The other LED (connected to pin 9) is controlled by a photoresistor, representing an automated “player” that reacts to the absence of light. The game’s objective is to see which mechanism can activate its LED first under the given conditions—either when it becomes dark enough for the photoresistor to react or when the human player presses the button.

This was a lot of fun to make and the concept sort of formed as I put everything together, I mostly focused on using the class notes as a resources however I did use some of the examples on the official Arduino website. 

https://forum.arduino.cc/t/using-an-led-and-a-photoresistor-to-switch-itself-on-and-off/179690

https://projecthub.arduino.cc/agarwalkrishna3009/arduino-diy-led-control-with-ldr-sensor-photoresistor-fa011f

int photoSensorPin = A0;
int buttonPin = 2;
int ledPin1 = 9;
int ledPin2 = 10;

void setup() {
  pinMode(photoSensorPin, INPUT);
  pinMode(buttonPin, INPUT);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
}

void loop() {
  int sensorValue = analogRead(photoSensorPin);
  int buttonState = digitalRead(buttonPin);

  if (buttonState == HIGH) {
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, HIGH);
  } else if (sensorValue < 512) {
    digitalWrite(ledPin1, HIGH);
    digitalWrite(ledPin2, LOW);
  } else {
    digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, LOW);
  }
}

 

 

Beep Beep, Stuck in Traffic!

For this weeks assignment, I chose a very corny heading (sorry for that) but at the same time I combined some of the reading work we have previously done and implemented into the assignment.

My Inspiration came from the car industry, which is something I mentioned in one of my previous reading assignments. Since we are working with lights I thought that it would be a good idea to mimic some of the headlights that I’ve seen on never cars.

The way this lights work are:

  • When the driver turns to the left, the corresponding light turns on
  • When the driver turns to the right, the corresponding light turns on
  • The lights dim (in a way that if the turn is sharper, the light would be brighter)

To mimic this I used a potentiometer as well as two lights(logically :). For a fun element, I also added a buzzer and a button that activates that buzzer like a car horn would.

Here is the code I used:

int potentiometer = A0;
const int led0 = 5;
const int led1 = 6;
const int buttonPin = 7;
int buttonRead = 0;
const int buzzerPin = 10;

void setup() {
  Serial.begin(9600);
  pinMode(led0, OUTPUT);
  pinMode(led1, OUTPUT);
  pinMode(buttonPin, INPUT);
  pinMode(buzzerPin, OUTPUT);
}

void loop() {
  buttonRead = digitalRead(buttonPin);
  Serial.println(buttonRead);
  int potentiometerValue = analogRead(potentiometer);
  int pwmValue1 = map(potentiometerValue, 0, 512, 255, 0); // Map potentiometer value for LED0
  int pwmValue2 = map(potentiometerValue, 513, 1023, 0, 255); // Map potentiometer value for LED1

  // Check if the button is pressed (buttonRead is HIGH)
  if (buttonRead == HIGH) {
    // Turn on the buzzer
    analogWrite(buzzerPin, HIGH);
  } else {
    // Turn off the buzzer
    analogWrite(buzzerPin, LOW);
  }

  if (potentiometerValue >= 0 && potentiometerValue <= 512) {
    analogWrite(led0, pwmValue1); // Dim LED0
    analogWrite(led1, 0); // Turn off LED1
  } else {
    analogWrite(led0, 0); // Turn off LED0
    analogWrite(led1, pwmValue2); // Dim LED1
  } 
}

Basically what the code does is it takes the potentiometer values, and maps them to the lights correspondigly. At the same time, the button turns the buzzer on and off.

Video demonstration:

 

Week 9 Assignment

For my project, I combined a light sensor and a button. The primary concept behind this project was to create an interactive system that responds to both room light levels and user input. The light sensor serves as the eyes of the circuit, detecting changes in the surrounding light environment, while the button enables direct user interaction. One of the main challenges I encountered during the development process was ensuring reliable and accurate responses with the light sensor, especially during the day when everything was lit up. I was thinking about some improvements for this project that could involve adding additional sensors for enhanced functionality, such as temperature or motion sensors, to broaden the range of environmental inputs the circuit can respond to. Overall, this project represents a stepping stone toward creating more sophisticated and responsive sensor-based systems for various applications. I would also work on my creativity in my next project since I was too focused on correcting this part.

Week 10 – Reading Response + Assignment_Shereena AlNuaimi

#1:
In 2008, TIGOE released a blog post titled “Physical Computing’s Greatest Hits (and misses),” which explores the field of physical computing by presenting a range of projects that illustrate the integration of technology with human interaction and creativity. It looks at how these initiatives, which include fun controllers like the “Stranglophone” and instruments resembling Theremins, blur the boundaries between engineering and art while highlighting the value of human interaction in technology.

The initiatives that are showcased strive to capture not only observable inputs but also intangible components of human experience, such emotional connection or inner quiet. They explore personal facets of everyday life, putting out gadgets that may be used in unusual ways, like screaming at people or giving them hugs.

In a sector full with repetitive concepts, the post critically examines what makes a work original and suggests that each creator’s little deviations are what make a work innovative. It supports the notion that, with gadgets acting as portals for inquiry and education, physical computing is about investigating human expression as much as it is about technology.

The post ends by extending an invitation to readers to take part in the development of physical computing and highlighting the necessity of ongoing innovation as well as the acceptance of change and adaptability in this ever-evolving industry. It provides room for development and fresh input, inspiring innovators, thinkers, and doers to push the envelope even farther.

#2:

The post “Making Interactive Art: Set the Stage, Then Shut Up and Listen” by TIGOE suggests changing the way interactive art is made. It promotes artists taking a backseat after establishing the scene so that viewers may participate and analyze the work on their own. Interactive art, in contrast to traditional art forms, starts a conversation that is co-authored by viewers. It is said that an artist should operate like a director would, offering suggestions but never forcing an interpretation on performers. The article emphasizes the artist’s humility in embracing a range of reactions from the audience, including misinterpretations or deceptions. It encourages artists to think of interactive pieces not as finished items but as continuous performances modified by audience involvement. Subsequently this implies that this method encourages participants’ emotional resonance and self-discovery. Ultimately, the post serves as a guide for creators navigating participatory culture, emphasizing the value of interactive art in sparking meaningful experiences.

 

ASSIGNMENT:

Bullseye Game!

Archery has been one of my passions for about 9 years now. I drew inspiration from the archery target by using the LED colors yellow, red and blue. When the button is pressed the yellow LED starts blinking and the blue and red LED turns off as if you hit a bullseye!

Week #10 – Reading Response

Among the first reading’s example, Fields of Grass attracted my curiosity the most. Thinking about it, I feel that the sensors could be organized in various ways so that the output changes dependent on not only the position of the hand, but also to the pressure applied. Designing a virtual world where the terrain alters depending on how firmly you push your hand is pretty cool. Delicate touches could disclose hidden passageways or generate peaceful sounds, while larger pressing might unleash bolder graphics or more dramatic effects. Beyond pressure, the sensor array might be adjusted to respond to additional hand interactions. An teaching tool might be created out of the project at a museum. Using pressure or movement to control elements like water or sunshine, visitors may “grow” a variety of virtual plants by placing their hands in specific locations. Physical therapy might benefit from the apps as well, as the virtual environment could react to particular hand gestures or muscle control, offering a visually appealing means of monitoring improvement.

In addition, I thought the author’s recommendation to “shut up and listen”—that is, to pay great attention to how people engage with and respond to the work—was extremely applicable to interface design in general, not just in artistic contexts. By seeing where our works fall short in the future, we may learn so much. Thus, it’s crucial to remain receptive to such criticism in order to improve the work. I also asked my friends to play games with me and give me constructive critique for my midterm.

 

Reading Reflection – Week 10

Among the various ideas explored in the blogs by Tom Igoe about physical computing, two projects particularly caught my attention: Floor Pads & Scooby-Doo Paintings. Using floor pads seems like a fun & creative way to create interactive experiences that suggest actions without telling users how to feel about those actions; it’s more like a performance, as described in the other reading. I’m curious to learn more about integrating floor pads into future projects, as well as gloves. The second concept, the Scooby-Doo paintings, reminded me of the Mona Lisa’s mysterious gaze, which some claim to be a myth. I wonder how much of a difference it makes to use a camera instead of a distance sensor to detect a face and eyes, and if anyone has attempted to recreate that with a reproduction of the Mona Lisa or another famous ancient painting.

Furthermore, the second essay about “Making Interactive Art” (enjoyed the catchy title) made several solid claims that I completely agree with. What makes art memorable is your experience with it, how it made you feel, which is unique to everyone…I appreciate the author’s emphasis on creating space for users to interpret things freely. Additionally, the idea of actively listening to audience responses & reactions reminded me of “user-testing.” So, I wonder if the author considers this before presenting the artwork and during as well. Is it about always leaving room for improvement and learning through the process? I never considered user-testing at any other stage besides before presenting, but consistently improving seems ideal. Overall, this encouraged me to experiment during the creative process and also while engaging with an audience because that’s when we learn most!

Week 9 – Sara Al Mehairi

CONCEPT

Ghost Detector Real Life Radar - Apps on Google PlayJahyShow 5 LED EMF Meter Magnetic Field Detector Ghost Hunting Paranormal Equipment Tester Counter - Walmart.com

Inspired by the LED EMF Meter Magnetic Field Detector (which helps to measure electromagnetic fields to identify equipment that generates high radiation) used for “ghost hunting,” my goal was to create a device similar to a “ghost detector.” Well, at least that’s the idea! Right now, it’s really good at detecting shadows, brightness, and darkness. Originally, I prototyped it as a device to light up cabinets, drawers, and more. But with some tinkering, it might just find something spooky—spirits! (p.s. this is for last week’s assignment)

OVERVIEW

The prototype is designed to detect changes in light levels using a photoresistor. It consists of a photoresistor connected to analog pin A0 on the Arduino board. The prototype includes four LEDs connected to digital pins 2, 3, 4, and 5, which illuminate in response to different brightness levels read by the photoresistor. Further, based on the brightness level detected, the Arduino activates specific combinations of LEDs to indicate the brightness level or as i would like to say “ghosts”

const int thresholds[] = {600, 500, 400, 300};
  1. If the brightness level exceeds the highest threshold, all four LEDs are illuminated, indicating maximum brightness.
  2. If the brightness level exceeds the second highest threshold, the first three LEDs are illuminated, while the fourth LED remains off.
  3. If the brightness level exceeds the third highest threshold, only the first two LEDs are illuminated, while the remaining LEDs are turned off.
  4. If the brightness level exceeds the lowest threshold, only the first LED is illuminated, while the remaining LEDs are turned off.
  5. If the brightness level falls below all thresholds, all LEDs are turned off.

IMPLEMENTATION

Prototype 1

As explained above, the photoresistor is able to detect the brightness level, to which range it belongs, and then the lights react accordingly. Do ghosts have shadows? Not necessarily… but anything is possible, so “use your imagination”. Perhaps it could even detect people or other moving objects.

Prototype 2

I know. We agreed not to use our hands, but no one mentioned anything about shadows. Here, I’m simply demonstrating the main concept of how it works. You could use your legs, face, or any other object. However, for the sake of a clear demonstration and a decent angle, I chose to use my hand’s shadow…not my hand.

Prototype 3

To further test its practicality, I decided to place it in my drawer. As you can see, it could prove quite useful with improved light adjustments.

CONCLUSION

It was certainly challenging to manage the numerous if-else cases and determine the appropriate ranges for the photoresistor. I invested a considerable amount of time debugging why certain LED lights functioned while others didn’t, only to realize that my else-if statements were not properly ordered, leading to skipped conditions. However, despite the constraint of not using our hands, I discovered a loophole, which allowed me to experiment with several of my ideas. (p.s. this is for last week’s assignment)

Week 10: Analog/Digital – Jihad Jammal

Concept:

For this Arduino class project, I set out to create a straightforward yet multifunctional night light. The design includes an automatic feature where the light adjusts its brightness based on the room’s lighting conditions, ensuring the perfect level of illumination at all times. Additionally, it features a manual override button that allows users to adjust the brightness to their preference through a different LED at any moment.

A highlight of some code that you’re particularly proud of:

const int lightSensorPin = A0; 
const int buttonPin = 2;
const int redLED = 8;         // Red LED on digital pin 8 for on/off control
const int yellowLED = 9;      // Yellow LED on digital pin 9 for analog control
const int lightThreshold = 500;  // Light level threshold for the yellow LED
int lastButtonState = HIGH;
bool redLEDState = LOW;

void setup() {
  pinMode(lightSensorPin, INPUT);
  pinMode(buttonPin, INPUT_PULLUP);
  pinMode(redLED, OUTPUT);
  pinMode(yellowLED, OUTPUT);
}

void loop() {
  int lightLevel = analogRead(lightSensorPin);
  int buttonState = digitalRead(buttonPin);

  // Button controls the red LED
  if (buttonState == LOW && lastButtonState == HIGH) {
    // Toggle the red LED state
    redLEDState = !redLEDState;
    digitalWrite(redLED, redLEDState); // Set the red LED according to the toggled state
    delay(50); // Debounce delay
  }

  // Light sensor controls the yellow LED
  if(lightLevel < lightThreshold) {
    // If it's dark, set the yellow LED to a brightness proportional to the darkness
    int brightness = map(lightLevel, 0, lightThreshold, 255, 0); 
    analogWrite(yellowLED, brightness);
  } else {
    // If it's light, turn off the yellow LED
    analogWrite(yellowLED, 0);
  }

  // Update last button state
  lastButtonState = buttonState;
}

 

Video of Project:

Reflection and ideas for future work or improvements:

Reflecting on this Arduino night light project, I initially hoped to make the visual structure more intriguing and implement the design in a more creative way. However, I’ve come to realize that I’m still in the process of getting comfortable with the actual wiring and coding aspects of the project, which consumed the majority of my time. Despite these challenges, I’m proud of the work I’ve accomplished. If I had more time to devote to this project, I would focus on better integrating the button’s functionality with the light sensor to create a more seamless interaction between user input and the device’s automatic responses. In the future, I aim to explore more sophisticated design and programming techniques that could enhance both the aesthetic and functional elements of projects like this, ensuring they are not only practical but also visually appealing.

Week 10 Light Play – Shaikha Alkaabi

Inspiration:

Fidget Cube Blue-gray/Black

The inspiration for this code setup comes from the interactive and tactile nature of fidget toys, which are designed to engage the senses through hands-on manipulation. Just as fidget toys provide sensory feedback through various textures and movements to captivate attention, this Arduino project uses buttons and variable light settings to create a dynamic interaction. Users can physically alter the brightness of LEDs or toggle them on and off, mirroring the satisfying and immediate response found in fidget toys, making the learning process both fun and engaging.

Video:

Code:

const int led0 = 3; 
const int led1 = 5; 
const int photoResistor = A1; 
const int potentiometer = A0; 
const int buttonPin = 2; 

void setup() {
  Serial.begin(9600);
  pinMode(led0, OUTPUT);
  pinMode(led1, OUTPUT);
  pinMode(buttonPin, INPUT); // sets the button as an input device
}

void loop() {
  int lightValue = analogRead(photoResistor);
  int potValue = analogRead(potentiometer);
  int delayTime = map(potValue, 0, 1023, 50, 1000); 
  int buttonState = digitalRead(buttonPin);

  Serial.print("Light Value: ");
  Serial.println(lightValue);

  // Analog control of red LED using potentiometer
  int brightness = map(potValue, 0, 1023, 0, 255); 
  analogWrite(led0, brightness);

  // Digital control of green LED using a button
  if (buttonState == HIGH) {
    digitalWrite(led1, HIGH);
  } else {
    digitalWrite(led1, LOW);
  }

  // Additional feature using the photoresistor to change the behavior based on light
  if (lightValue < 300) {
    // When light levels are low, flash the green LED rapidly.
    digitalWrite(led1, HIGH);
    delay(100); // Short delay for rapid flash
    digitalWrite(led1, LOW);
    delay(100); // Continue rapid flash
  }
}

The code controls two LEDs based on inputs from a combination of analog and digital sensors, resulting in an interactive and dynamic output that depends on environmental conditions and user interaction.

  1. Red LED (Analog Control): The brightness of the red LED is directly controlled by a potentiometer. As the user adjusts the potentiometer, the red LED’s brightness varies smoothly from completely off to fully bright. This provides a visual representation of the analog input value, allowing users to see a direct correlation between the potentiometer’s position and the LED’s intensity.
  2. Green LED (Digital Control): The state of the green LED is controlled by a photoseisitor. Pressing photoresistor  turns the LED on, and releasing it turns the LED off. This simple binary control mimics typical digital behaviors in electronics, where a switch controls a circuit’s on/off state.
  3. Additional Behavior with Photoresistor: When it gets dark, the green LED automatically starts flashing rapidly to signal a change in light conditions, overriding the button control.

reading response Making Interactive Art/Physical Computing’s

Reading about interactive art in “Physical Computing’s Greatest Hits and Misses” and “Making Interactive Art: Set the Stage, Then Shut Up and Listen” felt like peeking behind the curtain of a magic show. It made me ponder the fascinating dance between the artist, the artwork, and us, the audience, especially when technology joins the party.
One big question that popped into my head was: can an artist ever truly be the puppet master in this interactive playground? I mean, the moment you invite participation, you’re kind of handing over the reins, right? It’s like setting up a stage for improv – you provide the props and the backdrop, but the actors, well, they bring the story to life in their own unique way. And that’s pretty darn exciting, this unpredictability that makes each experience unique.
“Making Interactive Art” really struck a chord with me when it talked about setting the stage and then taking a step back. It’s like the artist is saying, “Here’s the world I’ve built, now come explore and make it your own.” This reminds me of those cool performance art pieces or happenings, where the lines between performer and audience blur, and everyone becomes part of the art. It’s all about embracing the unexpected, the happy accidents that make life (and art) so interesting.
There was this one bit in “Physical Computing’s Greatest Hits and Misses” that made me pause. It talked about how getting lost in fancy technology can actually be a trap. It reminded me that the heart of interactive art isn’t about gadgets and gizmos, it’s about the human connection, the emotions and thoughts it evokes. Like, a cool light show is fun and all, but if it doesn’t make you feel something, think something, then is it really art?
These readings have made me realize that the artist in interactive art is more like a gardener than a dictator. They plant the seeds, nurture the soil, but ultimately, it’s up to us, the audience, to help the garden grow. And that’s the beauty of it, this collaborative spirit that makes interactive art feel so alive, so human.
Now, I’m curious to see how artists can create these interactive worlds without being too controlling. It’s like finding that sweet spot where the artist’s vision meets the audience’s imagination, and together, they create something truly magical.