Tuesday, February 16, 2016

Arduino Labs 1 - partner Ignacio

1. Blinking LED Circuit with Arduino

2.Switch and LED circuit with Arduino

  1. How would you modify the circuit (without altering the code) so that the LED was turned on by default, and only went off when someone pressed the switch?
    1. By reversing the ground and power connection to the switch, creating a closed circuit with the LED until the switch is pressed. 

3.Potentiometer and LED circuit with Arduino

  1. When the potentiometer is turned all the way down (offering minimum resistance), what voltage is read at Arduino pin A0?
    1. The full 5 Volts
    2. or 1023 -- 255 as read through the Arduino serial monitor
  2. When the potentiometer is turned all the way up (offering maximum resistance), what voltage is read at Arduino pin A0?
    1. 0 volts
  3. How much resistance must the potentiometer offer in order for the voltage at Arduino pin A0 be 2.5V?
    1. Vout = Vin(R2/(R1+R2))
    2.  Vout/Vin = R2/(R1+R2)
    3. 1/2 = R2/(560+R2)
    4. R2 = 560 ohms
  4. Why have I multiplied the potentiometer value (potVal in the code) by 0.25 in order to set the brightness of the LED (ledVal in the code)? In other words, why couldn't I just set the LED output value to be exactly the same value as the potentiometer input value?
    1. Because then when the potentiometer was turned all the way down (least resistance) the LED would have too much current and would blow.

4.Potentiometer and speaker circuit with Arduino

(Poor video quality I apologize, but if you turn the volume way up you can hear the tone change)

  1. The speaker is connected directly to power and ground... Isn't that a short circuit and therefore dangerous?
    1. It isn't only because we are regulating the amount of current running from pin 5, therefore using the arduino, like a variable resistor
  2. The sound produced by this circuit is not very loud. What would you have to do to get the sound louder?
    1. Get a bigger speaker and run much more current through it!
  3. Are we having fun yet?
    1. HA yes..


5.Photoresistor and speaker circuit with Arduino


  1. How would you change the circuit (without altering the code), so that the behavior of the sound in relation to the light falling on the photoresistor was reversed?
    1. Switch the ground and power leads to the photoresistor, so that at full light it would register the most resistance and at lower light it would register less resistance. 

No comments:

Post a Comment