fbpx

Interface Relay with 8051

Relay is a electrically operated switch.

  • Relay is used to isolate electrical load.
  • Relay can operate in two state
    • NO(normally open)
    • NC(normally close).

Relay have coil which is energize by 12v ,when coil energized switching action takes place.

BC548 Transistor

  • BC548 is general purpose NPN bipolar junction transistor .
  • This transistor act as a driver to pulls 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
  • 8051 MicroController.

Circuit

Virtual Circuit

Code

#include<REGx51.h> 
 void delay()
 {
  int i,j;
  for(i=0;i<1000;i++)
  {
   for(j=0;j<100;j++);
  }
 }
 void main()
 {
  P1_0=1;
  delay();
  P1_0=0;
  delay();
 }

Leave a Reply

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