Changes

Jump to: navigation, search

Week 3 Lab

38 bytes added, 17:55, 14 April 2009
Undo revision 480 by Rtwomey (Talk)
[[Image:Pot_photo.JPG|400px]]
 
*Q: What will the voltage at A_IN be? What are the upper and lower values? (HINT: it is a voltage divider. How do you calculate the voltage in a voltage divider?)
 
*Q: The important part of this sketch is the line where the microprocessor reads the analog input:<code> val = analogRead(potPin);</code> Looking at the Arduino help for that function (<code>analogRead()</code>), what do you think the value <code>val</code> will be for those highest and lowest voltages at your A_IN pin?
 
*Q: How can you verify your guess for the previous question? Come up with a plausible method, and try it out. Anything goes! (even using functions next weeks material, like Sketchbook->Communication->Graph) If you have a good idea, share it with the class....
=== photoresistor ===
Take the photoresistor from your 147A kit, which has a resistance between 140k - 800 depending on your lighting conditions.
* Q: With the same R2 resistor (10k) from above, replacing R1 with the photoresistor, what range of voltages (and corresponding data values) would you expect to see at your A_IN pin? What are the upper and lower values? (HINT: it is a voltage divider. How do you calculate the voltage in a voltage divider?) *Q: The important part of this sketch is the line where the microprocessor reads the analog input:<code> val = analogRead(potPin);</code> Looking at the Arduino help for that function (<code>analogRead()</code>), what do you think the value <code>val</code> will be for those highest and lowest voltages at your A_IN pin? *Q: How can you verify your guess for the previous question? Come up with a plausible method, and try it out. Anything goes! (even using functions next weeks material, like Sketchbook->Communication->Graph) If you have a good idea, share it with the class.... 
* Q: How could you make this more sensitive? There are least three ways to try... think in terms of the physical enclosure around the sensor, the hardware setup (a voltage divider), and the software (look at File->Sketchbook->Analog->Calibration..., specifically the <code>map()</code> function)
 
* Q: Does changing the code make this more sensitive?

Navigation menu