A relay is used like a switch. You can turn off/on an electrical appliance (bulb, tubelight, fan, heater, etc.) through the relay, based on a condition. You will be specifying this condition in the code.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6bfa9530-edf5-4fd5-9ada-1b97fbbf35df/Output_Relay-01.jpg

Make Connection

  1. Find this relay screw terminal in your Kit.

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4e55407c-0f7c-4223-a9c3-92f84f49cc37/Relay-1.png

  2. Look at the end of this terminal, you will find three screw tumblers like this.

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ac9f57ef-ea3c-4dcc-b185-64042c3660d5/Relay-2.png

  3. Use the electrical tester to loosen the screws on the terminal.

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/75f0d1a3-1706-41e5-9591-14e352265c14/Relay-3.png

  4. This is how the screw tumblers will look like when they are loosened.

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/21b12266-a0ea-43b2-aca7-1a5e01f5d513/Relay-4.png

  5. Cut and strip a short length of one of the wires to your electrical device (light, fan, etc.). Plug the two ends into the terminal as shown.

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/190d7e21-1734-41f1-b12b-7963c6222737/Relay-5.png

  6. Use the electrical tester and tighten the screws to secure the wires in place.

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4ad18741-9f6c-47cd-b849-cc8a6ece88f2/Relay-6.png

  7. This is how the relay screw terminal will look like once the wires are secure.

    https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e9825634-fdee-4bd1-a3a8-aa87718e888d/Relay-7.png

Precautions

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/552552d1-6d2b-4ebf-9c20-3a0e162bdc4d/Output_RelayBulb-01.jpg

Code: