Week 8 Unusual switch

Concept

Planning an unconventional switch in which we had to open and close a circuit like a switch without using our hands seemed extremely challenging. However, after some planning, and examining the material available in the IM lab, I set myself the goal of creating two bracelets that upon touching they would “close” the circuit. I have always been fascinated by jewelry, so I thought this would be a cute way of integrating the concept of accessories with the Arduino interactivity.

Circuit Illustration

 

The part I struggled the most was finding a way of connecting bracelets to the breadboard and for them to react once they touched each other in response to the code in the digitalRead. After a long time of trial and error, I managed to make the LED light respond to the touch between the bracelets by inserting the jumper wires where the button would have been as we learned in class.

Final product

For the final result, every time the bracelets touched, by pressing my wrists together, the LED light would turn off. And when they were separated, the light would turn on.

Arduino code
void setup() {
  // put your setup code here, to run once:
pinMode(13,OUTPUT);
pinMode(A2,INPUT_PULLUP);

}

void loop() {
  int buttonState = digitalRead(A2);

  if(buttonState == LOW){         // button pressed
    digitalWrite(13, HIGH);
  } else {
    digitalWrite(13, LOW);
  }
}

GitHub PermaLink

https://github.com/imh9299-sudo/Intro-to-IM/blob/c27a407fe44541c3602992c664133ee011a63b8c/Assignment_8_Creative_Switch_copy_20251028080521.ino

Challenges and Further Improvements

One of the greatest challenges I faced happened while I tried to find the way of arranging the jumper wires and the wires connected to the copper bracelets so they would react on the LED light once they touched.

For my next project, I would like to make something more creative, and add some more responses such as making the lights blink or react to the movement of the wrists too.

 

Week 8 – Reading Reflection

Reading about Margaret Hamilton alongside Don Norman’s ideas made me reflect a lot on my own experiences as an IM major and CS minor. Hamilton’s work is astounding, not just in its technical brilliance, but in the stakes involved. I can’t imagine the pressure of knowing that a single error in your code could be catastrophic. That hit home for me when I thought back to my summer internship: I often felt anxious during functional testing, making sure that a feature actually worked before even thinking about optimizing it. Like Hamilton, I had to prioritize reliability over aesthetics at first, knowing that structure and efficiency could come later. Similarly, when working with Professor Moore on designing a robot extension, our creative vision for the robot was limited by its movements and what was functional, which was frustrating but also helped me come to the realization that function always had to come first.
Norman’s ideas about aesthetics and human experience made me notice the other side of this balance. I’ve realized that I learn better and retain information more effectively when it’s presented aesthetically, which is why I rewrite notes or design presentations carefully. I genuinely think it affects focus and engagement. Reflecting on Hamilton through Norman’s lens, I see that even in high-stakes work, there can be an “internal aesthetics” for the creator, like the satisfaction of elegantly structured, reliable code. This reading also made me think about how much balance is a part of my own work. I often want to implement my vision exactly, but my capabilities, time, and technical constraints sometimes get in the way. It can be frustrating, but I see now that navigating this tension, between function, reliability, and human experience, is a universal part of creating, whether you’re sending astronauts to the Moon or designing a robot extension. Hamilton’s example pushes me to aim for excellence under pressure, while Norman reminds me that design is also about how people, whether users or creators, experience the work.

Unusual Switch

Concept

For my unusual switch, I wanted to use a light sensor to create a simple “password” that isn’t typed or pressed in the usual way. Instead of a button, the user has to shine a flashlight on the sensor in a specific pattern to activate the LED. The idea is inspired by a morse-code style signal: the user must turn the light on for a set amount of time, then off for a set amount of time, and repeat this sequence to successfully trigger the switch. This makes the interaction more playful and unusual, relying on timing and attention rather than direct contact.

How it works

The project uses an LDR to detect light intensity and an LED as the output indicator. The Arduino reads the LDR value and compares it to a threshold to decide if the light is “on” or “off.” The user must follow the correct timing sequence: light on for three seconds, then off for three seconds, repeated three times. If the pattern is completed correctly, the green LED turns on for a few seconds to indicate success.

Github https://github.com/MohdAlkhatib/introtoim/blob/main/sketch.c

