The photoresistor is an electronic component which resistivity varies according to the amount of light received ( the resistance decreases when exposed to the light ).
The photoresistor is made of cadmium sulphide tape, a semiconductor.
When photons hit the tapes, electrons can pass through the semiconductor.
The main use of the photoresistor is the measurement of the luminous intensity ( camera, detection systems, … ).
CodeIn the " void setup " we initialize the serial monitor :
void setup() {
Serial.begin(9600);
}
Then, we read the analog value coming from photoresistor and we define it as " value " :
void loop() {
int value = analogRead(A0);
And we write the value on the serial monitor :
Serial.println("Analog Value :");
Serial.println(value);
delay(250);
}
ConnectionsFirst pin --> 5V
Second pin --> A0 ( a resistance is connected to the GND and to the photoresistor second pin ).
TipeeeI opened a Tipeee to gather some funds for projects, I'll post informations and news about incoming devices.
A big thank to people who'll support me on Tipeee ;D
Comments