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.

Leave a Reply