void loop() {
  int success = 0;

  for (int i = 0; i < 3; i++) {
    if (analogRead(ldrPin) > lightThreshold) {
      delay(3000); // light on for 3 seconds
      if (analogRead(ldrPin) < lightThreshold) {
        success++;
        delay(3000); // light off for 3 seconds
      }
    }
    delay(500); // brief pause between attempts
  }

  // if the user does the signal correctly 3 times in a row, turn on the LED
  if (success == 3) {
    digitalWrite(greenLED, HIGH);
    delay(3000);
    digitalWrite(greenLED, LOW);
  }

  delay(1000); // short pause before restarting
}
Future Improvements

In the future, I could make the switch more flexible by allowing different light patterns as “passwords” or adjusting the timing for each sequence. I could also add multiple LEDs or even a small sound to give feedback for each correct or incorrect step.

Week 8: Unusual Switch

Main Concept:

In Japan, the way you bow is really important when it comes to apologizing to someone older than you, and even some teachers in middle and high school teach their students how to bow properly. It is considered that bowing to 90 degrees is the most polite and respectful way to apologize to someone older than you. When I was coming up with the idea for this project, the first thing that came to mind was to teach people how to bow correctly to 90 degrees. The main concept is that the light can only be turned off if you bow to 90 degrees.

The link below is the video of me demonstrating my proper bowing detector.

My Proper Bowing Detector

Highlight of the code:

This is the code that I wrote. I wanted to use different pin numbers instead of pin 13 or different analog pins, such as  A1 or A3, but after changing them, my circuit suddenly stopped working. Thus, I chose to stick with pin 13 and A2. Inside the code, I used variables for pin numbers so that I can easily change them in the future. However, I want to figure out with my professor why my circuit suddenly stopped working just by changing the pin numbers.

int ledInput = 13; //variable to control LED
int sensorInput = A2; //variable to control sensor

void setup(){
  pinMode(13, OUTPUT); //send singnals from pin 13
  pinMode(A2, INPUT); //receive signals from A2
}

void loop(){
  //read signals from A2
  int buttonState = digitalRead(A2); 

  if(buttonState == HIGH){
    digitalWrite(13, LOW); //turn off LED if my forehead touches the foil 
  } else {
    digitalWrite(13, HIGH); //turn on LED
  }
}

 

Reflection and Future Improvements:

Since it was my first time building hardware using an Arduino, it took me a tremendous amount of time to understand how things work, especially the switch example we did in class. Thus, I spent a lot of time going through the slides and experimented for several hours to figure out which side of the jumper wire I can connect to the aluminum foil to make this project work. I really struggled with turning off the LED by placing my head on the A5-sized foil paper on the table for several reasons. First of all, the jumper wire was not long enough, so I had to connect multiple wires, but some of them got unplugged during the trials. Furthermore, since the tape is not conductive, when I covered the tip of the wire, the LED didn’t turn off. I tried using conductive tape because I thought it would allow electricity to go through the wire, but that didn’t work as well. At the end of the day, I made the foil paper on my forehead as large as possible to increase the surface area and only applied the tape to the sides of the foil so that it wouldn’t cover the tip of the wire. 

As for future improvements, I would like to use a sensor instead of a foil paper so that my users don’t have to put the wire on their forehead, which would be inconvenient to use. I also want to create a sensor that can precisely measure 90 degrees to detect the proper Japanese bowing style.

Weel 8 Reading – Her Code Got Humans on the Moon

While reading “Her Code Got Humans on the Moon“, I could learn and see how Margaret Hamilton is such an inspiring person . She was a computer scientist and software engineer who played a huge role in NASA’s Apollo missions back in the 1960s. What’s so amazing about her is that she didn’t just write code; she created entire systems for software reliability, which was a completely new idea back then. For the Apollo missions, she developed error-detection routines, priority scheduling, and backup systems so that the spacecraft could continue operating even if something went wrong. Basically, she designed software that could think ahead and handle mistakes, which was crucial when human lives were literally on the line. Her work laid the foundation for modern software engineering practices. What’s also incredible is how determined she was that she even brought her daughter to work, proving that her focus and dedication didn’t let anything stop her from solving these insanely complex problems.

What really fascinates me is how her technical contributions changed the way people think about software. Before her, software was often seen as just “a bunch of instructions,” but Margaret Hamilton treated it as an engineered system that could prevent disaster and adapt to unpredictable situations. This mindset completely shifted the tech world; today, every piece of software we use, from smartphones to cars, benefits from principles she pioneered. Learning about her makes me realize that software isn’t just about writing code; it’s about designing systems that are safe, reliable, and resilient. Her work shows that combining technical skill with persistence and creativity can literally launch humans to the moon and reshape the way we build technology forever.

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

