fbpx

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

  • 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.

Circuit

Code

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

Leave a Reply

Your email address will not be published. Required fields are marked *