Searching \ for '[PIC] : OUTPUT PIN AND CONNECTION TO RELAY PROBLEM' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=relay
Search entire site for: ': OUTPUT PIN AND CONNECTION TO RELAY PROBLEM'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] : OUTPUT PIN AND CONNECTION TO RELAY PROBLEM'
2001\03\17@125635 by pang khong lin

picon face
Hi,

I have posted this problem before and tried the solution given but it
doesn't work. Please help me in identifying the possible source of errors.

Problem -

Basically i uses the PIC16F84 pin RB3 to control a relay ( those used in
modem ). The relay spec is as below -
The type name is V23105-3 High Sensitivity. The coil rating is as below -

Volts   5V
Ohm       125
Coil consumption   200mW

Basically when the someone calls in to the phone, the ring detector circuit
will signal the PIC through the RB0/Interrupt. Subsequently the pin RB3 will
goes high which will switch the relay. Some process will commence which at
the end, RB3 will go low to switch the relay and thus disconnect the phone
line.

The circuit works up to this stage. My problem is, RB3 does not responds to
subsequent ringing tone. Why?

I have tried connecting RB3 to an led and resistor just to check whether the
same thing happens. It does not and it works perfectly well, by responding
to the first and subsequent ring.

I have tried various means of isolating the RB3 from the relay. Someone in
the PIClist sugested using a transistor, which i did. in fact i have even
tried connecting to a buffer ic, and the last method which i tried is using
an opto-coupler. I am very sure my program is alright since it works
perfectly well when the pin is connected to a resistor.
So if it is not the software then it is the h/w. But i already isolate it,
so what's wrong?

Could it be the relay? but why the first and not the second?
I notice that when i tested using the optocoupler, it is not the relay that
is not switching, but it is the RB3 that is not generating the required
voltage level. what is preventing it from doing so??

Overdriving?

please provide some suggestions. thanks you.


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\03\17@131534 by Dan Michaels

flavicon
face
pang khong lin wrote:

>The type name is V23105-3 High Sensitivity. The coil rating is as below -
>
>Volts   5V
>Ohm       125
>Coil consumption   200mW
>

5v/125ohm = 40 mA, which is more current than a PIC pin can deliver.
So you definitely need a driver between the PIC and relay. A simple
NPN inverter with relay in the collector and 500-1000ohm resistor
from PIC to base should work.
============


>I have tried various means of isolating the RB3 from the relay. Someone in
>the PIClist sugested using a transistor, which i did. in fact i have even
>tried connecting to a buffer ic, and the last method which i tried is using
>an opto-coupler. I am very sure my program is alright since it works
>perfectly well when the pin is connected to a resistor.
>So if it is not the software then it is the h/w. But i already isolate it,
>so what's wrong?
>

To determine whether your "existing" circuit is working properly,
write a little test program that will exercise the relay on RB3,
either in a simple times loop or in response to some external event
- pull another pin hi/lo, etc.

From a larger perspective, you need to separate possible problems
with your hardware from possible problems with your software. Get
the h.w. working using simple test s.w. FIRST, and only AFTER the
h.w. is working correctly then you can integrate the more-complicated
application s.w. You will save an immense amount of time using this
approach.

- dan michaels
http://www.oricomtech.com
==================

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2001\03\17@132609 by Roman Black

flavicon
face
pang khong lin wrote:

> Basically i uses the PIC16F84 pin RB3 to control a relay ( those used in
> modem ). The relay spec is as below -
> The type name is V23105-3 High Sensitivity. The coil rating is as below -
>
> Volts   5V
> Ohm       125
> Coil consumption   200mW

This is 40mA. Too much for a PIC output pin...



{Quote hidden}

That sounds good. Software is probably ok. :o)



{Quote hidden}

You MUST use the transistor. This is not "isolating",
it is to drive the correct current. I suggest using
a high power transistor in a small package, a BC337
is rugged and cheap. A few cents.

Do you have a diode across the relay coil? This is
VERY important to reduce the back-emf spike caused
when you remove power from the coil and it's magnetic
field collapses. Also adding a 0.1uF cap across the
coil is good. Without this filtering the back-emf
spike will make the PIC reset or latch up or jump to
the wrong place in the code. All very bad.

I don't think you need the expense of a opto driver
or IC to drive the relay, as your relay type is typical
of small relays suitable for this use.

Just use a good transistor AND the diode. It might
also help you to add a 4.7ohm resistor in series
with the coil, and the diode/cap directly across
the coil. This will help decouple energy surges
from the PIC power supply.

If you have a picture of your circuit diagram people
can help you easier. :o)
-Roman

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2001\03\17@155746 by Olin Lathrop

face picon face
> Basically i uses the PIC16F84 pin RB3 to control a relay ( those used in
> modem ). The relay spec is as below -
> The type name is V23105-3 High Sensitivity. The coil rating is as below -
>
> Volts   5V
> Ohm       125
> Coil consumption   200mW

5V / 125 ohm = 40mA, which exceeds the PIC output pin rating.  A simple NPN
transistor in common emitter configuration will do fine.  You need a
resistor between the PIC output and the NPN base to limit the current.  Even
a "small" transitor will do for 40mA, so you can safely design for a gain of
50.  40mA / 50 = 800uA mininum required base current.  4.3V / 800uA = 5.4K
ohm maximum base resistor.  I would use something in the 3 to 5 Kohm range.
Any lower just wastes current with no advantage.  The transistor turn off
time will be nothing compared to the relay time.

Don't forget the flyback diode accross the relay coil.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, .....olinKILLspamspam.....embedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...