Don Norman’s essay “Emotion and Design: Attractive Things Work Better”, really made me think about how much our feelings affect the way we interact with everyday objects. Norman explains that when something looks or feels pleasant, it actually makes it easier to use. Positive emotions make us more creative and patient, so small design flaws don’t bother us as much. On the other hand, stress or frustration narrows our focus and makes problem-solving harder, which is why usability is especially important in critical or high-pressure situations. I love how he uses examples like teapots, some ugly but practical, some beautiful but tricky, to show that the context and mood of the user really change which design works best.

What really stuck with me is how this idea goes beyond just making things look nice. Design isn’t only about functionality or efficiency; it’s also about how the product makes us feel. When we enjoy using something, we naturally perform better and feel more satisfied. It reminded me that the best designs are the ones that balance function, usability, and beauty, things that work well and bring a little joy into our daily routines. For me, that’s what makes a product feel complete: it’s not just useful, it’s also a pleasure to own and use. A perfect example for me is my piano keyboard. I’ve used many different keyboards over the years, and the ones that are pleasant to touch, look sleek, and respond just right make me want to play more and practice longer. Even if a slightly cheaper or simpler keyboard could technically produce the same sound, it just doesn’t feel as inspiring. The way it looks and feels actually affects my creativity and focus, making the music I play feel better.

Week 8 Unusual Switch Assignment

My concept: 

For this project, I wanted to create a switch using my elbow as the activator. I set up two coins on the table and connected them to the Arduino with jumper wires, so that when my elbow touched both coins at the same time, it would complete the circuit. The Arduino reads this connection as a “press” and turns on an LED. I liked how this made the human body part of the circuit, creating a physical and playful way to interact with electronics.

The process of connecting the coins, taping the jumper wires, and adjusting the setup taught me that even small details, like how the wires touch the coins and keeping them stable, really affect whether the circuit works. The project was about exploring how we can rethink simple switches and find unexpected ways to trigger electronics.

Video Demonstration: 

elbow switch.mov

Arduino Code: 

// Elbow-activated switch with LED

const int switchPin = 2;   // Pin connected to Coin A
const int ledPin = 13;     // Pin connected to LED 

void setup() {
  // Set Pin 2 as input with internal pull-up resistor
  pinMode(switchPin, INPUT_PULLUP);

  // Set LED pin as output
  pinMode(ledPin, OUTPUT);

  // Start with LED off
  digitalWrite(ledPin, LOW);
}

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

  // If coins are bridged (elbow touches), state is LOW
  if (state == LOW) {
    digitalWrite(ledPin, HIGH);  // Turn LED ON
  } else {
    digitalWrite(ledPin, LOW);   // Turn LED OFF
  }

  // Small delay for stability 
  delay(50);
}

Reflection:

Building this project was a lot of trial and error, and I learned so much about Arduino inputs, digitalRead, and resistors along the way. I realized that small details, like how the wires touch the coins and keeping the connections stable, make a huge difference. At first, I used a 10k pull-down resistor, but the LED wouldn’t stay on reliably when I touched the coins with my elbow. Eventually, I removed the external pull-down and switched to Arduino’s internal pull-up resistor, which made the switch much more stable and responsive.

I also loved seeing how simple code can control hardware in an immediate way, and how experimenting with the physical setup really affects the digital outcome. It was a fun reminder of how hands-on hardware projects are a mix of coding, problem-solving, and creativity.

Ideas for future work or improvements: 

Later on, I’d love to try using different parts of the body or gestures as switches, not just elbows. I could also add more LEDs or other outputs to make it feel more interactive and playful. It would be interesting to experiment with pressure-sensitive  sensors to make the switch respond more smoothly.

Eventually, I could imagine turning this into a small game or interactive piece, where your body becomes part of the control system. Also, I can imagine how interesting it gets when one could actually use their hands as part of the project where they would have more control on the switches and the whole system.

Github Link: 

https://github.com/deemaalzoubi/Intro-to-IM/blob/8753e3a8fa154b92aa973ab1735085c253a33d30/week%208elbowswitch.ino

Reflection – week 8

When I was reading these two articles side by side, I was struck by how they both explore the crucial role of human emotion in successful design, even though one is about teapots and the other about space travel.

