How to trigger relay?

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
divzr0
Posts: 8
Joined: Mon Nov 14, 2005 1:01 am
Location: Philadelphia
Contact:

How to trigger relay?

Post by divzr0 » Sun May 21, 2006 11:25 am

Hey guys, I have been working with microcontrollers and basic stamps lately trying to figure out how to trigger a relay. The problem obviously is that the microcontroller can only supply so much current, where as the relay needs ~70 mA.

Now I guess I need a power transistor. I have never worked with any before and I don't even know how to select one, this is where I could use some help. I'm trying to have the micrcontoller control the relay to switch 12V battery.

Can anyone provide a simple explanation or maybe point to an aritcle in NV they read about this? I have many of the issues.

Thanks for any help.

User avatar
Clyde Crashkop
Posts: 99
Joined: Fri Feb 06, 2004 1:01 am
Location: Florida
Contact:

Post by Clyde Crashkop » Sun May 21, 2006 12:00 pm

This is part of a quote from Philba that helped me a lot. “Look at logic MOSFETs. The IRL5x0 series can be driven directly from cmos logic. For example, the IRL520 is spec'd to 10A at 100V and costs less than $1. They cost a little more than the IRF series but are very easy to use.â€

jimandy
Posts: 570
Joined: Sat Dec 04, 2004 1:01 am
Location: Birmingham AL USA
Contact:

Post by jimandy » Sun May 21, 2006 4:29 pm

Clyde's suggestion is good. I'm not sure he was suggesting this, but you might use the MOSFET to directly switch the 12V and eliminate the relay altogether, depending upon your application. The latest N&V (May issue) has some good stuff about MOSFETs in the Q&A section.
"if it's not another it's one thing."

zotdoc
Posts: 177
Joined: Tue Jun 17, 2003 1:01 am
Location: Douglas, Georgia
Contact:

Post by zotdoc » Sun May 21, 2006 8:26 pm

Look up the uln2803 chip. It has 8 inputs and eight outputs which are capable of converting a logic signal to up to 500ma,enough to trigger most relays.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: How to trigger relay?

Post by philba » Sun May 21, 2006 9:28 pm

divzr0 wrote:Hey guys, I have been working with microcontrollers and basic stamps lately trying to figure out how to trigger a relay. The problem obviously is that the microcontroller can only supply so much current, where as the relay needs ~70 mA.

Now I guess I need a power transistor. I have never worked with any before and I don't even know how to select one, this is where I could use some help. I'm trying to have the micrcontoller control the relay to switch 12V battery.

Can anyone provide a simple explanation or maybe point to an aritcle in NV they read about this? I have many of the issues.

Thanks for any help.
the suggestions for mosfets will work but, for a lot less money, I would use a simple NPN transistor as a low side driver. I usually use 2n3904s but that's because I bought 100 of them a while ago. note that using a mosfet to directly control 12V will work but you don't get isolation. A relay is a cheap(ish) form of isolation.

Image

R1 should be in the 1K-2K range. R2 can be large-ish (10K and up). D1 is just about any silicon diode. Q1 can be just about any NPN transistor (2n2222, 2n3904, and so on). This will work for just about any electromagnetic relay. cost new? about 1/10th the FET. Any marginally stocked junk-box should have the parts....

The theory of how you go about selecting the transistor and R1 are pretty interesting but perhaps for another day...

edit: V+ can be anything upwards of the max rating of the transistor. for 12V, no sweat...

Enzo
Posts: 276
Joined: Tue Sep 14, 2004 1:01 am
Location: Lansing, Michigan, USA
Contact:

Post by Enzo » Thu May 25, 2006 12:20 am

Exactly. My favorite general purpose small transistor is the MPSA06. 80v, 500ma, what's not to love? They cost about 5 cents from someplace like Jameco. (you have to buy 10 at that price though) I buy them by the hundred.

And if the circuit doesn't have enough drive for the transistor, a darlington like MPSA13 will work, and those are under a dime as well.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Thu May 25, 2006 8:32 am

All the drive that circuit needs is about 3 mA. I use an Hfe of 30 (which is way low for most situations) so 3 mA Ib means 90 mA Ic (in rough numbers).

On the digital logic side, any microcontroller will be able to deliver that much current and for general logic I suggest people use 74HC stuff since it's capable of plenty of current.

Tommy volts
Posts: 149
Joined: Tue Oct 29, 2002 1:01 am
Location: Arizona
Contact:

Post by Tommy volts » Wed May 31, 2006 10:55 am

Philba,

Does the diode across the relay prevent arcing on the relay contacts and any problems associated with that?

copperclad
Posts: 24
Joined: Tue May 30, 2006 11:43 am
Location: rochester ny
Contact:

Post by copperclad » Wed May 31, 2006 11:45 am

hi
D1 is to deal with the voltage spike from the coil when its field collapses , dana :smile:

Robert Reed
Posts: 2276
Joined: Wed Nov 24, 2004 1:01 am
Location: ASHTABULA,OHIO
Contact:

Post by Robert Reed » Wed May 31, 2006 5:04 pm

Tommy,Div
Snubbing circuits are used across the contacts for arc reduction, but the values are determined by the type of load. These calculations can be a science in itself. For low current resistive loads, you wont need anything. BTW what is your load and what level of current will you be breaking?

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Post by philba » Thu Jun 01, 2006 12:34 pm

Tommy volts wrote:Philba,

Does the diode across the relay prevent arcing on the relay contacts and any problems associated with that?
while the question has been answered, I want to point out that pretty much nothing you can do at the coil will affect the contacts. I suppose if you powered the coil at the Must Operate voltge, you might get a slow closure and a bit more arc'ing but that's pretty willfully disregarding reasonable practices.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests