PDA

View Full Version : Issues with my circuit design.


Jemson
09-01-2011, 11:38 AM
Hi all,
I must point out that I am quite new to electronic design.
I have designed my first circuit with the help of a friend (who is now overseas), and I am having some issues.

It is a very small circuit for a micro controller to drive a relay for turning on/off an a fan in my computer room. The circuit works, but the transistors keeps burning out on the board. Once I replace it, it is ok for a short while then dies again. I am not sure if I got a dodgy batch of transistors or there is a problem with my circuit... If there is a problem in the circuit I am thinking it may be with the placement of D1, or R1 is not big enough but in reality, I am stumped!

I have attached a small design i sketched up in paint, i am still learning my way around LTspliceIV and this is all I could whip up in the short term.
I should also point out the ground is common between the 5v and 12v sources!

Any help you can offer would be greatly appreciated. I will be only too happy to answer any questions you may have if additional info is required!

strantor
09-01-2011, 12:41 PM
What's the actual part# for D1? 1N4001? 1N4002? 1N4003? It should be 1N4004 or better. otherwise that may be your problem.

Jemson
09-01-2011, 12:50 PM
Sorry, typo. Yes it's a 1N4004!

strantor
09-01-2011, 01:14 PM
well then in that case I'm out of ideas. Transistor & diode seems up to par. the way you've drawn it, seems it should work from what I see. Maybe check to make sure its actually wired the way you drew it (obligatory dummy check :)).

Jemson
09-01-2011, 01:33 PM
Yeah definitely checked and rechecked that.
The circuit actually works (for a while) then the transistor seems to die and I am stumped as to why... Replacing it fixes it for a while, before the next one goes :/

strantor
09-01-2011, 01:44 PM
you could alway try a different type of transistor. maybe the ones you have (or wherever you are getting them) are from a bad batch. I usually use TIP120 darlingtons for this application. you can get them at radioshack.

praondevou
09-01-2011, 01:49 PM
As far as I remember, 1N400x are general purpose rectifiers, reverse recovery time could be too long, so the transistor would die from overvoltage, when the relay turns off.
You could replace it with the UF4004 or a schottky diode.

Or use a transistor with a higher collector-emitter breakdown voltage.

strantor
09-01-2011, 01:53 PM
As far as I remember, 1N400x are general purpose rectifiers, reverse recovery time could be too long, so the transistor would die from overvoltage, when the relay turns off.
You could replace it with the UF4004 or a schottky diode.

Or use a transistor with a higher collector-emitter breakdown voltage.
That's an attribute I never thought of. I usually just look at the max peak voltage when choosing one. (actually I never do any choosing, I just go straight to 1n4004) I have used 1n4004s all the time for this application (but never with this transistor) and never had a problem. I guess I should pay more attention to the whole picture.

praondevou
09-01-2011, 02:12 PM
That's an attribute I never thought of. I usually just look at the max peak voltage when choosing one. (actually I never do any choosing, I just go straight to 1n4004) I have used 1n4004s all the time for this application (but never with this transistor) and never had a problem. I guess I should pay more attention to the whole picture.

I'm not saying, this IS the problem, but the transistor dies either of overcurrent or overvoltage. Overcurrent is not likely, since it has 100mA continuous max. rating. To be sure if it's the turn-off voltage spike of the relay, one would have to measure it with an oscilloscope. The 549 has 45V, actually quite distant from 12V, but you never know..:)

I remember that I used once the 1N4001 for the secondary flyback converter diodes, it didn't work at all, I had to change them to the UF type.

Audioguru
09-01-2011, 03:04 PM
A 1N914 or 1N4148 is a fast ordinary little diode rated for 75V and 300mA.

SgtWookie
09-01-2011, 04:23 PM
The reverse recovery time of the 1N4004 really shouldn't be an issue, as it only conducts when the transistor shuts off. The diode should turn on pretty quickly.

praondevou
09-01-2011, 04:38 PM
The reverse recovery time of the 1N4004 really shouldn't be an issue, as it only conducts when the transistor shuts off. The diode should turn on pretty quickly.

Sgt, I was thinking, if the diode doesn't change it's state from non-conducting to conducting fast enough, the voltage on the transistors collector could rise over it's breakdown voltage at relay turn-off and damage it even if it's only for a few ns/us.
(I know reverse recovery time is actually defined as the other way around, from forward to reverse. I think I meant the diodes turn-on time)

EDIT: Yes, I guess you are right, just read about it, turn-on time is extremely short, probably not enough to allow the voltage to rise too much.

