Component knowledge
Relay
Relay is a safe switch which can use low power circuit to control high power circuit. It consists of electromagnet
and contacts. The electromagnet is controlled by low power circuit and contacts is used in high power circuit.
When the electromagnet is energized, it will attract contacts.
The following is a principle diagram of common relay and the feature and circuit symbol of 5V relay used in
this project:
Pin 5 and pin 6 are connected to each other inside. When the coil pin3 and 4 get connected to 5V power
supply, pin 1 will be disconnected to pin 5&6 and pin 2 will be connected to pin 5&6. So pin 1 is called close
end, pin 2 is called open end.
Inductor
The unit of inductance(L) is the henry (H). 1H=1000mH, 1mH=1000μH.
Inductor is an energy storage device that converts electrical energy into magnetic energy. Generally, it consists
of winding coil, with a certain amount of inductance. Inductor will hinder the changing current passing through
the inductor. When the current passing through inductor increases, it will attempt to hinder the increasing
trend of current; and when the current passing through the inductor decreases, it will attempt to hinder the
decreasing trend of current. So the current passing through inductor is not transient.
The reference circuit for relay is as follows. The coil of relay can be equivalent to inductor, when the transistor
disconnects power supply of the relay, the current in the coil of the relay can't stop immediately, causing an
impact on power supply. So a parallel diode will get connected to both ends of relay coil pin in reversing
direction, then the current will pass through diode, avoiding the impact on power supply.