The principle of the relay is as follows. Apply voltage to the electromagnetic coil. A field arises in the coil, which attracts a metal foot. In turn, the foot mechanically closes the load contacts.
The relay has two main uses. First, we can apply as little as 5 volts to the coil to close the circuit of a very powerful load. For example, the Arduino tutorials' relay can turn on a light in the house or turn off a forgotten iron. Second, some kinds of relays can simultaneously close and open several different circuits with different voltages.
With a controller, a relay, and a light sensor, you can make a simple automatic light. The controller will light the lamp when the sensor's light level is less than the preset value.
We will use a ready-made module based on a photoresistor as a sensor.