Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Relay Interfacing with 8051 Controller

Status
Not open for further replies.

Adil Israr

Full Member level 1
Full Member level 1
Joined
Sep 5, 2008
Messages
97
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Activity points
1,918
microcontroller relay circuit

Hello friends,
I have problem interfacing 8051 controller with relay. I am using 12V relay to ON/OFF. The output port of the controller is set at logic zero, it gives 5V when it isnot active.
But when inputs are applied it works according to the requirement but it gives 2V, when it is active.
So if the relay is active it doesnot gets deactived at this point.
i have attached the relay circuit.
Plz help me, I need help soon.

6_1245513309.jpg


1K resistor is there between output port and base of the transistor.
 

relay interfacing

Dude just add 10K pull up resistor at the port pin.
its simple
 

relay circuit for avr

Like this:

86_1245521291.jpg


But the problem is I couldnot get less than 2V when microcontroller is active(that is when inputs are applied). I am using AT89S51.
It's output is working on logic zero.
I want to get less than 1V to properly operate the relay.
 

requirement of pullup resistor in 8051 ports

Adil Israr said:
But the problem is I couldnot get less than 2V when microcontroller is active(that is when inputs are applied). I am using AT89S51.
It's output is working on logic zero.
I want to get less than 1V to properly operate the relay.
try a 4.7K resistor instead of the 1K resistor you are using. (between the pullup and the base on the transistor)

I use the same with an 89C52 and it works reliably.
 

8051 relay

Everything is right whta you people said but my relay doesn't get deactivated, it activates all right but doesn't deactivate because of 2V.
My AT89S51 gives maximum voltage of 5V when inputs are not applied, but it gives minimum of 2V when inputs are applied, I want to get less than 1V.
How can I do this??
 

relay tansistor interfacing

post your code.

I see the circuit looks fine. Maybe you have a bad transistor, or one of the pins on your 89S51 is blown. Switch to another pin and change the code.
 

74hc less than 1v

Your circuit use active low.. you should use PNP transistor.. or change your circuit.

in your circuit, the pin goes high on power on. it's activate the relay directly.
 

how to connect relay with 8051?

Actually my controller also works on active low, if I cahange the coding and make it active high. Will it work fine??
 

microcontroller interfacing relay code

Dude i thaught i solved your problem i forgot to check my mail
ok you could change your software code and try
actually i had same problem then when i added 10K pull up it worked fine
1K current limitter is fine may be you should check your transistor also see that emitter of transistor is grounded.
 

code of relay interface with microcontroller

Hi
Its a very very bad practice to connect a relay with a microcontroller like this. the relay revers voltage will directly afect the microcintroller. here ic is comparitively high thus need more ib too. Use ULN type driver. or atleast use a 2 stage transistor amplifier. Or you can also use Open Collector Inverter or buffer. Or use a 74HC series buffer/inverter/latch and then use a single transistor drive for rlay.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top