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.

[SOLVED] Relay Problem using pic microcontroller

Status
Not open for further replies.

nick703

Advanced Member level 1
Joined
Oct 17, 2011
Messages
422
Helped
21
Reputation
44
Reaction score
22
Trophy points
1,298
Location
surat
Activity points
3,987
hello friends i have a leone relay 12VDC . and i want to operate using micro controller . i used one transistor BC547 and one diode 1N4007 . my signal is coming from micro controller voltage 3 V so when i connect this voltage direct to the bc547 base lag relay does not operate. what is the problem i try all way putting resistor between micro controller pin and base but does not operate relay . what is the problem . my relay is ok.

and also how to using TIP122 to operate relay ???
 

Relay coil reistance will be 150E to 300E and current will be not more than 40 mA. BC547B is enough to drive the Relay. Isyour MCU pin controlling the Transistor base configured as output pin? Which PIC are you using? Post your circuit and code.
 
ok and how to connect TIP 122 or TIP 127 to relay ??
 

BC547 is 100mA current colector... Its depend of the relay too...
works fine for me... Nick, post schematic...
This is my sch...
**broken link removed**
 
Last edited:
thanks for answer nag in your circuit diagram i have remove 47k resistor and use bc547 and 1n4007 diode and r1 resistor is 470 ohm my pic voltage is 3.0 v for high pulse and 0.0 v for low pulse this is my circuit . anyway any idea about TIP122 OR 127 to operate relay circuit diagram ....
 

Wich model of relay... See datasheet... Try another transistor with same connection... Like the Tip... See datasheet of transistor... Try the sch like img... Without the mcu....too
Change the 470 by 1K... Calculate the correct base resistor.
 
Last edited:

Actually the BC547 is enough to drive the relay. It simply grounds the relay pin to provide a closed circuit. I will always use the bc547 to switch the relays


hello friends i have a leone relay 12VDC . and i want to operate using micro controller . i used one transistor BC547 and one diode 1N4007 . my signal is coming from micro controller voltage 3 V so when i connect this voltage direct to the bc547 base lag relay does not operate. what is the problem i try all way putting resistor between micro controller pin and base but does not operate relay . what is the problem . my relay is ok.

and also how to using TIP122 to operate relay ???
 
Hi nick703. I've seen your circuit, but don't understand why you use R2 from base to ground?. When you power up your pic the pins are configured as inputs, so present hi-impedance, so the transistor won't saturate and the relay won't work. In some place in your firmware you must set the pin as output and drive a 1 to activate relay, or 0 otherwise. To determine base resistor you could employ the formula Rb=(VHpic-Vbesat)/Ib where Rb is R1, VHpic is the voltage on pin when driving an 1, Vbesat is base-emitter saturation voltage (see datasheet of BC547) and Ib is the base current for BC547. To determine Ib you must know Ic, the collector's current and this parameter depends on your relay. I hope this could help you. Yosmany325
 
hello friends i have a leone relay 12VDC . and i want to operate using micro controller . i used one transistor BC547 and one diode 1N4007 . my signal is coming from micro controller voltage 3 V so when i connect this voltage direct to the bc547 base lag relay does not operate. what is the problem i try all way putting resistor between micro controller pin and base but does not operate relay . what is the problem . my relay is ok.

and also how to using TIP122 to operate relay ???

1. Which controller pin u use for Relay on-off ?.

2. First check is pin toggle (delay kept @ 500ms to see LED blinking) okay by connecting LED (Replace Relay only all other same) instead of Relay if it
work then it may issue of Relay, Supply current capability.
 
Hi nick703. I've seen your circuit, but don't understand why you use R2 from base to ground?. When you power up your pic the pins are configured as inputs, so present hi-impedance, so the transistor won't saturate and the relay won't work. In some place in your firmware you must set the pin as output and drive a 1 to activate relay, or 0 otherwise. To determine base resistor you could employ the formula Rb=(VHpic-Vbesat)/Ib where Rb is R1, VHpic is the voltage on pin when driving an 1, Vbesat is base-emitter saturation voltage (see datasheet of BC547) and Ib is the base current for BC547. To determine Ib you must know Ic, the collector's current and this parameter depends on your relay. I hope this could help you. Yosmany325
hey yosmany325 i didn't post any circuit diagram bro ...

and nagkiller i used leone relay . and also i connected pic to control relay successfully .

and Golden Electronics thanks for your reply but my relay is okay first time i also have doubt to change relay but then after checking all capability of my diagram and i solved .

by the way thanks for all of u !!!!
 

Actually i have micro controller pin connect to the opto coupler Ic pc817 and then this signal fed to the bc547 transistor base terminal and it work like charm ... and also i have put base resistor 470ohm . so instead of using direct signal of mcu i used opto coupler for relay and other task ..
 

U mean to say that adding PC817 solved ur problem.But I used many circuit in which i directly connect controller output to BC547 & operate relay & never see any issue. If u require isolation then only PC817 addition is good.
 

no bro i didn't mean to need of PC817 but i have a already that type of circuit and i used relay in pc817 pin . so there is no need of pc817 .
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top