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);
}