Don Norman’s piece, “Emotion & Design,” argues that attractive things aren’t just a luxury but they actually function better. He explains that when we find a product pleasing, it puts us in a positive state of mind. This positive feeling makes us more tolerant of minor problems and more creative in solving them. I can see this in my own life; when I use a beautifully designed website, I feel more patient and engaged, and I don’t get frustrated easily. It’s not just about the tool working correctly, but about how it makes me feel while I’m using it.

This idea perfectly connects to the story of Margaret Hamilton. “Her Code Got Humans on the Moon” shows that the most brilliant technical system is useless if it doesn’t account for human nature. Hamilton understood that even the most highly trained astronauts were human and could make mistakes under immense pressure. Her fight to include error-checking code, which was initially dismissed, proved to be vital. Her software was designed with a deep understanding of human stress and fallibility, making it resilient and, in the end, heroic.

For me, the powerful lesson from both authors is that true excellence in any field requires blending logic with empathy. Norman shows us that beauty improves function by improving the user’s mindset. Hamilton shows us that anticipating human error is not a sign of weak design, but of strong, intelligent design. It reminds me that in my own work and studies, embracing creativity and understanding the human element is just as important as getting the technical details right.

Assignment

Concept

I created a simple switch using aluminum foil around my index finger and thumb. The goal was to make a switch that doesn’t use hands in the traditional sense ,  instead, it works by touching two parts of my own body together. When I bring my thumb and index finger together, the LED turns on. When they are apart, the LED turns off.

For this Arduino project.  I wrapped foil around my thumb and index finger to extend the conductivity, and connected each foil piece to the Arduino using jumper wires. . This simple prototype shows how the human body can become part of an electronic circuit.

 Link to video : Video

Highlight of the code

The code itself is simple. The Arduino reads the input from the foil on your fingers using digitalRead(). When your fingers touch (closing the circuit), it reads HIGH and turns on the LED. When you separate your fingers, the input reads LOW and the LED turns off.

int footSwitch = 2;   // Define the digital pin connected to the  switch (foil pad)
int ledPin = 13;      // Define the digital pin connected to the LED

void setup() {
  pinMode(footSwitch, INPUT);   // Set the foot switch pin as an input to read HIGH/LOW
  pinMode(ledPin, OUTPUT);      // Set the LED pin as an output so we can turn it on/off
}

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

  if (switchState == HIGH) {    // If the switch is pressed (fingers touching)
    digitalWrite(ledPin, HIGH); // Turn the LED on
  } else {                      
    digitalWrite(ledPin, LOW);  // Otherwise, turn the LED off
  }
  
  delay(10); // Small delay to stabilize readings and avoid flickering
}

Reflection

This prototype is simple but effective. I noticed that the foil doesn’t always maintain perfect contact, so the LED sometimes flickers if the foil slips or my skin doesn’t touch the metal fully. I could improve this by using stretchable conductive tape  to make contact more consistent.

Even with these small issues, it was exciting to see how my body can act as a switch. Using just fingers and foil, I was able to control the LED and experiment with a non-traditional, hands-free interaction. It’s a great demonstration of how electronics and the human body can be creatively combined in fun, unexpected ways.

Week 8: Unusual Switch

Concept

For this assignment, I struggled to come up with the idea itself. I mean, a switch without using your hands is pretty tricky. I eventually came up with the idea of using an earring and a shoulder pad (of some sort). Basically, when you tilt your head (so the earring touches your shoulder), that’s when the connection happens and the LED turns off. It turns off because the whole idea is laziness. If I’m napping while sitting up, I tilt my head to the side toward my shoulder. So it makes more sense for the LED to turn off when I tilt my head, just like wanting to turn the lights off to go to sleep.

Code

void setup() {
pinMode(2, INPUT_PULLUP); //earring and shoulder foil
pinMode(12, OUTPUT);
}

void loop() {

if (digitalRead(2) == LOW) {
  digitalWrite(12, LOW); // LED turns off when earring connects to shoulder foil
}
else{
  digitalWrite(12, HIGH); // LED is on (not touching)
}
}

 

Here’s the video of the working switch: Video Demo

Here’s the picture of the wiring:

Future Improvements

Overall, the idea was simple, but I came across some problems. One was the LED kept blinking without a certain pattern, and I wasn’t really sure why. Then i scratched everything and redid it, and it worked. I think it might have been a problem with actually putting the wires and components on the circuit, so I will try to be more precise and careful in the future.