Modifications

Sauter à la navigation Sauter à la recherche
988 octets ajoutés ,  6 mai 2012 à 21:38
Ligne 84 : Ligne 84 :  
[[Fichier:cds-connect2.jpg]]
 
[[Fichier:cds-connect2.jpg]]
    +
== Analog voltage reading method ==
 +
 +
The easiest way to measure a resistive sensor is to connect one end to Power and the other to a '''pull-down''' resistor to ground. Then the point between the fixed pulldown resistor and the variable photocell resistor is connected to the analog input of a microcontroller such as an Arduino (shown)
 +
 +
[[Fichier:cds-analog1.jpg]]
 +
 +
[[Fichier:cds-analog2.jpg]]
 +
 +
For this example I'm showing it with a 5V supply but note that you can use this with a 3.3v supply just as easily. In this configuration the analog voltage reading ranges from 0V (ground) to about 5V (or about the same as the power supply voltage).
 +
 +
The way this works is that as the resistance of the photocell decreases, the total resistance of the photocell and the pulldown resistor decreases from over 600KΩ to 10KΩ. That means that the current flowing through both resistors increases which in turn causes the voltage across the fixed 10KΩ resistor to increase. Its quite a trick!
    
Source:  [http://www.ladyada.net/learn/sensors/cds.html cds]
 
Source:  [http://www.ladyada.net/learn/sensors/cds.html cds]
29 917

modifications

Menu de navigation