Week 8: hair-clip switch

For this assignment, I made a physical switch out of a hair clip and foil. Since the assignment was about creating an unusual switch, I wanted to build one out of simple materials that could still work clearly as a circuit. I used the hair clip and foil as the two conductive parts, and when they touched, the circuit closed and the LED responded.

At first, I tried a few different ideas, like using a necklace or a headband as one of the conductive parts, but that did not work because of the wire length and the physical arrangement. After thinking through different options, I realized that a hair clip made more sense because it already has a natural opening and closing action. That made it easier to turn it into a working switch. I attached the hair clip to the end of the shirt, as shown in the video. Ideally, I wanted to place it on the head, but because the wires were too short, I decided to keep it in close proximity to the board instead. I used foil as the second conductive contact, so when the clip touched the foil, the circuit closed.

hairclip-switch

The way the project works is that one side of the switch is connected to the hair clip, and the other side is connected to the foil. These are wired to the Arduino so that when the two conductive parts touch, the circuit closes and the switch state changes. I used digitalRead() to read the switch, and I connected the output to an LED. At first, the LED only stayed on while the conductive parts were touching, but I changed the code so that one touch turned the LED on and the next touch turned it off. I liked that version more because it felt more intentional and more like a real switch.

One part I found difficult was the physical setup. The challenge was not only the code, but also making the conductive parts line up in a way that worked. I originally tried to use the RedBoard, but I ended up using my own Arduino Uno instead because I was more familiar with it from using it in high school. Since I had already worked with the Uno in the Arduino app before, it was easier for me to use the board I already understood.

Code I’m proud of:

void loop() {
  buttonState = digitalRead(switchPin);

  if (buttonState == LOW && lastButtonState == HIGH) {
    if (ledState == LOW) {
      ledState = HIGH;
    } else {
      ledState = LOW;
    }

    digitalWrite(ledPin, ledState);
    delay(200);
  }

  lastButtonState = buttonState;
}

 

This is the part of the code I am most proud of, because it instead of just lighting up while the conductive parts were touching into a toggle system. So, one touch turns the LED on, and the next touch turns it off. I like this part because it made the switch feel more complete.

I am happy with this project because it was a refresher for me in using Arduino, but in a creative way that made me think about the function of each LED, wire, resistor, and connection. The materials were simple, but the project still made me think about both the physical interaction and the code logic.

 

Reading Reflection:

One of the most important parts of Margaret Hamilton’s work was not just writing code, but understanding that people make mistakes and that systems should be built with that in mind. I think that idea interested me more than just the fact that she helped get humans to the moon. The reading made me feel like her work mattered not only because it was impressive, which it was, but because she was thinking in a more realistic way than the people around her. The fact that her concerns were dismissed because astronauts were expected to be too well-trained to make mistakes especially stood out to me, because that feels like a very unrealistic way of thinking. The reading is not only praising Hamilton, but also showing how software and careful planning were underestimated until they proved how necessary they were.

I do agree with Norman’s point, but not completely. I think attractive things can work better because people are usually more open, patient, and comfortable when something looks nice or appealing. If something looks good, people are often more willing to give it a chance instead of immediately getting frustrated by it. At the same time, I do not think attractive design automatically means good design. Something can look beautiful and still be confusing or badly made, and we can see that in our daily life. So for me, it’s not just that beauty matters, but that beauty and function should work together. I also think this depends a lot on context. In a calm situation, something attractive might make the experience better, but in a stressful situation I think clarity or practicality matters much more than appearance.

Leave a Reply