User Tools

Site Tools


oak:tutorials:photocell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
oak:tutorials:photocell [2016/03/22 21:45]
jwhendy
oak:tutorials:photocell [2016/03/22 21:53]
jwhendy
Line 1: Line 1:
 ===== Oak: using a photocell (photoresistor) ===== ===== Oak: using a photocell (photoresistor) =====
  
-In this lesson, we will connect a photoresistor to the Oak. A photoresistor is simply ​a potentiometer (a variable resistor) ​where light is acting ​to turn the knob. When there is a lot of light, the resistance drops; with low light, the resistance is higher. Using this property, we can send a voltage through a photoresistor,​ measure the resistance via a change in voltage, and obtain a value for how much light is shining on the photoresistor.+[[http://​digistump.com/​wiki/​_media/​oak/​tutorials/​photocell.png|{{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​photocell.png?​400}}]] 
 + 
 +In this lesson, we will connect a photoresistor to the Oak. A photoresistor is like a potentiometer (a variable resistor) ​except ​light is acting ​instead of a knob. When there is a lot of light, the resistance drops; with low light, the resistance is higher. Using this property, we can send a voltage through a photoresistor,​ measure the resistance via a change in voltage, and obtain a value for how much light is shining on the photoresistor.
  
 ===== Components ===== ===== Components =====
Line 115: Line 117:
 </​code>​ </​code>​
  
-This code simply ​reads ''​A0'',​ stores the number it obtain in the variable called ''​light'',​ sends it ot the computer via serial, and then pauses for 0.25 seconds. ​+This code reads ''​A0'',​ stores the number it obtain in the variable called ''​light'',​ sends it ot the computer via serial, and then pauses for 0.25 seconds. ​
  
 Using serial, the output will look like this as you cover and uncover the sensor: Using serial, the output will look like this as you cover and uncover the sensor:
oak/tutorials/photocell.txt · Last modified: 2016/03/22 22:00 by jwhendy