praondevou
09-01-2011, 04:56 PM
Well I just found this on google books... Now I'm not so sure anymore.
See attached picture... Looks like the turn-on time for the 1n4004 can vary quite a bit.

SgtWookie
09-01-2011, 05:36 PM
Well, if it were slow to turn on, that would definitely do it.

Could replace the diode, or add a 220pF to 470pF cap across the coil terminals to "buy time" for the diode to turn on. Another possibility is to slow the turn-off time for the transistor.

1N4148/1N914 diodes have extremely short recovery times; < 4nS. I don't remember if the turn-on times are measurable; but I haven't seen a spec for them.

Audioguru
09-01-2011, 05:40 PM
Like I said, use a 1N914 or 1N4148 fast ordinary signal diode, not a slow 50Hz rectifier.

paulktreg
09-01-2011, 08:53 PM
I agree that a 1N4148 is the better choice and perhaps a resistor from the base of the transistor to GND, a 1K perhaps? You only need >0.6V or so and the maximum E-B voltage is 5V for the BC549. May help?

praondevou
09-01-2011, 09:11 PM
Is there any way to estimate the forward current through the diode? I don't think so without having the relays characteristics...

The 1N914 and 1N4148 diodes have both a much smaller peak forward current rating than the 1N4004. If I had to choose between the two I'd prefer the 1N914 because it can handle more peak current.
If for any reason they can't handle the current, use the UF4004 or another more powerful diode.

Audioguru
09-02-2011, 01:21 AM
The peak current in the diode is the relay coil operating current (only 30mA).

praondevou
09-02-2011, 01:54 AM
The peak current in the diode is the relay coil operating current (only 30mA).

Do you mean because the coil resistance would limit the current? :confused:
Yes, but isn't 30mA for 12V (in this case)? The inductance is generating a much higher voltage, wouldn't that increase the current spike too if the coil is clamped with a diode? I think I will have to test this one if I find the time...

Edit: simulation software confirms what you are saying... I guess you are right then

Audioguru
09-02-2011, 04:38 AM
The diode keeps the current flowing (into the power supply) so that the inductance can discharge slowly.
Without the diode then the inductance creates a rapidly reducing discharge current. The rapid change of current causes the inductance to try to generate a voltage high enough to keep the discharging current flowing slowly. The high voltage is created when the rapid change in the magnetic force cuts across the windings of the coil making a generator.

strantor
09-02-2011, 10:40 AM
The diode keeps the current flowing (into the power supply) so that the inductance can discharge slowly.
Without the diode then the inductance creates a rapidly reducing discharge current. The rapid change of current causes the inductance to try to generate a voltage high enough to keep the discharging current flowing slowly. The high voltage is created when the rapid change in the magnetic force cuts across the windings of the coil making a generator.

That's different than what I learned. I read that the purpose of a flyback diode (in addition to preventing arcing across switch and relay contacts) is to prevent negative potential getting back to the power supply. I agree that the coil becomes a generator, but it generates an opposing voltage to that which was applied to it previously, which forward biases the diode, basically shorting out this new generator in the circuit and discharging it's stored energy very rapidly.

praondevou
09-02-2011, 12:12 PM
That's different than what I learned. I read that the purpose of a flyback diode (in addition to preventing arcing across switch and relay contacts) is to prevent negative potential getting back to the power supply. I agree that the coil becomes a generator, but it generates an opposing voltage to that which was applied to it previously, which forward biases the diode, basically shorting out this new generator in the circuit and discharging it's stored energy very rapidly.

