Using the Photoresistors

Theo Chemel

The photoresistors are components used to detect brightness. Like a potentiometer changes resistance as the knob is turned, a photoresistor changes resistance as the light level changes. By measuring this change in resistance, we can determine the amount of light hitting the photoresistor.


Wiring the photoresistors


Programming with the photoresistors

The example sketch below will read the brightness value from each photoresistor and print it to the serial monitor to be plotted.


void setup() {
  Serial.begin(9600);
}


void loop() {
  int reading1 = analogRead(A0);
  int reading2 = analogRead(A1);
  int reading3 = analogRead(A2);
  Serial.print(reading1);
  Serial.print("\t");
  Serial.print(reading2);
  Serial.print("\t");
  Serial.println(reading3);
}

Exploring Sensors

Dyani Robarge

Photoresistor

Liam Brady

Photoresistors are resistance-based sensors that react to how much light they are being hit by. The more light present, the smaller the resistance across the sensor. The Arduino is able to measure the changing resistance to determine how much light is in the room.

void setup() {
  Serial.begin(9600);
}

void loop() {
  int val = analogRead(A0);

  Serial.println(val);
}