Arduino – Photoresistor (Light Sensor)

Photoresistors are analog sensors that allow your Arduino to determine the level of light in an environment.

Note: You can use either 5 or 3.3 volt power for this project, and you can use different values of resistors (4.7K or 10K). Just remember that using different resistors or voltage will change the value the sensor outputs.

Functional Parts in the Project:

#define lightSensor A5

void setup() {

void loop() {
  int lightLevel = analogRead(lightSensor);

Be the first to comment

Leave a Reply