[vc_row][vc_column width=”1/1″][vc_column_text]A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations.
1* pcDuino kits
[/vc_column_text][/vc_tab][vc_tab title=”Connection diagram” tab_id=”1389144196-2-65″][vc_column_text]
[/vc_column_text][/vc_tab][vc_tab title=”Code” tab_id=”1389150407187-2-5″][vc_column_text]
#define Relay 13
int val = 0;
val = digitalRead(12);