So when
light shines on the photocell, it turns the transistor on, which energizes the relay's electromagnet, which turns the
light off. When it is dark, the photocell has high resistance, so no current flows through the base and the relay is not activated -- the
light is on.
read more >>