In the previous step, you saw how to use a PIR motion sensor to control a relay. That is interesting when it's dark, but during the daylight you'll have a waste of energy with the lightbulb being turned on. Keeping this in mind, let's improve our lighting circuit to only let the lightbulb turn on when the incident amount of light (luminosity) is low. To do so, we'll add a photoresistor to our circuit.
Photoresistors are light-dependent resistors. The incisive amount of light will define the resistor value. By using them, we are able to understand when it is night or day by setting the threshold values. Unplug your bulb plug from the wall socket and let's do some changes in our circuit. In the following figure, you can see how you must connect the photoresistor to the Galileo: