Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
Microcontroller 8051 and its interfacing
Next

11

Share

Interfacing relay with 8051

Interfacing relay with 8051

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Interfacing relay with 8051

  1. 1. Interfacing Relay with 8051 Microcontroller www.pantechsolutions.net
  2. 2. RELAY INTERFACE WITH 8051
  3. 3. <ul><li>A relays is an electrical switch that opens and closes under control of another electrical circuit. </li></ul><ul><li>It is therefore connected to ouput pins of the microcontroller and used to turn on/off high-power devices such as motors, transformers, heaters, bulbs, antenna systems etc </li></ul><ul><li>Relay is connected to port 1.0 </li></ul>WHAT IS RELAY?
  4. 4. <ul><li>org 00h </li></ul><ul><li>back: mov a,#00h </li></ul><ul><li>mov P1,a </li></ul><ul><li>acall secdelay </li></ul><ul><li>mov a,#01h </li></ul><ul><li>mov P1,a </li></ul><ul><li>acall secdelay </li></ul><ul><li>Sjmp back </li></ul><ul><li>Secdelay: mov r5,#25 </li></ul><ul><li>H3: mov r4,#55 </li></ul><ul><li>H2: mov r3,#ff </li></ul><ul><li>Djnz r3,h1 </li></ul><ul><li>Djnz r4,h4 </li></ul><ul><li>Djnz r5,h5ret </li></ul>RELAY INTERFACING ASSEMBLY CODE
  5. 5. <ul><li>#include <reg51.h> </li></ul><ul><li>#include<stdio.h> </li></ul><ul><li>sbit relay1 = P0^4; </li></ul><ul><li>void DelayMs(unsigned int); </li></ul><ul><li>void main (void) </li></ul><ul><li>{ </li></ul><ul><li>P2 = 0; </li></ul><ul><li>while(1) </li></ul><ul><li>{ </li></ul><ul><li>relay1 = 1; </li></ul><ul><li>DelayMs(200); </li></ul><ul><li>relay1 = 0; </li></ul><ul><li>DelayMs(200); </li></ul><ul><li>} </li></ul><ul><li>} void DelayMs(unsigned int n) </li></ul><ul><li>{ </li></ul><ul><li>unsigned int i,j; </li></ul><ul><li>for(j=0;j<n;j++) </li></ul><ul><li>{ </li></ul><ul><li>for(i=0;i<1000;i++); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>RELAY INTERFACE C CODE
  6. 6. For More Tutorials <ul><ul><li>www.pantechsolutions.net </li></ul></ul><ul><ul><li>http://www.slideshare.net/pantechsolutions </li></ul></ul><ul><ul><li>http://www.scribd.com/pantechsolutions </li></ul></ul><ul><ul><li>http://www.youtube.com/pantechsolutions </li></ul></ul>
  • OM7Vlogs

    Jun. 5, 2021
  • nikhil83

    Oct. 16, 2020
  • VikashKumar1820

    Mar. 5, 2020
  • akashwadhai

    Nov. 28, 2018
  • Sathisklpt

    Aug. 20, 2017
  • tinuannevarghese

    May. 8, 2017
  • isetlab

    Jul. 19, 2015
  • pachiyappanpmut

    Jun. 28, 2013
  • kanchanavijju

    Dec. 4, 2012
  • devdevadev

    May. 31, 2012
  • dinesh9104

    Oct. 2, 2011

Interfacing relay with 8051

Views

Total views

14,875

On Slideshare

0

From embeds

0

Number of embeds

195

Actions

Downloads

0

Shares

0

Comments

0

Likes

11

×