Wednesday, February 18, 2015

Lab 2 - Introduction to Microcontrollers

Part 1: Blinking LED with Arduino


Part 2: Reading a Switch with Arduino to Control an LED


  1. Keep the LED set-up the same, but rearrange the setup of the switch, so that the switch, when off, blocks the current from going directly to ground and instead redirects the current into pin2 (and therefore lighting up the LED), and when switched on, allows the current to flow directly into the ground, which would not light up the LED.
Part 3: Reading a Potentiometer with Arduino to Control an LED


  1. 5V
  2. 0V
  3. It must offer half of its possible resistance, which in this case is 5 k-Ohms.
  4. The LED's output values only go up to 255, but the potentiometer, being read via analogRead, goes up to 1023. Multiplying potVal by 0.25 converts the input values to a number that can be fed to the LED safely.
Part 4: Reading a Potentiometer with Arduino to Control a Speaker


  1. No, because the speaker has its own resistant properties, and drops some the current running through it.
  2. You would have to use smaller resistors, to allow more current to flow into the speaker.
  3. Are we having fun yet? Yes!!
Part 5: Reading a Photoresistor with Arduino to Control a Speaker


  1. Reverse the positions of the photoresistor and the 10 k-Ohm resistor. The less light shines on the photoresistor, the greater its resistance, and therefore the more current that will flow into the Pin instead of the ground, with the opposite effect when the light is greater.
MUSICAL INSTRUMENT!!!



Crawford's model of interaction describes interaction as a communicative process between two parties, in which both parties alternatively listen, think, and speak to one another. In this case, the parties are myself and my pseudo-instrument. I listen to the note being played, have to think about which note to play next and where to press in order to create it, and speak by hitting the next "key" with the knife. The instrument listens to which note is being pressed, thinks through the Arduino in order to determine the tone that should be played, and speaks by playing that tone.

My design is very shoddy (though it has since been 'clothed' in an old box of almonds, to mask the breadboard and Arduino), and is very very simplistic, in that it really only consists of a lot of 'switches' that need to be pressed in order to create a sound. The materials used could use to be improved (particularly my keys and the scotch tape i use to attach them to my wires) as well. It would be interesting to add in a potentiometer that could determine which key the notes are in (as of now they are all locked into major C), or somehow adding in a pressure-reader that would dampen the sound or not depending on how hard it's being pressed, to make the sound more dynamic, both of which would add interactivity to my design. In terms of expressiveness, adding in speakers to allow for chords would be a huge bonus, though it would require a redesign of my keys as well, or adding in LEDs that light up in designated patterns depending on the note being played, would help make my instrument more visually appealing.

Wednesday, February 11, 2015

Lab: Feb 4 2015

Part 1: Simple LED Circuit


  1. The purpose of the resistor is to weaken the current running through the circuit, preventing the LED (or anything else) from burning out.
  2. Since V = 5V and R = 560 Ohms, then I = 5/560, or 8.9 mA.
  3. If V = 5 and I = 15mA, then R = 5/0.015 =  330 Ohms
  4. 5 - 2.2 = 2.8 V
Part 2: Simple LED Circuit with Switch


  1. The circuit's behavior would not change. It'd just have the resistor dampen the current before it gets to the switch.
  2. The circuit's behavior still would not change.

Part 3: Simple LED Circuit with Potentiometer


  1. The resistor is necessary because without it, if the potentiometer was at its lowest setting (allowing the most current to pass through), the LED would burn out.
  2. V=IR ; V = 5 and R = (10,000 + 560), so I = 5/10560 = 0.047 mA.
  3. Rheostat, Thermistor, Humistor, and Photoresistor.

Part 4: Dueling LED's Circuit with Potentiometer


  1. When the potentiometer is turned, it increases the amount of current going through one LED (and therefore brightening it), and decreases the amount of current going through the other LED, dimming it.
Part 5: Capacitor Charging Circuit



  1. The capacitor will charge more slowly than before, since there will be less current flowing into it and charging it. As a result, the LED will stay lit longer.
Part 6: Capacitor Discharging Circuit with LED Delay



  1. The capacitor discharges up through the LED part of the circuit because that's where the positive charge is held, so in order to discharge, the capacitor has to go from the positive side (facing the LED part of the circuit) and travel through that section of the circuit in order to reach the ground.