The basics are clear for everyone (a voltage spike is generated) but when it gets into the details or you put everything in another context, things become confusing sometimes. I got confused myself.
First, the purpose of the flyback diode on the coil of a relay is to protect the open switch, in this case the bc549 transistor from overvoltage. In the case described here, when the transistor opens, the negative pole of the inductor is clamped to the positive of the power supply and the positive pole is on the collector of the transistor. This is why the voltage on the collector rises (because it's open).

I don't think a power supply would care too much about a short negative or positive pulse coming back from anywhere. This is how in a Mosfet fullbridge with the Fets having bodydiodes, energy is transfered back to the DC-Capacitors, even though it's not a negative spike...

I was confused about the current in the diode. As Audioguru explained it never goes above the current that was flowing in the relay before turning it off.
However, with diode it takes MORE time for the magnetic field to collapse then without it.

THIS (http://www.energeticforum.com/renewable-energy/3806-back-emf-vs-collapsing-magnetic-field-spike.html) guy explains the whole voltage spike/back EMF issue quite well. I also found the two following pdfs that are worth reading and where you can learn that a simple diode isn't always the best choice to suppress the voltage spike.

http://relays.te.com/appnotes/app_pdfs/13c3311.pdf
http://relays.te.com/appnotes/app_pdfs/13c3264.pdf

Audioguru
09-02-2011, 12:32 PM
That's different than what I learned. I read that the purpose of a flyback diode (in addition to preventing arcing across switch and relay contacts) is to prevent negative potential getting back to the power supply. I agree that the coil becomes a generator, but it generates an opposing voltage to that which was applied to it previously, which forward biases the diode, basically shorting out this new generator in the circuit and discharging it's stored energy very rapidly.
In this circuit, the voltage spike is positive not negative. Since it is positive then the diode clamps it because it becomes forward-biased then puts the inductor's current into the power supply.

strantor
09-02-2011, 01:51 PM
The basics are clear for everyone (a voltage spike is generated) but when it gets into the details or you put everything in another context, things become confusing sometimes. I got confused myself.
First, the purpose of the flyback diode on the coil of a relay is to protect the open switch, in this case the bc549 transistor from overvoltage. In the case described here, when the transistor opens, the negative pole of the inductor is clamped to the positive of the power supply and the positive pole is on the collector of the transistor. This is why the voltage on the collector rises (because it's open).

I don't think a power supply would care too much about a short negative or positive pulse coming back from anywhere. This is how in a Mosfet fullbridge with the Fets having bodydiodes, energy is transfered back to the DC-Capacitors, even though it's not a negative spike...

I was confused about the current in the diode. As Audioguru explained it never goes above the current that was flowing in the relay before turning it off.
However, with diode it takes MORE time for the magnetic field to collapse then without it.

THIS (http://www.energeticforum.com/renewable-energy/3806-back-emf-vs-collapsing-magnetic-field-spike.html) guy explains the whole voltage spike/back EMF issue quite well. I also found the two following pdfs that are worth reading and where you can learn that a simple diode isn't always the best choice to suppress the voltage spike.

http://relays.te.com/appnotes/app_pdfs/13c3311.pdf
http://relays.te.com/appnotes/app_pdfs/13c3264.pdf (http://relays.te.com/appnotes/app_pdfs/13c3264.pdf)


yes the graph in your last reference confirms AG's statement about the current never going higher than coil current. I less confused about the current in the diode and was more confused about the function of it.

The link to the discussion about inductive spike vs. back EMF was enlightening. Apparently whoever wrote the wikipedia article on flyback diodes is still using the back EMF term.

In this circuit, the voltage spike is positive not negative. Since it is positive then the diode clamps it because it becomes forward-biased then puts the inductor's current into the power supply.
Ok, so are you saying that after the transistor opens, the voltage on the collector of the transistor (coming from the inductive spike) is positive with respect to the emitter (ground)? If so, I agree, I just have been led to believe that the positive voltage at that point does not go back to the power supply, rather it just goes back to the other side of the inductor and that's all.

see this excerpt from wikipedia (http://en.wikipedia.org/wiki/Flyback_diode):


A flyback diode solves this starvation-arc problem by allowing the inductor to draw current from itself (thus, "flyback") in a continuous loop until the energy is dissipated through loses in the wire and across the diode (Figure 3). When the switch is closed the diode is reverse biased against the power supply and doesn't exist in the circuit for practical purposes. However, when the switch is opened, the diode becomes forward biased relative to the inductor (instead of the power supply as before), allowing it to conduct current in a circular loop from the positive potential at the bottom of the inductor to the negative potential at the top (assuming the power supply was supplying positive voltage at the top of the inductor prior to the switch being opened). The voltage across the inductor will merely be a function of the forward voltage drop of the flyback diode, and the distance between the diode and the inductor (according to National Instruments, the flyback diode should be no greater than 18 inches from the inductor). Total time for dissipation can vary, but it will usually last for a few milliseconds.

SgtWookie
09-02-2011, 09:28 PM
Actually, the collapsing magnetic field around the coil keeps the current flowing through the inductor, and the diode provides a path for that current. If there is no path for the current, and the transistor turn-off time is very short, the current will make a path for itself through whatever is available. This usually has a destructive effect on wherever the path leads if the part is not designed for it.

If you want the current flow from the coil to stop a lot more rapidly, you could use a resistor in series with the diode. Subtract the Vf of the diode from the supply voltage, and divide that result by the coil current when it's energized to get the appropriate resistance.

Arius007
09-02-2011, 10:19 PM
Here's my 2 cents worth.

During switch-off the coil becomes the source.
Assume for a moment that the diode has some delay before reacting to the transient spike and conducting. During this period, the path for the current is via the transistor and through the 12vdc supply, only limited by whatever resistance it encounters on this path. I'm going to suggest that the circuit design has done nothing to limit the current through the transistor during this time and that by inserting a suitable resistor between the transistor and relay coil, it would have no adverse effect on the normal operation, but would serve to limit the current as a result of the spike.

praondevou
09-02-2011, 10:24 PM
This thread has become so loooong that the OP will have a hard time to find the necessary information.:p

@Jemson .. In short: First try to use a faster diode like the ones AG and SGT suggested, 1N914 or 1N4148.

Jemson
09-04-2011, 12:42 AM
Hi All,

Thanks for all the replies! I did not expect to get so many so quickly!
I understand what you are saying about the 1N4004 being to slow, and am happy to get some 1N914 or 1N4148, the only question I have around them is; Is the peak voltage (75V) going to be high enough? The 1N4004 was obviously 400V, so I just would like to clarify if possible.

Thanks again to all for your help, I really appreciate it.

R!f@@
09-04-2011, 12:55 AM
Well !! I'll be a monkey's uncle. Pish posh
Heck ....It should work fine.
OP should measure the current via the relay after applying 12V to confirm that it does not go above the Tr Ic ratings.
I bet he got the specs wrong.

And if not, why not use a BC639 instead, this has always worked for me. and a 1N4007 diode never fails to protect a transistor u know. Atleast I never had any trouble using the said components

praondevou
09-04-2011, 01:05 AM
Is the peak voltage (75V) going to be high enough?

Yes, voltage rating has to be higher than the power supply voltage.

Audioguru
09-04-2011, 02:07 AM
Your supply voltage is only 12V. The voltage rating of the diode must be a little more than 12V.
The voltage rating of a 1N914 or 1N4148 is 75V or 100V which is plenty.

Jemson
09-05-2011, 03:25 AM
For some reason I thought the voltage created by the relay when the field collapsed could have been substantially higher than the input voltage, but maybe I've confused myself somewhere along the way, and its the current that can spike substantially higher than the input current?

Anyway, I will get some 1N4148s as suggested and start there to see it it fixes the issue.
Thanks again.

strantor
09-05-2011, 03:44 AM
For some reason I thought the voltage created by the relay when the field collapsed could have been substantially higher than the input voltage, but maybe I've confused myself somewhere along the way, and its the current that can spike substantially higher than the input current?

Anyway, I will get some 1N4148s as suggested and start there to see it it fixes the issue.
Thanks again.

The reason the voltage goes really high without the diode is because the inductor (relay coil) attempts to keep the current constant. when the transistor opens, the resistance goes way up, into the megohms (i think). according to ohms law, if the resistance goes way up, the voltage must also go way up in order to keep the current the same. When you put the diode in there, current has a new low resistance path and so the voltage does not spike.

Jemson
09-05-2011, 03:47 AM
The reason the voltage goes really high without the diode is because the inductor (relay coil) attempts to keep the current constant. when the transistor opens, the resistance goes way up, into the megohms (i think). according to ohms law, if the resistance goes way up, the voltage must also go way up in order to keep the current the same. When you put the diode in there, current has a new low resistance path and so the voltage does not spike.

Gotcha! So the high spike only exists without the diode, which is where I probably got confused. Thanks for clearing that up!

SgtWookie
09-05-2011, 04:55 AM
IF the diode is not present (or turns on very slowly), the reverse voltage caused by the field collapse can be very high.

The diode provides a current path so that the reverse voltage doesn't exceed the Vf of the diode, once the diode starts conducting.

Pencil
09-05-2011, 05:46 AM
The circuit works, but the transistors keeps burning out on the board. Once I replace it, it is ok for a short while then dies again


What is "a short while"?

Can you give part number of relay?

Does the relay have the "protection diode" included internally?

If it is of the type that includes this diode, and the coil was hooked up
with wrong polarity, this would fry the transistor, basically shorting
+12v to ground when transistor turned on.


Another thought, check the Vol (LOW level voltage a.k.a voltage when off)
of the uC output pin. The Vol may be high enough to keep transistor turned
partially on when it should be off. This condition should be alleviated with the addition
of a "pulldown resistor" (probably 10k should do it) from base of transistor to ground.

Just a guess.

Jemson
09-05-2011, 06:51 AM
What is "a short while"?

Can you give part number of relay?

Does the relay have the "protection diode" included internally?

If it is of the type that includes this diode, and the coil was hooked up
with wrong polarity, this would fry the transistor, basically shorting
+12v to ground when transistor turned on.


Another thought, check the Vol (LOW level voltage a.k.a voltage when off)
of the uC output pin. The Vol may be high enough to keep transistor turned
partially on when it should be off. This condition should be alleviated with the addition
of a "pulldown resistor" (probably 10k should do it) from base of transistor to ground.

Just a guess.

Relay is an FRS6-1.

"A short while" can vary. It might be a day or a week, I don't notice it instantly as it is just turning on/off a fan.

I'm not sure about an internal protection diode, but I don't think so, Ican't see anything on the spec sheet anyway.

The Voltage on the uC is 0v in the off state.
When the uC pin is in the off state the relay is not engaged, so I think this may rule out the second theory you have?

I have put the new resistor in and will monitor over the week and see how it goes. If it does fail, I can probably check the voltages etc on each side of the diode, relay etc and advise.

Audioguru
09-05-2011, 03:56 PM
Try it.
Hold the relay coil terminals in one hand (not two hands because you don't want the voltage spike to go through your heart) and connect the battery. When the battery is disconnected then you will feel a few hundred volts in your hand.

eceblr2011
09-05-2011, 06:03 PM
I think you can try out using a base resistor value of more than 1.2K ohm to some where between 7K ohm to 10K ohm. This will reduce the base current of the transistor and subsequently the collector current as well. This value should also be enough to supply the 30mA max current as required by the transistor. other parts in the circuit looks okay to me.

Pencil
09-05-2011, 07:40 PM
Relay is an FRS6-1.
The Voltage on the uC is 0v in the off state.
When the uC pin is in the off state the relay is not engaged, so I think this may rule out the second theory you have?


That relay doesn't appear to have a built in protection diode.

Verify the voltage of the uC pin when it is off by checking it for
yourself. We are talking about probably less than 1 volt. This
may be enough to turn transistor on just enough to allow some
current to flow through transistor, but not enough to actually
turn on the relay. A quick check would be to check temperature
of the transistor after the relay has been off for a while, it should
not be warm or hot to touch.

On the opposite end of the spectrum, the output of the uC pin
may not be the full 5 volts you think it is. This would mean a
base resistor of a lesser value would be required to assure the
transistor was turned on fully, otherwise, with the transistor only
partially on, heat would cause the transistor to fail over time.
Verify the voltage of the uC pin when it is on. A quick check
would be to check temperature of transistor when relay is on,
it should not be warm or hot to touch.


Which uC are you using? A check of the datasheet would be
a clue to what the range of Voh and Vol of that particular device.

Also, don't rule out wiring errors. An accidental short in the wrong
place (example: small solder bridge between pins) can be very
frustrating to troubleshoot.

I may be barking up the wrong tree, but trying to cover all bases.

Jemson
09-06-2011, 01:26 AM
The uC is a Modtronix SBC68EC.

I noticed something strange lastnight that could also be the cause of the issue. I basically rebuilt the circuit on a breadboard so I could easily change out the components etc, and when the uC pin is not active, it is actually grounded... I put a multimeter between an 'on' pin and an 'off' pin and got a reading of 4.98v which I would not have expected unless the 'off' pin was grounded.

How I stumbled upon this was I found was the relay was actually engaging when the power was applied to the circuit, and disengaged when I removed the uC pin from the board. I checked and rechecked the wiring of the circuit, which was all ok, and thought it may have been a slight voltage as suggested by Pencil, however after testing with the multimeter between the pins I wasn't so sure, and then found putting a diode in line with the uC and resistor stopped this from occurring and everything was working normally.

In the process of all this, I used a new BC549 and used the 1N4148 diodes as suggested.

So I think it may have been the constant current passing from the C to the B pins on the transistor that was "burning it out".

I will monitor now and see how it goes, but does my above testing shine any further light on the issue for you guys?

Jemson
09-06-2011, 01:30 AM
I should also add, when I earlier said the relay wasn't engaging, I wasn't hearing it click.
The testing I did lastnight was with the continuity test on the multimeter to see that it actually was engaged and was just silent which I think may have been due to the weak magnet due to a weak ground?

strantor
09-06-2011, 01:40 AM
The uC is a Modtronix SBC68EC.

I noticed something strange lastnight that could also be the cause of the issue. I basically rebuilt the circuit on a breadboard so I could easily change out the components etc, and when the uC pin is not active, it is actually grounded... I put a multimeter between an 'on' pin and an 'off' pin and got a reading of 4.98v which I would not have expected unless the 'off' pin was grounded.

How I stumbled upon this was I found was the relay was actually engaging when the power was applied to the circuit, and disengaged when I removed the uC pin from the board. I checked and rechecked the wiring of the circuit, which was all ok, and thought it may have been a slight voltage as suggested by Pencil, however after testing with the multimeter between the pins I wasn't so sure, and then found putting a diode in line with the uC and resistor stopped this from occurring and everything was working normally.

In the process of all this, I used a new BC549 and used the 1N4148 diodes as suggested.

So I think it may have been the constant current passing from the C to the B pins on the transistor that was "burning it out".

I will monitor now and see how it goes, but does my above testing shine any further light on the issue for you guys?

I'm not surprised you found the inactive pin "grounded" by the method you tested. I'm not at all familiar with the μC you are using, but with the ones I am familiar with, they have an internal pulldown resistor. I bet if you test from your inactive pin to ground with the ohmmeter, you will read something like 1.2KΩ or other k-ohm resistance.

Pencil
09-06-2011, 02:39 AM
The uC is a Modtronix SBC68EC.

I noticed something strange lastnight that could also be the cause of the issue. I basically rebuilt the circuit on a breadboard so I could easily change out the components etc, and when the uC pin is not active, it is actually grounded... I put a multimeter between an 'on' pin and an 'off' pin and got a reading of 4.98v which I would not have expected unless the 'off' pin was grounded.

What you have here is a premade board with a microcontroller
built in, not just a microcontroller.

This is how the output pins work. They are not "ON" or "OFF",
they are either "HIGH" (+V) or "LOW" (GND). This is simplified,
the actual voltages at each state are slightly below the supply
voltage or slightly above ground. In the case of the PIC18F6680,
which is what is on your board, the high is at minimum ≈5v-.7v
and the low is maximum ≈0+.6v with a supply of 5v and ground at 0v.
This is from the datasheet for the PIC18F6680.


Even after reading the rest of your post, I am still not sure
you have gotten to the problem. You shouldn't need a diode
in series with the base of that transistor. Keep testing/checking
something will eventually lead to the cause.

praondevou
09-07-2011, 12:27 AM
How I stumbled upon this was I found was the relay was actually engaging when the power was applied to the circuit, and disengaged when I removed the uC pin from the board.

This means the uC pin output was HIGH. when you remove the uC pin you would leave the base open, so there is no base current, the transistor couldn't drive the relay.


I checked and rechecked the wiring of the circuit, which was all ok, and thought it may have been a slight voltage as suggested by Pencil, however after testing with the multimeter between the pins I wasn't so sure, and then found putting a diode in line with the uC and resistor stopped this from occurring and everything was working normally.


You put the diode in which direction?

btw, even if the maximum LOW output voltage is 0.6V I don't think this is a problem in your case since you are driving an npn transistor ,i.e. the LOW output voltage will be near zero, since no base current is flowing.

Just for curiosity, what uC pin did you connect the transistor to? It shouldn't matter , but only PORTB has an internal weak pullup.

Jemson
09-07-2011, 03:01 AM
No, the relay was engaged when the uC pin was LOW.
Which is what prompted me to check the ground etc.

I put a multimeter across a pin on LOW and ground and did get ~400ohms so I think the pulldown resistor theory is correct.

The diode I installed was in the direction of the circuit. So to clarify it was set up to allow current from the uC board to the transistor, but not back the other way which should stop the 12V leaking out the transistor base and grounding.

Two days in so far, and so far so good, though I will continue to monitor regardless.

EDIT: Forgot to mention I am using pin C0 on the board presently.

praondevou
09-07-2011, 10:11 PM
No, the relay was engaged when the uC pin was LOW.

I put a multimeter across a pin on LOW and ground and did get ~400ohms so I think the pulldown resistor theory is correct.

Well that's strange... Also I don't know how valid are resistance measurements in an energized circuit.
If you have a look at the PIC datasheet you'll see that there is no pull down resistor. PORTB has weak pullups, the other ports don't have pullups/downs, only two FETs at the output to pull the signal to + or gnd...

However, if it works now, ok. Good luck.