Using photoresistor to detect light

Byadmin

Using photoresistor to detect light

Photoresistor,also called photocell, is a light sensor. Its resistor changes with light.

This project will use photoresistor to detect light and turn on/off an LED light.

Connection Graph:
photocell

Download photoresistor.ino sketch and load it into Arduino.

About the Author

admin administrator

2 Comments so far

PapaitoLocoPosted on  7:07 am - Apr 22, 2017

I detected a little error in the sketch ;

pinMode(photocellPin, INPUT); // declare the ledPin as an OUTPUT

the comment is just copy-pasted from above. It should be ;
pinMode(photocellPin, INPUT); // declare the photocellPin as an INPUT

You must be logged in to post a comment