RELAY
RELAY
A relay is like a switch that can be controlled electronically. Relays are very simple devices and can be used to control devices with higher loads(Like AC controlled devices and devices that require heavy voltages to operate). Relay modules can be used mainly in IOT projects and home automation. Relays can be used to make useful hobby projects.
A two channel relay. |
*Dealing with high voltages may cause injuries or even death, please use relays with utmost care.
Working of Relays.
Relays work like electromagnets, when a voltage is applied the coil, the coil gets charged and acts like an electromagnet and moves the switch to the desired position. In simple terms, relays act as magnets when a signal is applied or removed.
- +5V of Arduino- 5V of relay module.
- GND of Arduino- GND of relay module.
- Pin no. 8 of Arduino- In1 of relay module.
Basic connection of a relay module |
CODE
void setup()
{
pinMode(8, OUTPUT);
}
void loop()
{
digitalWrite(8, LOW);//Here LOW will switch on the circuit because of the placement of the diode
delay(5000);
digitalWrite(8,HIGH);//Here HIGH will switch off the circuit because of the placement of the diode
delay(5000);
}
MISCEALLANEOUS INFORMATION
- NC denotes normally closed configuration of a relay(Switch on normally).
- NO denotes normally open configuration of a relay(Switch off normally).
- Rating of your relay matters (Relays operating at 5V are required to use with Arduino).
- Do not touch any connection without gloves on and don't place your module on any conductive surface.
- You can find the relay's schematic on google please do check it out once.
Comments
Post a Comment