Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

driving a relay

Status
Not open for further replies.

homemade24

New Member
I need to order some relays just making sure this is what I need

use a Pic micro with a 5 volt power supply:
I believe each pin can handle 20 ma.
so if I drive a 5v. relay direct it has to have at least a 250 ohm coil.

is 250 ohm what is normally used

thanks
 
Most relays except the very smallest will need a transistor to boost the current from a PIC output pin. You'll also need a diode clamp on the relay coil.
 
I usually use an NPN Bipolar transistor to do the relay switching, mainly because my relays are 12v coil rated, but it also keeps everything nice and seperated.

A Solid state relay would be ideal for mains power applications, but can be expensive unless you can find a decently priced one!

Either way, as Bill said dont forget the clamp diode across the coil terminals!

The main thing I tend to see is people pushing the contact ratings to the limits and sometimes beyond!

Wilksey
 
thanks
I been using this one from radio shack Compact 5VDC/1A SPST Reed Relay - RadioShack.com
and yes i add a diode. with no problem.( do I or did I need to drive it with a transistor ) but it seam like radio shack is getting out of the parts business. I've got to place a order with digikey and though I mite find something better and cheaper .
 
Last edited:
If you know the coil resistance it's easy to calculate if you need a transistor. If it's too low (say 125Ω) then you can use two pins to provide 40mA. Make sure you connect between the pins and 5V as the pins can sink more than source.

I did look at the "technical spec" on ratshacks web site but it didn't contain trivial information like the coil resistance. :rolleyes:

Mike.
 
The 100R series resistor is only required if the supply voltage is too high for the coil. The schematic also lacks the all-important back EMF protection diode.

Here's how it should be done:
**broken link removed**
 
thanks guys I have done what you have posted on heavier loads (relays)
pommie and others the coil on the ratshack is 250 ohms 250/5 = .02
is it not ok to drive this relay direct ?
bottom line is I need a relay than can carry a 1 amp 12 volt load and because of board space it would be very helpful if I could drive it direct.
and if you know of one that Digikey sales that would be great
thank you for your help and thank you for the forum
 
If it only draws 20mA then you are good to go. However, expect it to switch slowly as the pics don't get to zero volts when at rated current.

Mike.
 
thanks yes they do work fine with just the diode
sorry but because the local ratshack is bad about not having them I was on my next order to digikey going to order something that would be a drop-in replacement and was just hoping to get some advice on that
sorry again If I did not make that part clear
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top