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.

Pic to Transistor to Relay, Amperage handeling question

Status
Not open for further replies.

iso9001

New Member
I want to use my pic to turn on a 12V relay in a car. The way the relay is wired up now, the vehicles computer ground the relay control wire and the relay kicks on (ie: the relay has supply always connected and triggeed by grounding the control pin)


My original plan was to use the pic and ground the control wire with a pic pin. However, I did some reasing and found out that as much as 1amp can be drawn when the relay switches on... I dont think the pic will be happy with 1amp sinking into it. (am i wrong?)

So I decided a transistor would be a good idea. I asked somthing about the problem and someone told me an N-Channel Transistor would allow me to use 12V through it but be triggered by the 5V output of a pic.

But I figured that now, I'm not sending 12V throught the transistor, I'm using it to connect 2 grounds. (see diagram)

Can I still do this?
 

Attachments

  • question_88.gif
    question_88.gif
    4.6 KB · Views: 681
iso9001 said:
So I decided a transistor would be a good idea. I asked somthing about the problem and someone told me an N-Channel Transistor would allow me to use 12V through it but be triggered by the 5V output of a pic.

But I figured that now, I'm not sending 12V throught the transistor, I'm using it to connect 2 grounds. (see diagram)

Can I still do this?

You don't need an FET, you can use a normal transistor, simply feed the base from the PIC via a current limiting resistor. It's also ESSENTIAL! that you fit a diode across the relay coil, cathode to 12V supply, this absorbs the back EMF as the relay turns off, otherwise it will destroy your transistor or FET.
 
Already posted a circuit on how to do this long ago in this post.

Just connect the relay contacts any other way you like (on this scematic its used to switch the 12V). But the way to drive the relay coil stays the same...

Also use a more powerfull transistor then the BC547... BC547 can only handle 100mA
 
Nigel Goodwin said:
iso9001 said:
So I decided a transistor would be a good idea. I asked somthing about the problem and someone told me an N-Channel Transistor would allow me to use 12V through it but be triggered by the 5V output of a pic.

But I figured that now, I'm not sending 12V throught the transistor, I'm using it to connect 2 grounds. (see diagram)

Can I still do this?

You don't need an FET, you can use a normal transistor, simply feed the base from the PIC via a current limiting resistor. It's also ESSENTIAL! that you fit a diode across the relay coil, cathode to 12V supply, this absorbs the back EMF as the relay turns off, otherwise it will destroy your transistor or FET.

I wouldn't say "absorbs" the backEMF. The diode provides a free-wheel path for the current to flow during turn-off. If that diode wasn't there then yep a BackEMF to re-establish current-flow would be generated. But as is stands the backEMF is clamped at forward conduction of the freewheel diode
 
Um... fit a diode where now ?

The relay is a stock car part, sealed, 12V, 30amp max, 4/5 pin relay. There is no fitting a diode anywhere in there unless it already has it.

Also, the transistor to use.... PNP, NPN, FET ? (I dont know the difference between NPN and PNP, I guess or FET for that matter)

So, this connecting two ground idea will work huh ? Thats good to hear, I'll have to test this whole deal out later today.
 
I posted a link to a scematic, including the diode, 2 posts up...

the diode is only needed if you use a transistor or fet to drive the relay. Normally relais in cars are not controlled by semiconductors so no protection diode is needed.
It need an NPN transistor wich can handle the amount of current required by the relay's coil
 
I saw the link, but it appears that that diode is INSIDE the relay. (Not going to work as I am using big black sealed units)

The diagram of the relays I'm looking at have a resistor where your diode is.

One guy I talked to said that 1amp is common to active those relays, I'm guessing what he said is right, its a pretty high amp device thats being driven.

Can I place that diode somewhere else?
 
iso9001 said:
I saw the link, but it appears that that diode is INSIDE the relay. (Not going to work as I am using big black sealed units)

The diagram of the relays I'm looking at have a resistor where your diode is.

One guy I talked to said that 1amp is common to active those relays, I'm guessing what he said is right, its a pretty high amp device thats being driven.

Can I place that diode somewhere else?

The diode simply fits outside the relay, it's exactly the same electrically as it being inside the relay - however, I've never seen a relay with an internal diode.
 
Hello Everybody

This is my first post and Im still a complete N00b in Electronics so please feel free to correct me if Im wrong.

Hi Iso9001.It may look like the Diode is inside the relay but it is actually connected between the 0V coil input and the +V coil input.The diode is connected as shown so as to only allow current to flow from 0V to +V.

When current to the coil in the relay is switched off a very large electric force is induced in the coil.This force could be several amps wich would surge through the transistor and burn it out.
Thats why a diode is connected as shown so as to conduct the excess current safely away.

Hope it helps and i hope im correct :roll:
 
Okie Dokie,

Is there any chance I can put this on the transistor side ? (between the trans and the relay)

I want any parts I add to be on my board and not wired and placed throughout the vehicle.

Also, what kind of diode ? (I have to get parts from radio shack, so if I go in and see zener, bla bla bla I get confused... any then I ask some one... and THEN i get angry from the stupid blank stare)
 
Many relays do have diode integrated right inside the housing.
We buy them all the time because it saves time and it looks neater.
Type of diode depends on application. I usually just put 1N4007
or for smaller relays 1N4148...
 
iso9001 said:
Okie Dokie,

Is there any chance I can put this on the transistor side ? (between the trans and the relay)

I want any parts I add to be on my board and not wired and placed throughout the vehicle.

Also, what kind of diode ? (I have to get parts from radio shack, so if I go in and see zener, bla bla bla I get confused... any then I ask some one... and THEN i get angry from the stupid blank stare)

No it MUST be across the relay. if you put it between the TRansistor and the relay all you will do is either not allow any current to flow or juect provide a 0.6V drop to the transistor (depending on diode orientaiton).

The diode MUST be across the relay (which in effect is an inductor) with the cathode at the relays +ve terminal and the anode at the rely-transistor terminal
 
Well.... 1. Its a sealed unit 2. If I can avoid modifying the stock relay/wiring i will

Is emf really going to kill a larger transistor ? (any type)

Any other diode/placment options ?
 
iso9001 said:
Well.... 1. Its a sealed unit 2. If I can avoid modifying the stock relay/wiring i will

Is emf really going to kill a larger transistor ? (any type)

YES!!!.

Presumably the two wires from the relay coil go back to your board?, simply fit the diode across the relay connections on the board!. Or you 'could' fit the diode across the transistor, from collector to emitter, which would protect the transistor - but it would send nasty spikes into your cars electrical system.
 
Nigel Goodwin said:
iso9001 said:
Well.... 1. Its a sealed unit 2. If I can avoid modifying the stock relay/wiring i will

Is emf really going to kill a larger transistor ? (any type)

YES!!!.

Presumably the two wires from the relay coil go back to your board?, simply fit the diode across the relay connections on the board!. Or you 'could' fit the diode across the transistor, from collector to emitter, which would protect the transistor - but it would send nasty spikes into your cars electrical system.

A diode across the trasistor will do squat to protect the trasistor let alone the voltage buildup associated with open-ciruiting a charged inductor.

IT MUST GO ACROSS THE COIL.
 
Hmmm..

There is just 1 wire going to my board. The relay activates when then stock computer grounds the relay control wire. I assume they are using a transistor to do this since I doubt the powerPC chip they use likes 1amp grounded into it.

How are they doing it w/o a diode on the coil ?

I could me this alot easier if I ran 2 wire to the board, but ofcourse I dont want to do that since packaging is a huge concern. Modifying the vehicle is not 'really' an option I'de like to explore.

I guess I'll go crack a relay open and see if it has a diode across the coil.
 
iso9001 said:
How are they doing it w/o a diode on the coil ?

The diode is probably mounted on the circuit board, from the collector of the drive transistor to the 12V supply - so electrically it is fitted across the coil, just not obviously.

If you look at the ULN2003 driver IC, this has internal diodes for this very purpose, if you feed a relay from them there's no visible diode.
 
I'd still recommend a FET. The bipolar NPN transistor will generate at least 300 mW of heat since it can't drop less than about 0.3 V in saturation- if that. The base current required to achieve max saturation is also not completely trivial, which makes enough heat to stress the 5V regulator if you use a small TO-92 pkg. Plus you need an external resistor.

I never understood why people have such an attraction to bipolar. There's no real fundamental cost difference anymore, just pick the right transistor.
 
I get what your're saying, but the 12V Supply to the realy is directly from the battery (well, a fused output), and then the ground for the relay (Relay Control) is to the Computer.

They have to be using a relay w/o a diode, b/c what happends when the owner replaces a bad relay with one w/o the diode ? They just expect the computer to get ruined ? I doubt that.

No capacitor idea ?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top