Changes

Jump to: navigation, search

Classes/2010/VIS147A/Lab8

597 bytes added, 15:28, 2 March 2010
Activities
The simple potentiometer voltage divider can be connected to an of the Analog In pins (0-5) on your Arduino. By default, the ''AnalogInput'' program expects the potentiometer to be connected on Analog In 0, the value of <code>sensorPin</code> variable at the top of the program.
QUESTION: What will the voltage at output of the analog input simple potentiometer circuit be? What are the upper ____ and lower ____ voltage values as you turn the knob, and where do they occur? Highest voltage ____, position ____. Lowest voltage ____, position ____. (HINT: this is a voltage divider. How do you calculate the voltage in a voltage divider?)
==== Photoresistor ====
[[Image:Photo_resistor.png]] [[Image:Photoresistor.JPG|400px]]
Take Use the photoresistor from your 147A kit, (which has a resistance between 800 Ohms - 140 KOhms depending on your lighting conditions) and build the simple photoresistor voltage divider circuit above.
*Q2.1: With the same R2 resistor (10k) from above, replacing R1 with the photoresistor, what range of voltages (and corresponding data values) would you expect the highest and lowest voltage to see at your A_IN pinbe output from the simple photoresistor circuit?highest ____V, lowest ____V.
*Q2.2: The important part of this sketch is the line where the microprocessor reads the analog input:<code> val sensorValue = analogRead(potPinsensorPin);.</code> Looking at the Arduino help reference for that function (<code>analogRead()</code>), what do you think the value <code>valsensorVal</code> will be for those highest and lowest voltages at your A_IN pinfrom the photoresistor circuit? Remember, <code>analogRead()</code> returns a number between 0-1023. <code>sensorVal</code>: highest ____, lowest ____.
*Q2.3: How can you verify Verify your guess answers for the previous question? voltage and <code>sensorVal</code> values above. Come up with You can build the circuit and measure the voltage directly, but getting the <code>sensorVal</code> data is a plausible method, and try it outlittle more complex. Anything goes! (even using functions You can use next weeks material, like Sketchbook(''Examples->Communication-'') or just the basic <code>GraphSerial.println() If you have a good idea, share it with the </code> we discussed in class....
* Q2.4: 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)
 
* Q2.5: Does changing the code make this more sensitive?
=== FYI other sensors = Other Sensors ===I Familiarize yourselves with the specs for these sensors. If you have some any of them here if you want to , try themout.
===== flex sensor =====
spectra symbol flex sensor [https://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&krypto=6pWdQhy2AZPZ2sD8W5xEl6aJV6WqDHEGqOKNa%2FdOSS9%2BxO5uYYYPAp%2FlelrGLAWKNyXGozz0WUJ%2B%0D%0APBDIeyVBNlu11KbfyDwz&ddkey=CookieLogon]
===== home made strain gauge =====
A poor man's flex sensor. See page 32 in Forest Mims "Electronic Sensor Circuits & Projects" to make your own.
===== force / pressure sensor =====
Force Sensing Resistor (FSR)
http://www.tekscan.com/flexiforce/flexiforce.html
===== IR rangefinders =====
Sharp GP2D12 INFRA-RED RANGER
One of many Sharp Rangers, with different effective ranges [http://www.acroname.com/robotics/parts/sharp_guide.pdf comparison guide]
===== Ultrasonic rangefinders =====
http://www.acroname.com/robotics/parts/R271-SRF05.html
range of four meters
==== And more... ====See the Homework section. === can Can we sample sound? ====* It is an analog signal. * That I said in class it takes 100 uS to do an <code>analogRead()</code>, which gives us a maximum sampling rate of 10 kHz. This is a good questionsufficient for old fashioned phone conversation.
* We can do definitely do threshold detection: is a sound louder than a certain point.
* Can we make WAV files? I Don't Know...try it out?
== Analog Output ==

Navigation menu