RELAY MODULE

CODE:

#include”maker_relay.h”

int main()
{

init();
Serial.begin(9600);

while(1)

{

maker_relayState(2 , 1);
Serial.println(“Relay is on!”);
delay(1500);
maker_relayState(2 , 0);
Serial.println(“Relay is off!”);
delay(1500);

}

return 0;

}

A relay is a switch that is electrically operated by an electromagnet. The electromagnet is activated with voltage from the microcontroller and it pulls a contact to make or break a high voltage circuit. It is mainly used to control high voltage electronic devices.

VCC- power supply pin (5V)

GND – ground pin (0V)

2-digital output pin

Coded by: