Week 8 – Unusual Switch

Concept:

For this week’s assignment, I made a foot-activated switch that turns on an LED when you step on it. It uses two pieces of aluminum foil that touch when pressed together, completing the circuit and lighting the LED.

The idea was to make a basic, hands-free switch that works using pressure from your foot.

Video demonstration:

https://drive.google.com/file/d/1tqjnfQByBRSJJjC8D7xZhDbTFqgD4DTf/view?usp=drive_link

Code Highlight:

const int ledPin = 13;     // LED pin
const int switchPin = A2;  // Foil switch pin

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(switchPin, INPUT);
}

void loop() {
  int switchState = digitalRead(switchPin);

  if (switchState == HIGH) {
    digitalWrite(ledPin, HIGH);   // Turn LED on
  } else {
    digitalWrite(ledPin, LOW);    // Turn LED off
  }
}

Reflections & Future Improvements:

Building the foot-activated switch helped me understand how a basic circuit can turn a simple physical action into an electronic signal. I learned how to use digital inputs on the Arduino and how completing a circuit with something as basic as foil can act as a switch.

If I were to improve it, I’d try to make the foil connection stronger and more reliable, since it doesn’t always press evenly. I’d also like to make the setup look cleaner and maybe add another component, like a buzzer or a second LED, to make it more interactive.

Week 8: Unusual Switch

Concept

The creation of an unusual switch was an interesting task, considering I have created simple LED circuits before, though never with anything beyond what is given in our kit. I decided to use a piano key as a switch to create an interesting switch to add an element of sound that adds dimension to the switch and work. Through this I wanted to create an engaging yet simple work that helps me ground my understanding. To add another layer I wrote code for the light to blink when the key is pressed, which adds a visual to the current auditory element.

Video Demonstration

IMG_7568

Code Snippet

void loop() {
  //Read the state of the switch
  int switchState = digitalRead(A2);

  //Loop to blink if switch is ON
  if (switchState == HIGH) { 
    digitalWrite(13, HIGH); //Turn the LED ON
    delay(250);  // Wait 250 ms
    digitalWrite(13, LOW);   //Turn the LED OFF
    delay(250);  // Wait 250 ms         
  } else {
    digitalWrite(13, LOW); //Keep the LED OFF
  }

}

During this assignment I wanted to integrate two different things we learnt in class to add a little more interactivity to the switch so I decided to use the blinking mechanism during the time where the switch is connected. After prototyping with the regular switch, I added the part of the code where the blinking is handled and noticed a difference on how engaging the switch became which could be useful in creating game interactions or bringing a viewer’s attention to a specific part of a work of interactive art.

Complete Code

Github link

Reflection

This assignment was a great starting point for learning arduino, though a simple task, it helped me make sure that I am well acquainted with the basics of it and I am now excited to learn more. I’d say there is a lot that could be done to improve and develop this work, including adding more LEDs, switches or even more complex visual display when the switch is turned on through a more complex use of digitalRead. Further, this taught me the potential of both hardware and software interacting and what type of work could come out of using such tools together, which inspired me and got me thinking about future projects and how I could make use of this dynamic or how I could have used it in my previous projects.

Reading Response

Attractive Things Work Better

It was really interesting for me to learn how human cognition and emotion are intertwined and how that relationship can determine which design is the best. I personally agree with the author’s idea that more aesthetic and pleasing designs can enhance people’s creativity and allow them to accept even small mistakes or glitches. However, I think that even if a design is aesthetic, if it is too complicated and difficult to use, it will still make me feel frustrated. 

Thus, I believe it’s all about finding the perfect balance between usability, aesthetics, and the emotional impact we gain from the design. In terms of the emotional impact, it is very hard to determine which design works best for people in both pleasant and stressful situations. However, I think it’s always important to make designs both aesthetic and simple at the same time. For instance, Notion is a very simple yet visually pleasing website, and I think that was the key to its success. I know where the templates are, so I can easily choose which template I want to use for my daily diaries and so on. As a software engineer, it is always hard for me to find the right balance between simplicity and aesthetics. However, getting as much user feedback as possible makes it easier for me to find any improvements and add features that make people’s lives easier.

 

Her Code Got Humans On The Moon

As someone who wants to become a software engineer after graduation, I totally agree that the way Hamilton approached designing software that handles crucial tasks and resolves real-time errors is very important, especially in today’s society. Nowadays, anyone can build almost anything from scratch due to technological advancements without actually knowing how to code at all. However, the real challenge that we, as software engineers, need to tackle is handling critical errors when something goes wrong. If we do not understand the fundamental principles of how software interacts with other components, such as databases, everything in this world will start to malfunction. 

After reading this article, I realized that I want to become a software engineer like Hamilton who can prioritize customers’ needs in  the first place and handle errors in real time. I believe these two skills are fundamental parts of a software engineer’s job in today’s world.

Week 8 – Unusual Switch

Concept

I’ve been thinking a lot about how we usually interact with electronics. It’s almost always with our hands; pressing buttons, turning knobs, typing. So I’m glad we got to try something different. My idea for this project is to have a foot-activated Arduino switch made with nothing more than aluminum foil, tape, socks, and (curiosity).

The idea is simple. When your feet touch, they complete a circuit, and when they move apart, the circuit opens again. Your body becomes the bridge that carries a tiny signal. I wrapped strips of foil around my feet (over socks), taped them so they wouldn’t slip, and connected one to pin 2 on the Arduino and the other to ground. When the two foils touch, the Arduino reads a HIGH signal, meaning the circuit is complete.

Demonstration

IMG_5452

Code

int footSwitchPin = 2;   
int ledPin = 13;         

void setup() {
  pinMode(footSwitchPin, INPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  int footState = digitalRead(footSwitchPin);  //check if feet are touching

  if (footState == HIGH) {
    digitalWrite(ledPin, HIGH);   //feet together = LED ON
  } else {
    digitalWrite(ledPin, LOW);    //feet apart = LED OFF
  }
}

Challenges and Improvements 

The biggest challenge was stability. The foil sometimes slipped or wrinkled, breaking contact even when my feet were touching. The tape would loosen after a few tries, so I had to adjust it constantly.  On the creative side, it would be fun to connect it to a sound or visual program on a computer. For example, every time your feet meet, a sound plays or a color changes on screen. That could turn this tiny experiment into a music or art performance piece.

Week 8 Reading Reflection – Attractive Things Work Better

I didn’t expect to agree so much with Don Norman when I first read Attractive Things Work Better. The title itself almost sounds like clickbait; it feels like he’s just saying “make things pretty.” But as I went through the reading, I realized he wasn’t talking about surface-level beauty at all. He was talking about how our emotions actually change the way we think and interact with design. One thing that really stuck with me was his story about the three teapots. He describes one that’s intentionally unusable (the “coffeepot for masochists”), another that’s kind of ugly but works well, and a third that’s beautifully designed and practical at the same time. It sounds funny at first, but it captures something real about how we connect with the things we use.

Norman also connects emotion and cognition in a way that made a lot of sense. He explains how positive affect (basically being in a good mood) helps people think more creatively and handle problems better, while negative affect makes us focus and think more carefully but also more rigidly. I liked his point that when people are relaxed or happy, they become more flexible, patient, and open-minded; they’re even more forgiving of little design flaws. That feels true in life too. When I’m in a good mood, I don’t mind if my phone glitches or my m1 macbook gets loud; but, as you can imagine, when I’m stressed, every small thing feels like a disaster. When something looks and feels good to use, it changes our attitude toward it; we engage more willingly and think more clearly. I liked how Norman ended by saying that good design balances beauty and usability. A product shouldn’t be just functional or just nice to look at; it should feel right to use.

Week 8 Reading Reflection – Her Code Got Humans on the Moon

Well, that photo of Margaret Hamilton standing next to a pile of papers taller than she is has always amazed me as a kid. I remember seeing it everywhere online when I was younger; it circulated a lot in the Arab world, on Facebook and Tumblr especially. People shared it with captions about how her code took humans to the moon. Even before I knew who she was, I could feel that the image meant something special–this one person beside a literal mountain of her own work.

After reading Her Code Got Humans on the Moon, I finally understood why that picture had such an impact. Hamilton wasn’t just part of the Apollo program; she helped define what software engineering even was. Back in the 1960s, people didn’t really think of “software” as an important part of space missions; it wasn’t even included in NASA’s original budgets. But Hamilton and her team at MIT’s Instrumentation Lab changed that. They wrote the code that ran on the Apollo spacecraft, and their work made it possible for Neil Armstrong and Buzz Aldrin to land safely on the moon. What struck me most in the reading was how she handled the pressure. There’s a part where she talks about staying up late to fix a single line of code because she was afraid it could cause an error during a mission. And later, that actually happened—an error almost caused chaos during Apollo 11, but because of how Hamilton had designed the software to prioritize important tasks, the system recovered and saved the mission. That’s insane to think about; one person’s attention to detail made the difference between failure and success.

I also liked how the reading mentioned her bringing her daughter, Lauren, to the lab on weekends. It was such a human detail—this image of a mother working on code that would go to space while her kid slept next to her. People back then questioned her for it, asking how she could leave her daughter to work, but she just did what she believed in. That kind of dedication hit me.

Week 8- Unusual Switches + Reading Reflection

Concept:

For this week’s assignment to create an unusual switch, I built a jaw-activated LED circuit that lights up a red LED when the user opens or closes their mouth. The switch consists of two contact plates that complete the circuit when pressed together.

To construct this, I repurposed old highlighter tubes and wood pieces to create a frame that holds the contact plates. I attached this frame to a headband, which positions the mechanism alongside the user’s jaw when worn. When the headband is in place and the wearer moves their jaw (opening or closing their mouth), the jaw movement pushes the contact plates together. This completes the circuit and activates the red LED.

The design essentially turns jaw movement into a hands-free switch – the mechanical motion of opening and closing your mouth becomes the trigger for the electronic circuit. The highlighter tubes and wood pieces work as the structural components that translate the jaw’s movement into the pressing motion needed to activate the switch.

Implementation:

My Arduino circuit uses two pushbuttons to control an LED. Each button is connected to digital pins 2 and 3 on the Arduino, with 10 kΩ pull-down resistors ensuring the inputs stay LOW when not pressed. When a button is pressed, it sends a HIGH signal to the Arduino, which then turns the LED connected to pin 13 ON through a 330 Ω resistor that limits current. The LED’s short leg is connected to ground, and the red and blue rails on the breadboard distribute 5 V and GND from the Arduino. The setup allows the LED to light up when either button is pressed, demonstrating how digital inputs and outputs can be used together to build simple interactive circuits.

Code:

const int button1Pin = 2;
const int button2Pin = 3;
const int ledPin = 13;

void setup() {
  pinMode(button1Pin, INPUT);
  pinMode(button2Pin, INPUT);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  int button1State = digitalRead(button1Pin);
  int button2State = digitalRead(button2Pin);

  if (button1State == LOW || button2State == LOW) {
    digitalWrite(ledPin, HIGH);
  } else {
    digitalWrite(ledPin, LOW);
  }
}

This Arduino code controls an LED using two pushbuttons. It first defines constants for each pin: button 1 on pin 2, button 2 on pin 3, and the LED on pin 13. In the setup() function, pinMode() sets the two button pins as inputs so they can read signals, and the LED pin as an output so it can turn ON or OFF. In the loop(), the program continuously reads each button’s state using digitalRead(), storing the result in button1State and button2State. The if statement checks if either button is pressed (returns LOW because the circuit uses pull-down or pull-up logic depending on wiring). If one or both buttons are pressed, the LED turns ON with digitalWrite(ledPin, HIGH); if neither is pressed, it turns OFF with digitalWrite(ledPin, LOW). This creates a simple interactive system where pressing any button lights the LED.

Reading Reflection:

Both readings tell a story about why good design literally saves lives. Margaret Hamilton was programming the Apollo missions in the 1960s, juggling motherhood with rocket science – bringing her 4-year-old daughter Lauren to MIT on weekends while she coded. One day, Lauren was playing with the simulator and accidentally crashed it by hitting P01, a program that wasn’t supposed to run during flight. Hamilton immediately thought “we need to protect against this,” but NASA shut her down: “We had been told many times that astronauts would not make any mistakes… They were trained to be perfect”. Because stressed-out humans hurtling through space in a tin can are definitely going to be perfect. Sure enough, during Apollo 8, astronaut Jim Lovell accidentally selected P01 and wiped out all their navigation data. Hamilton’s backup procedures saved the day, but the whole mess could’ve been avoided if NASA had listened to her in the first place about building in safeguards.

This is exactly what Don Norman talks about in his design article – you can’t just assume people won’t make mistakes, especially under pressure. He points out that “products designed for use under stress follow good human-centered design, for stress makes people less able to cope with difficulties and less flexible in their approach to problem solving.” Hamilton understood this intuitively. She knew that even brilliant, highly trained astronauts are still human. Norman also argues that “attractive things work better” because when we’re in a good mental state, we’re actually better at problem-solving – “positive affect makes people more tolerant of minor difficulties and more flexible and creative in finding solutions.” The flip side is that badly designed systems become even worse under stress. The Apollo story shows how one woman’s insistence on human-centered design – despite everyone telling her the users would be “perfect” – literally got humans to the moon and back safely.

 

Week 8 Reading Reflection – Her Code Got Humans on the Moon

After reading “Her Code Got Humans on the Moon—And Invented Software Itself” by Robert McMillan, what made the biggest impression on me was how much Margaret Hamilton thought about human error. I couldn’t get over how NASA brushed off her warning that an astronaut might make a simple mistake and run the wrong program. As humans, we’re bound to make mistakes, especially under pressure, and it’s always better to be safe than sorry. They told her it couldn’t happen because astronauts were “trained to be perfect.” Of course, during the Apollo 8 mission, the exact thing she predicted actually happened. Instead of blaming anyone, Hamilton treated it as proof that software should be built to handle mistakes. I found that amazing – she didn’t just write code; she designed systems that expected humans to make mistakes.

Her story made me think about how I use and create technology. I’ve gotten frustrated when an app crashes or rejects input that seems fine, but I rarely stop to consider all the thought and safeguards behind it. Hamilton’s approach – designing for human error – is the basis for how we handle mistakes in programming now, such as with try/except statements in Python or input validation. It made me realize that good software isn’t just about making things work; it’s about making sure they still work when people slip up.

Her persistence and foresight were inspiring. She didn’t just follow rules; she questioned assumptions, planned for the unexpected, and thought about people using her code. That’s the kind of thinking I want to carry into my own work with technology: designing not just for perfection, but for real humans.

Week 8 Reading Reflection – Norman, “Emotion & Design: Attractive things work better”

When reading Norman’s “Emotion & Design: Attractive Things Work Better,” it got me thinking differently about how emotions affect the way we interact with design. Before this, I mostly thought good design just meant something that works well and is easy and intuitive to use. But Norman made me realise that how we feel when using something really matters too. I found his idea of positive affect interesting – when we’re in a good mood, we become more creative and open to solving problems. I’ve noticed this myself when I’m working on projects; if I’m relaxed and enjoying the process, I tend to come up with better ideas and find solutions more easily.

What also stood out to me was Norman’s explanation of negative affect – how stress or anxiety can actually help us focus. I totally agree with that because whenever I’m taking an exam or working under pressure, that little bit of nervous energy pushes me to concentrate harder and think faster.

Overall, this reading changed how I see both design and emotion. Emotions don’t just influence how we feel about something – they shape how we use it. Some designs are made to make us feel good – to relax us, inspire creativity, or make things enjoyable. Others use a bit of tension or urgency, like alarms or deadlines in digital design, to grab our attention and help us focus. It’s interesting to realise that designers often plan for these emotions on purpose. Good design isn’t just about working well; it’s about understanding how people feel.

Week 8 – Unusual Switch

Concept

For my project, I used the HC-SR04 ultrasonic sensor, which measures distance by sending out a sound wave and timing how long it takes for the echo to bounce back. I used it to detect how close a person’s body is to the sensor. When the person is far (but not too far), a yellow LED lights up. When they get close, a red LED turns on instead. I chose these two colors to mimic a childhood game where the closer you got to a hidden object, the ‘warmer’ you were, so red represents ‘hot,’ and yellow means ‘warm.’

Here’s my wiring and a video of my circuit in action 🙂
https://drive.google.com/drive/folders/1kgAL550ryRCarylolh-Xjpr2KqJABRaU?usp=drive_link

and here’s my GitHub repository

 Code I’m Proud Of

long readDistance() {
 //low for clean start
 digitalWrite(trigPin, LOW);
 delayMicroseconds(2);
 digitalWrite(trigPin, HIGH);
 delayMicroseconds(10);
 digitalWrite(trigPin, LOW);
 long duration = pulseIn(echoPin, HIGH);
 //convert to cm
 //sound speed ≈ 343 m/s → 0.034 cm/µs.
 //div 2 cause roundtrip
 return duration * 0.034 / 2;
}

The part of my code I’m most proud of is the readDistance() function. Through it, I learned how the ultrasonic sensor actually works, sending a pulse, waiting for the echo, and then calculating distance using the speed of sound. I followed a YouTube tutorial to understand the basics, and then used ChatGPT to help debug the issues I ran into. I even got to use some of my physics knowledge to convert time into distance, which made it extra fun since it reminded me of things I had learned before.

Further Improvements

Sometimes the sensor glitches a bit, and I suspect it’s because of my wiring. The HC-SR04 usually needs female-to-male jumper wires to connect properly to the Arduino, but I had to improvise with what I had. Using the Serial Monitor really helped me check if the sensor readings were accurate, but I’d like to clean up my circuit and test again to make it more stable. With proper connections, I think the readings would be much smoother and more consistent.

Another improvement I’d like to try is turning this setup into a Morse code interpreter. Instead of just showing colors for ‘close’ and ‘far,’ I could make the distance readings represent dots and dashes, and then have an LCD screen display the translated message. It would make the project more interactive and add a creative twist while still keeping the hands-free concept. I think it’d be really satisfying to build something that turns simple movements into an actual form of communication.