Relays are a type of electrical switches that are controlled through an electrical circuit, separate from that of the actual switch. Typical relays are mostly operated through an electromagnet exerting a magnetic field on a mechanical actuator. Nevertheless, advancements in the semiconductor industry during the last decades also resulted in the creation of solid-state relays, which have no moving parts, therefore do not wear out nor do they experience contact bouncing due to vibrations, hence have increased reliability.
Practically, a relay is an amplifier, since it is able to control a high power output through a low power input. They were first invented in 1835 by Joseph Henry, the man who also discovered electromagnetic induction and whose name is currently being used for the SI unit of inductance.
As you can see, there are two basic types of relays: those making use of electromagnets and solid-state relays, which ramify into many other types according to the applications in which they are used. A typical electromagnetic relay consists of an electromagnet, an armature, a spring and electrical contacts. When electrical current is being pumped through the coil of the electromagnet a magnetic field is generated, thus exerting a force of attraction over the armature, which is basically a moving contact.
The armature starts moving towards the electromagnet, breaking an electrical contact and establishing a second one. When the flow of current through the coil is interrupted, the magnetic field of the electromagnet collapses and the armature is released. The spring then moves the armature back in the original position, breaking the second electrical contact in order to establish the first one once again.
Solid-state relays are mostly associated with thyristor or other solid-state switching devices. The galvanic isolation between the output and the input is generally achieved with the help of optocoupler devices, which basically consist of a light source and a photo detector, such as a photodiode or phototransistor.
Relays are generally used to switch to large amounts of power with the help of a low input of power. For example, a relay switching an electric current of 120 volts and 2 amps can be powered with a current of a mere 5 volts and 50 milliamps. Their applications are practically endless, starting from home appliances and reaching all the way to the automotive industry, and not only.