
BeagleBone By Example
By :

So basically, to switch an AC appliance or any circuit, you will need a switch, just like you have in your houses, where you have a switch to turn on a bulb or a fan. There is a basic circuit involved which looks very much like the following picture:
So, as we can see in the preceding picture, if you toggle the switch it's going to open and close the circuit. This in turn will make the bulb go off and on. But this is done mechanically in normal mechanical switches.
Whenever we want the same action to be performed, we will be using the electrically controlled switches, which are on an electrical relay. The image below shows an electrically controlled relay in off and on states:
In the preceding diagram you can see that whenever the power is supplied to the coil from the 3V power supply, the coil energizes and acts like a magnet pulling the terminal down. This connects the other terminal and closes the circuit and current flows through the circuit from the...