View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
Relay and PIC pin |
Posted: Fri Apr 21, 2006 7:34 pm |
|
|
Hi all,
I have a latching relay and there is a constant positive supply to the + side of it's coil, normally the negatice side is floating (basically not connected, I want to pull down the negative side to switch off the relay can I do this directly with a pin of a PIC that can sink tens of mA?
Because I was unsure if I could or not and being a electroins newbie I tried using a BCR148 with the MCU feeding the base and the emitter going to ground and the colloctor attached to the negative side of coil but this does not appear to work?
I know your probably laughing but any help will be great..... |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
|
Posted: Fri Apr 21, 2006 9:40 pm |
|
|
I use a ULN2003 to gnd the relay. the micro I am using is the 18F1320, it has a 25am source/sink current.
check your micro and the PDF file from microchip.
usually at the beginning. check for
Quote: | Peripheral Features:
• High current sink/source I/O pins: 25 mA/25 mA |
extracted from dsPIC30F3014/4013 pdf file (70138C.pdf)
as well the current draw of the relay startup and hold current
consider the back EMF of the relay, this could cause the micro to reset (BOP). Do the research, look at sample circuits http://www.uoguelph.ca/~antoon/circ/circuits.htm
http://www.interq.or.jp/japan/se-inoue/e_pic6.htm
some of these links may help
ANdrew _________________ What has been learnt if you make the same mistake? |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
|
Posted: Fri Apr 21, 2006 9:52 pm |
|
|
... or you can use 2N7000 MOSFET. Connect: gate to the PIC, drain to relay, source to ground |
|
|
Guest Guest
|
Thanks Kender but another question |
Posted: Sat Apr 22, 2006 3:04 am |
|
|
Thanks Kender but another question, does the 2N7000 need any other external components like a resistor etc? if not it's ideal.
Sorry for being a newbie!!! |
|
|
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
|
Re: Thanks Kender but another question |
Posted: Sat Apr 22, 2006 3:18 am |
|
|
Guest wrote: | Thanks Kender but another question, does the 2N7000 need any other external components like a resistor etc? |
Nominally, an N-channel MOSFET would work for your application without external conponents. But it would help if you add a 100k pull-down resistor from gate to ground. This will make sure that your relay is off when the PIC's pin is floating, which happens when the PIC is reset. |
|
|
Guest Guest
|
To Kender |
Posted: Sat Apr 22, 2006 5:29 am |
|
|
Thanks Kender you a star.. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sat Apr 22, 2006 6:19 am |
|
|
Make sure that you check the specification on how long to pulse the relay. There is a minimum pulse duration as well as a maximum. |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Sun Apr 23, 2006 7:10 pm |
|
|
You really need a snubber or catch diode on the relay coil for any transistor circuit. The ULN2003 has this catch diode built in. Put a 1N4000 or simillar diode in parallel with the relay coil with the cathode to the plus supply.
The reason is because when you try to shut off the transistor (either bipolar or FET) the coil with produce an "inductive kick" that may be high enough to damage the transistor. The diode shorts the kick out. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
|