Interface Relay With Arduino

Relay is a electrically operated switch.

  • Relay is used to isolate electrical load.
  • Two configuration
    • NO(normally open)]
    • NC(normally close).
  • Relay have coil which is energized by 12v, when coil energized switching action takes place.


  • BC548 is general purpose NPN bipolar junction transistor .
  • This transistor act as a driver to pull the relay ON.
  • Base is connected with micro-controller in series with resister.
  • Emitter to ground.
  • Collector to relay.

Hardware Required

  • Relay.
  • BC548 Transistor.
  • 220 Ohms Resistor
  • Arduino Uno.



 int button =12;
 int relay =11;
 void setup()
 pinMode(relay, OUTPUT);
 void loop()
 if (button == LOW)
 digitalWrite(relay, HIGH);     //Relay Turn on
 digitalWrite(relay, LOW);      //Relay Turn off