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.

Relay Control Via Transistor Problem

Status
Not open for further replies.

iso9001

New Member
Hi, my orignial posts were here.
https://www.electro-tech-online.com/threads/rail-rail-opamp-output.9331/
https://www.electro-tech-online.com/threads/final-year-project-ideas.10008/

I wanted to control a relay with my PIC. I figured I'de use a MOSFET to connect the ground of the relay control when I wanted the relay on. Easy.

I went and got an N-Channel MOSFET and hooked it up so that:

Gate - Hooked to my pic
Drain - Relay Coil Control (12V)
Source - Hooked to ground
(if source and drain are reversed is the relay is ON all the time)

The idea is that when the my PIC sends 5V to the Gate, it connects the Source and Drain up so that my relay control is grounded and clicks on. Which it does...

However, when I turn the car on (plus sometimes randomly), the relay turns on too, but without my pic sending the 5V to the MOSFET!?

How can this happen? Its like the power is surging through the transistor? Possible? It seems like this transistor is overly sensitive, is there a better kind for me to use (a little more durable?) Or maybe a fix ?

(Aside note: When it does ghost-turn-on I click touch JUST the Gate pin with my finger and it turns off, then continues to function normally... Thats just bizzaro)

This actually kind of urgent and I really appreciate all the help everyone has given, this sort of thing would be impossible for me with out it. Thanks
 
This appear when the gate floating. Put the resistors as the figure show.
I think, the PIC output sometimes also floating.
 

Attachments

  • question_88_129.gif
    question_88_129.gif
    5 KB · Views: 648
Sebi,

I'll try that out for sure.

I noticed this happends if I drive the PIC pin low to turn off the relay or I let it float.

Also, can you tell me what that 10k resistor is doing ?
 
iso9001 said:
Sebi,

I'll try that out for sure.

I noticed this happends if I drive the PIC pin low to turn off the relay or I let it float.

Also, can you tell me what that 10k resistor is doing ?

It's a pull-down resistor, it stops the very high impedance input of the FET drifting high (through internal, or external, leakage). The I/O pin of the PIC defaults to an input as it powers up, this lets the gate float until the I/O pin is defined as an output - you should also set the output LOW before you define it as an output - this preferably needs to be done as early as possible in the PIC code.
 
The 10k is biasing the transistor gate low to keep it from turning on when it's not supposed to..
 
well :)

That solves that. I'll put the resistors in there and give that a try.

Anyone know why it worked normal if I touched JUST the gate with my finger ?
 
iso9001 said:
well :)

That solves that. I'll put the resistors in there and give that a try.

Anyone know why it worked normal if I touched JUST the gate with my finger ?

Probably because your body is acting as a resistor, pulling the gate low.
 
Its just wierd ya know, I'm not touching the car body ground or anythin g like that... so... earth ground is pulling electrons from that gate via my finger ? that just seems like a REALLY sensitive piece
 
iso9001 said:
Its just wierd ya know, I'm not touching the car body ground or anythin g like that... so... earth ground is pulling electrons from that gate via my finger ? that just seems like a REALLY sensitive piece

Fets only need a small amount of charge to transition and it doesn't much matter wher it comes from.. there is plenty sitting on your body now. As a matter of fact, there can easily be enough to destroy the device should it have a return path. If you must touch the gate of the FET, do it by holding a 10k resistor and touch it with that. The 10k is too small to impede charge flow into the gate but will protect it should you have a high static potential.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top