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.

how to connect relay with microcontroller?

Status
Not open for further replies.

nataraj87

Junior Member level 2
Junior Member level 2
Joined
Oct 24, 2011
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,477
how to connect relay with microcontroller?

i m going to control my robot using relay.but i dont know how to connect the relay with MC.i want to know which pin of relay wants to connect in which pin of controller.so please help me,where to connect (NO,NC,CM )these pins in microcontroller .
 

Hi Nataraj....

The relay are generally used in high power circuit....also generally realy coil have the excitation voltage of 12v so what you can do it you put a transistor like SL100 in series with coil of realy I mean collector of transistor to +12v and emitter of the transistor to relay coil and then control the base voltage using micro-controller...as generally micro-controller work on 5v and this voltage my not be sufficent to exicite the realy coil....

regards,

Milind
 
hi miland,

thanks for your reply, i am not asking about power supply to work with MC,i m asking about where to connect the microcontroller pins to relay pins,totally we have 5 pins.
1.Vcc=12v
2.gnd=0v
3.NO=?
4.NC=?
5.common=?
so what about last 3 pins,where to connect?
 

hi miland,

thanks for your reply, i am not asking about power supply to work with MC,i m asking about where to connect the microcontroller pins to relay pins,totally we have 5 pins.
1.Vcc=12v
2.gnd=0v
3.NO=?
4.NC=?
5.common=?
so what about last 3 pins,where to connect?

NO is normally open contact...connect this to whatever motor or anything you want to activate...so when the relay is energized, this contact will get shorted with "common"
NC is normally Closed contact... it means this contact will be in shorted condition when the relay is not energized..and when relay is energized this contact will become open...
Common pin of relay can be connected to external power supply...

and you cannot connect relay directly to microcontroller pin... you will need driver circuit..
 
I had attached the Cricuit diagram.....once u r micro -controller Pin voltage become 1 transistor will be on and NO will become NC and NC become NO....

with regards,

Milind
 
NC means normally closed
NO means normally opened
common is the common of the switch

All three pins are part of the same switch, when the relay is off then the common and NC are connected, when the relay switches on then the common connects to the NO pin.
In any given moment the common is either connected to the NO or to the NC , never in both.


Check the SPDT image File:Relay symbols.svg - Wikipedia, the free encyclopedia
consider C=common, B=NC and A=NO

Alex
 

Yes NO contact and commom will be open and NC and common will be closed i.e. short if realy is not energized .....you can check using multimeter....too....
 

realy_control.png

Hi Here is the circuit that I was talking about .....I hope that will help you out.....I am using transistor as a switch
 

The only problem with your circuit is that you are using an emitter follower, in simple words the output will be Vbase-0.7v so with a 5v mcu you will just get 4.3v to the relay.

Alex
 

No aleaxan_e......

I had given the 12 volt to the collector so that base will only help you to get the control of the transistor..........
 

I repeat , in a NPN emitter follower the emitter will have Vbase-0.7v , it doesn't matter what voltage you give to the collector, it can be 12 or 20 of 30v , if you give 5v to the base then the emitter will be 4.3v

Alex
 
See look at this way VCE ( Voltage between collector and emitter) will be 12 volt when there is no base voltage.....as eimmter is grounded using realy coil assuming very less leakage current.....But when the base voltage is applied what voltage you will get at eimtter is 12-VCE and when base voltage is greater than 0.7 volt will trun on the transistor thus the VCE will be approximaly 0.7 to 1.2 v based on current passing trought the emitter....thus if you measure the voltage at emitter and ground when the base volage is 5v will be 11.3 volts to 10.5v

As per my understanding.....you can check this out

with regards,

Milind
 

I understand your point Alex......thanks for clearing me there.....you are right.....
 

Do not connect the transistor for relay drive directly to the microchip.
Much better to put opto coupling P817/MCT2E to the chip..the isolated output can drive the relay coil and give protection against overshoots /switching spikes as well as act as buffer for the current drive.
 

how to connect relay with microcontroller?

i m going to control my robot using relay.but i dont know how to connect the relay with MC.i want to know which pin of relay wants to connect in which pin of controller.so please help me,where to connect (NO,NC,CM )these pins in microcontroller .

hi.. i too made a similar type of circuit of what you wanted...
but instead of using microcontroller to control the relay i am using pc printer port.
parallel port circuit.JPG
 
Last edited:

Hussainb What is the software used to draw the schematic ?
(Seen in the screen shot, I need this)
Any reference to printer port is not visible.
regards
A Raoof Khan
 

Hussainb What is the software used to draw the schematic ?
(Seen in the screen shot, I need this)
Any reference to printer port is not visible.
regards
A Raoof Khan

Its tina circuit simulator...
yes the port is not visible as i havent made it...instead, i knew that my port gives at least 3.50 volt dc output...so i just used a voltage divider in the software to provide the voltage through the switch...
 
Thanks for the prompt response.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top