Week 8 – Hands free switch

Mostly my ideas involved the use of hands, therefore, my “creativity” led me to use my foot. 

First of all, I made a circuit to turn on the LED light. Then, I connected two strips of copper tape to two wires. Copper tapes, which serve as conductors,  were stuck on a bin and on a trash lid.

As a result, when a trash bin is closed, the light turns on because two conductors touch each other. 

Generally, that was fun doing it and I learned some basics in working with basic circuits.

Creative Switch

Inspiration

Back home, my brothers would get frustrated whenever I borrowed something from their drawer and didn’t close it properly. To combat this, I decided to create a simple mechanism that has a light turn on whenever the drawer is fully closed.

Implementation

To implement this, I created a circuit that was disconnected at one point. Connecting two wires would complete the circuit and light up the bulb. My initial idea was to have two wires taped to the insides of the drawer, but this failed since it was difficult lining up the two wires perfectly. As a result, I decided to use aluminum foil to extend the reach of the wires. Using a fat strip, I was able to establish a connection when the drawer was closed. Below is the circuit and a demonstration of the circuit.

Reflection

I felt like the most difficult part of this was creating a seamless integration of the wires into the drawer. As of now, the drawer is only able to be opened about 10cm before it falls out of the breadboard, so being able to have a long wire could fix this. Furthermore, the wire should probably go underneath or through the side, since I can’t place or take anything from the drawer while its open. Moving forwards, I also want to add another color designating the drawer is open, so that it’s more obvious to the user that the drawer must be closed.

Unusual Switch: Car braking

For this week’s unusual switch assignment that we had to implement a simple circuit switch without the use of our hands, I used a real life example as my inspiration for this weeks exercise. Commonly found in cars and other vehicles was the brake light at the back of the cars which lights up every time you press down the brake pedal. 

Car Backlight Pictures | Download Free Images on Unsplash

I started by making a simple circuit which would light up the LED every time the circuit was closed. Then I used two more cables to cut the supply to the LED row on the breadboard and also disconnected the ground to the main + and –  bus on the breadboard. Then I used two wires to redirect the connection onto a sheet of paper and tape the ends of wire flat down onto the paper. In order to close the circuit and make the switch functional I came up with the idea of using aluminum foil which act behave as the conductor of electricity. By attached the piece of aluminum foil to the bottom of my shoe I was able to close the circuit. Through this manner I was able to light up the bulb every time I press down onto the sheet of paper mimicking the braking functionality in a car.

 

smell me switch!

For this week’s assignment, I first thought about a switch that would turn an LED light on when you sit, and while this was definitely possible, I wanted to do something a bit more fun. As I was sitting, I got the idea to connect two clips to my septum ring and let the current run through the ring. It first started as a joke, I just wanted to see what would happen, but then I realized I wanted to use my septum as the switch or button. I struggled for a bit to decide how to make it a switch, by connecting the clips to the right the light was on, but because it was connected the only way to turn it off was to disconnect the clips. Somehow I came up with the idea to instead extend two wires with metal and have them touch the ring. I tested it out with my water bottle and saw that it could work, but I wanted something that perhaps doesn’t look amazing, but looks better than my purple water bottle. I used cardboard and hot glue to make a triangular pyramid and glue paper over it to make it look a bit better. The idea is to make the pyramid smell nice and when you sniff the LED lights up! (this only works for people with septum rings, although I imagine other piercings could work too)

here’s a video of me doing it!

Hands-Free Switch

Blow to connect

 

 

 

 

 

 

 

For this project, it took me a while to come up with an idea as we use our hands so often, every idea I imagined included hands in some way. Finally I decided to build something which would work when blowed on.

I began by making a simple circuit which would light up the LED, without a switch. I just used a resister, wires and the LED light. Then I detached one of the wires and added another wire in order to attach them both to alligator clips which would link to my project.

I ended up making a circuit which would light up the LED when two pieces of aluminium foil would touch (complete the circuit) through blowing from one side. The two pieces of foil are taped onto a piece of card and attached by alligator clips to the circuit.

In the future, if I was to recreate this concept along with code, I could incorporate sound each time the pieces of foil touch.

 

Week 8 – Stand up

It is good to stand up once in a while especially since I spend so much of my time, sitting in front of the computer. The switch turns on when I stand up and my leg makes contact with the table.

I have taped aluminum foil to the table and to my thigh and they are connected with alligator clips.

If I could program it, I would add a timer that caused the LED to start blinking after a certain time period and only stop blinking after the LED has been on for another period of time.

Hope you like it!

This is the schema but instead of using a switch, I used aluminum foil and connected them with alligator clips.

Week 9a Digital Input and Output

const int ledPin = 2;
const int buttonPin = 3;
unsigned long timer = 0;
bool onOff = LOW;
byte prevButtonState = LOW;
bool blinking = false;

void setup() {
  // put your setup code here, to run once:
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT);
  Serial.begin(9600);
}

void loop() {
  // read the button pin
  // store that in a local variable
  byte buttonState  = digitalRead(buttonPin);

  // print out the state of the button stored in the variable
  Serial.println(buttonState);

  // check to see if the button is pressed and last time it wasn't
  // only do something if that is the case
  if (buttonState == HIGH && prevButtonState == LOW) {
    // change blinking to not blinking
    blinking = !blinking;
  }

  // record the current button state for use next time through loop
  prevButtonState = buttonState;

  // if blinkkng is true, do the blinking stuff
  if (blinking == true) {
    // check to see if the current time (millis) is greater than the timer we recorded
    if (millis() > timer) {
      // flip the boolean
      onOff = !onOff;
      // record a new time to check against
      timer = millis() + 250;
      // turn the led on and off
      digitalWrite(ledPin, onOff);
    }
    / otherwise turn the LED off
  } else {
    digitalWrite(ledPin, LOW);
  }
}

 

Unusual Switch

Blow-torch

The circuit itself is very simplistic, in that only the components essential to the LED lighting up are present. For the switch I used a piece of paper and copper tape. I tightly stuck copper tape on the paper such that it would bend the paper. So as long as the paper stayed bent, it would remain in contact with the green jumper wire, thereby lighting up the LED. To turn off the LED, I can blow on the paper from above to straighten the paper, thereby disconnecting the circuit. The circuit does not have a resistor because when it was connected, the LED would not light up brightly, likely due to too high resistance in the circuit.

Close up of the switch
The circuit in action

Midterm Final

My Game:

Concept/ Inspiration:
My idea for the midterm came from the movie “Cloudy with a Chance of Meatballs” where the sky rains food and people keep eating what falls from the sky. Therefore, my main concept for the game is that food (Meatballs) fall from the sky and the character has to eat it. If the player eats all five meatballs, they win. If the player misses two meatballs, they lose.

Process and Challenges:
I have made a class for meatballs in order to have multiple meatballs falling at once.When the player misses two meatballs, he loses the game. Therefore, the screen changes to one that says “You Lost!”. when you click the mouse, you are brought back to the original page. However, one of the challenges I have faced and still do not know the answer to is that when the game is “restarted” everything is scattered and not like the game actually was at the beginning. Therefore, you have to click play again in order to restart the game. I am guessing it is because the game is actually still going and I need to do something to make every aspect of the game restart not just bring the screen back to the “Home” screen.