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 pic microcontroller 16f877a not working

Status
Not open for further replies.

mugheesnawaz

Member level 1
Joined
May 1, 2013
Messages
39
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,605
i want to drive a 5V relay with pic microcontroller i.e when pin of controller is 5V i want to turn on relay.i am using vcc as 12V for the relay.but it isnt switching.i have used 1k resistor at base of bc 547 transistor.
attached is image of the cct Untitled.png
 
Last edited by a moderator:

hi,
If the PORT pin is pulling up to +5V, with a 1K series resistor the Base current will be ~ [5-0.7]/1000 = 4.7mA
Assuming a Gain of say 15 for the transistor in saturation, thats a Imax of #65mA.

What is the current specification of the relay coil.?

Check that the transistor pins BCE are correctly connected and RD0 is set as an Output pin
 

It seems you are simulating in Proteus. The model you are using is not an animated model. Use Relay (Active) model in Proteus and it will animate.
 

Change the power supply of relay to 5V... You are using the 12V.

Make a test, remove resistor from pin of mcu and put this into 5V...

Is missing the source code!!!

Sorry for bad english!!!
 

Although the transistor can certainly be operating in the saturation region, you should pay attention to the fact that the current gain of the family of BC547 transistors is not defined by its numerical PartNumber, but the suffix -A, -B or -C.
 

Or -16, -25, -40... Ex. BC 337-25...

But IC is +|- 500mA max current.

Its works if it is correct connected!!!

And the code is correct!!!
 

Does the pin turn high during simulation? Can the MCLR pin of the MCU be left floating in Proteus? I think mclr has to be connected to VCC.
 

Does the pin turn high during simulation? Can the MCLR pin of the MCU be left floating in Proteus? I think mclr has to be connected to VCC.
According to Microchip guidelines, the MCLR is active low and should be pulled up to VCC using a 10k resistor.
 

The most error by newbie is missing MCLR resistor!!!
 

it is working with 12v and thanks sir i gave 5v to MCRL pin and it worked but i have to give 12V to coil of 5V relay
 

Hi,

i have to give 12V to coil of 5V relay

this makes no sense.

Be sure to use common GND for 12V, transistor and microcontroller.

Klaus
 

yes it doesnt make any sense that is why i am not using transistor only anymore and using darling array and it works fine by giving 5v to 5v relay coil.
 

Hi,

either your port is not configured to drive "output high" (but pullup)
or your relay coil is drwaing too much current.


The BC547 should work well for coil currents up to 100mA or so...


Klaus
 

it works fine by giving 5v to 5v relay coil.

A voltage beyond the specified on relay coil should not necessarily burn it; Would perhaps continue for a time working overheated due to saturation of the magnetic core.

I do not have Proteus to simulate the operation of the circuit above, but I'll take a guess and suppose that the component model that you imported may have some mechanism that stimulates the error of polarization with a value above the one rated.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top