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.

Trouble firing a relay from a PIC, missing something

Status
Not open for further replies.

mramos1

Active Member
I have a circuit that is not working, I get .7vdc on base but 5vdc on other side of R5. I toggle and get 0 at base? Any ideas? I am not seeing it.
 

Attachments

  • ScreenHunter_087.jpg
    ScreenHunter_087.jpg
    22.4 KB · Views: 300
We seem to have a 2n7000 salesman on board!!!

The fact that there is 0.7v at the base of the transistor means its on!! The relay needs how much current to switch on??? Is it a 5v coil in the relay??? As there is no diode across the relay are we already too late????
 
Why the 100Ω in series with the relay coil?
Is the relay coil 5Vdc?
How much current does the relay coil require?
As mentioned, you need a snubber diode connected across the relay coil, cathode to +5V.
 
I guess being tutored during the valve/tube era, I readily adopted the Mosfet when it arrived!
The love of bipolar seems seems to be pervasive.:p
Max.
Sometimes...... Only sometimes, my sarcasm gets the better of me.. I just noticed you like mosfets! They are okay when needed.... I use them on a bridge!! Nfets as there is no voltage loss....

But as a simple switch you'll spend less time just using a 2n2222...
 
You don't need to convince me!! Show a fet to newbie and they head for the hills.. Fet's tend to suffer from gate capacitance and so need a bit of thought... The first design I ever did using mosfets to drive a couple of relays... Everything worked perfectly for best part of three days... Then strange things started to happen... The fet's wouldn't shut off... After a redesign and 3 darlington's later... Its still working years later!!!
 
Show a fet to newbie and they head for the hills..!

I would have thought all the more for education?
It is a 3 lead device I don't see why the confusion, especially as a simple switch for a relay?
I have used them including the 2n7000 in quite a few custom industrial applications since their inception in the 80's with so far no glitches.
Max.
 
Last edited:
We seem to have a 2n7000 salesman on board!!!

The fact that there is 0.7v at the base of the transistor means its on!! The relay needs how much current to switch on??? Is it a 5v coil in the relay??? As there is no diode across the relay are we already too late????

There is a diode on the circuit. I soldered it across the 5V coil. Forgot on the schematic, but is there.
 
So when there is 0.7v at the base what is at the collector and what is across the resistor / coil?? I suspect the resistor is the problem and there is not quite enough current to pull the relay in??
 
I suspect the resistor is the problem and there is not quite enough current to pull the relay in??
Especially the base having a 1k resistor... I would try a 270 ohm base resistor to fully turn on the transistor, I would also ditch the 100 ohm resistor..
 
So when there is 0.7v at the base what is at the collector and what is across the resistor / coil?? I suspect the resistor is the problem and there is not quite enough current to pull the relay in??

0v at collector, .7 at base.
 
Especially the base having a 1k resistor... I would try a 270 ohm base resistor to fully turn on the transistor, I would also ditch the 100 ohm resistor..

I will drop to 270 in the morning. And the 200 cl R I never use normally. This is the first time. Will drop in a 0 ohm. Figured it could not hurt if coil shorted, but they are almost a short anyway.

Just the .7 is weird. I do not hear the relay click (one prob) but I do not see what I thought I would at base. I made two board, mistake in PCB maybe. Have not been on this forum for a long time. Little rusty. I should have added the diode on the coil to shorten the thread, I tacked them in. Thanks Ian
 
Hi mramos1,
0,7 volts on the base is not weird. It's about what I would expect when the I/O pin on the PIC is at about 5 volts. If you drop the value of the base resistor to 270 ohms do not expect to see any significant rise in the base voltage. As you are measuring 0 volts on the collector the transistor is working correctly and has enough base current with the 1K base resistor. (Or the transistor has a emitter/collector short or the relay coil is open circuit.) Verify that the collector voltage goes up to 5 volts when the PIC output is low. (The easy way to check this quickly is to just short the base to the emitter on the transistor. It will not damage anything.) Measure the voltage on the junction of R4 and the relay coil. (Like the other comments I do not see why you have this resistor.) One other thing that might catch you out is the relay MAY have a built in diode and the relay is connected with the polarity wrong. (Or the diode you have fitted is the wrong way round. ) If it is a very small relay you may not hear the click when it closes. Have you checked with a DMM across the contacts.

Les.
 
Will drop in a 0 ohm. Figured it could not hurt if coil shorted, but they are almost a short anyway.
One other consideration if saying the 'coil is shorted' is hopefully it is a DC relay, if AC, the coil resistance is very much lower that a DC type for the same voltage.
And should not be used in a DC operated circuit.
Max.
 
Ian and Les,

All is good. I use 1K there all the time, but never the 100 ohm cl on the coil (no idea why I did it this time). I shorted the coil resistor and drop to 270 on the base.

Life is good.

Might use 470 on the base in the future. Thanks for all the help. Had me stumped for sure.
 
I use 1K there all the time,

The 2n2222 will probably be okay with 1 k.... but 4.3mA * 80(worst case hfe) is 344mA

Using a 470 will guarantee enough current at the collector.... Otherwise it will get hot!
 
Status
Not open for further replies.

Latest threads

Back
Top