Interfacing of Relay Buzzer Optoisolator

Interfacing of Relay Buzzer Optoisolator



Relay


Draw and explain interfacing of Relay-Buzzer with 8051 microcontroller,Also write an ALP to interface it to pin P3.5 and buzzer should get on when relay is ON.

Interfacing Diagram
Interfacing of Relay-Buzzer with 8051 microcontroller


Assembly Language Program for Interfacing

ORG 00H
MOV P3,#00H;Configure PORT3 as output
again:setb P3.5 ;relay ON,Buzzer ON
Acall Delay
clr P3.5;relay Off,Buzzer off
Acall Delay
sjmp again
Delay:Mov R3,#08H
Up2:Mov R2,#0FFH
Up1:Mov R1,#0FFHH
Here:​​​​​​DJNZ R1,Here
DJNZ R2,Up1
​​​​​​DJNZ R3,Up2
RET
end

Buzzer


Draw and explain interfacing of Buzzer with 8051 microcontroller,Also write an ALP to interface it to pin P2.0 and buzzer should get on when P2.0 is High.

Interfacing Diagram
Interfacing of Buzzer with 8051 microcontroller


Assembly Language Program for Interfacing

ORG 00H
MOV P3,#00H;Configure PORT3 as output
again:setb P2.0 ;transistor ON,Buzzer ON
Acall Delay
clr P2.0; transistor Off,Buzzer off
Acall Delay
sjmp again
Delay:Mov R3,#08H
Up2:Mov R2,#0FFH
Up1:Mov R1,#0FFHH
Here:​​​​​​DJNZ R1,Here
DJNZ R2,Up1
​​​​​​DJNZ R3,Up2
RET
end


Optoisolators


Introduction to Optoisolators

In electronics, an opto-isolator, also called an optocoupler, photocoupler, or optical isolator, is a component that transfers electrical signals between two isolated circuits by using light. Opto-isolators prevent high voltages from affecting the system receiving the signal.Commercially available opto-isolators withstand input-to-output voltages up to 10 kV and voltage transients with speeds up to 10 kV/μs.

Opto-isolator pinout


A common type of opto-isolator consists of an LED and a phototransistor in the same opaque package. Other types of source-sensor combinations include LED-photodiode, LED-LASCR, and lamp-photoresistor pairs. Usually opto-isolators transfer digital (on-off) signals, but some techniques allow them to be used with analog signals.

Algorithm for Interfacing

Interfacing Diagram

Opto-isolator interfacing



(A buzzer is connected between one terminal of optoisolator and Vcc. Buzzer is not showing on some browsers.)
Interfacing Opto-isolator with 8051 Microcontroller

Assembly Language Program for Interfacing

ORG 00H
MOV P2,#00H;Configure PORT3 as output
again:setb P2.0 ;LED ON, TRANSISTOR ON, LAMP ON
Acall Delay
clr P2.0; LED OFF, TRANSISTOR OFF, LAMP OFF
Acall Delay
sjmp again
Delay:Mov R3,#08H
Up2:Mov R2,#0FFH
Up1:Mov R1,#0FFHH
Here:​​​​​​DJNZ R1,Here
DJNZ R2,Up1
​​​​​​DJNZ R3,Up2
RET
end

References


  • Created and edited by Prof. S.M.Wagh, SKNCOE,Pune
  • WikiNote Foundation

Last modified: Monday, 16 September 2019, 3:57 PM