Physics 37100 Advanced Physics Laboratory I

Lab #2

(PART I: Analog Output)

 

1)          Connect a resistor R and LED in series to pin 9 and GND on your arduino.  Remember the LED is polarized so make sure the + is connected to the pin 9 side. The long pin is usually the + side.

2)          Make a sketch to turn on the LED using digitalWrite.

3)          Observe the brightness of the LED with R=100K, 10K, 1K, 500 ohm, 300 ohm, 200 ohm, and 100 ohm.   The R values do not need to be exact.  (e.g., 330 instead of 300).  You can use two 100 ohm resistors in series to get 200 ohms.  You could use two 1K resistors in parallel to get 500 ohm.

a.      Which one is brightest?

b.      Why?

4)          Repeat 3) with a few other LED colors to find the combination that seems brightest.

5)          Using the brightest combination adjust your sketch to use analogWrite to turn on the LED.

a.      Make a loop to cycle the analogWrite values through 0,1,2,4,8,16,32,64,128,255.  Use a delay of 1-2 seconds between each change.   

b.      Observe the brightness at each level. 

c.      Does the brightness seem to double each time?

 

 (PART II: Analog Input)

 

6)          Connect a photoresistor and a regular resistor R in series to the 5V and GND on your arduino.  Connect R to the GND side.  Then connect the Analog input 0, A0, to the point between the photoresistor and R.

7)          Make a sketch using analogRead to measure the voltage V0 at A0 once every second. 

8)          Use Serial.begin(9600); in setup() and Serial.println(V0); in loop() to print out the value of V0. 

9)          Record the value of V0 and convert to Volts for 3 repeatable lighting conditions and 3 values of R=100 Ohms, 1K, 10K (nine combinations).

a.      Covered.

b.      Uncovered (Room light).

c.      Bright light (flashlight).

10)      From these values determine the resistance of the photo resistor for each case. 

11)      Turn in the ino-file and a short description of what you did, the answers to the questions, data, and analysis in PDF.