Fuelly Forums

Fuelly Forums (https://www.fuelly.com/forums/)
-   General Maintenance and Repair (https://www.fuelly.com/forums/f10/)
-   -   Anyone know how NPN transistors work? (https://www.fuelly.com/forums/f10/anyone-know-how-npn-transistors-work-10116.html)

itjstagame 10-06-2008 05:50 AM

Anyone know how NPN transistors work?
 
Ok, there's a lot of smart electronics people on here I've notice. I only have a rudimentary knowledge and I'm having an issue.

The Festiva I got, the first day I drove it I noticed that the headlights are wired directly and ignore key input and do not buzz or anything, and thought "Man I'm going to forget about these lights sometime, I should wire this to go off with key out".

Then 3 days later I forgot about the lights and killed the battery and got stranded on the side of the road and lots of fun stuff.

So I ripped apart the dash, cursing my laziness, glad I'm finally doing this and find out that the parking lights and headlights are wired through the relay already to main power and the headlight switch is just grounding them. Not as simple as just supplying a different power source to the relay as I had hoped.

Then I thought, hey, I know how transistors work, if I wire the ground wire coming from the switch to the collector, the emiter to ground and the base to accessory power, that should work great!

So I wired it up everyway possible with this transistor. With the ground wire from switch cut the headlights don't come on. WIth leads hooked to emitter and collector or vice-versa, either one, I can diode test and connection test and verify there's no connection between the leads, but when I turn the headlight switch there's a connection between the emitter and collector. This is with NOTHING hooked to the base. So is there a certain voltage or current that just 'jumps' the base of a transistor? Everything I've read says 'no' and that anything less than 15V will work fine as expected.

Also am I going about this the wrong way anyway? Even if it works as I expect and I need to put power at the base to complete the NPN connection, removing power from the base, will that 'turn off' the NPN connection? I've seen a lot of applications where once transistors are 'switched' they stay that way until main power is removed.

Any thoughts on how I can accomplish my goal? I guess when in doubt I can just put a buzzer inline connected to accessory power too.

Jay2TheRescue 10-06-2008 06:22 AM

The easiest way to solve your problem is to use 2 12 volt relays in a series and a 12 volt buzzer. Wire the relays in a series so that the buzzer will not sound unless the lights are on, and the key is off.

Also, if you're into a little hunting in a scrapyard pull the chime assembly from an early 80's Buick. Its a big white plastic box plugged into the fuse panel under the dash. Simple experimentation will tell you what power neeeds to go where. The only thing I can remember for sure is that the grey wire coming out of the top goes to the dash lights so it knows when the lights are on. I did this on Rusty. Left the lights on once, decided on installing a warning circuit. I took the stock seatbelt/door open/key in/headlight warning buzzer out of the fuseblock and replaced it with the chime from a 1980 Buick Century, and then hooked up the loose wire to the dash lights. I then had a chime, not a buzzer and I had a headlight warning just like the one in my 1981 Regal.

-Jay

GasSavers_BEEF 10-06-2008 07:52 AM

I must admit, I didn't read the entire post but why not just use a relay that is energized with the ignition switch and splice that inline with the headlight wire.

that way your headlights will NEVER be on unless the ignition is on.

Jay2TheRescue 10-06-2008 08:26 AM

I like the way you think BEEF.

-Jay

GasSavers_BEEF 10-06-2008 08:32 AM

you could also use a solid state relay so it will last a LONG time. they are expensive though.

I am not a ford guy but a friend of mine just read throught this thread and told me that a festiva should have a chime on it when the lights are left on. he figures someone has previously ripped it out. junk yard and some time. there again, this info is second hand.

*edit* I guess you could use a transistor for this application but why not go simple. if you do need to use the headlights without the car on, you could put it on the accessories so that the key has to be in but not on. though I like doing it the semi-complicated way just to say "I did it" sometimes you have to revert to the KISS method. Keep It Simple Stupid (I think it is from the military)

dkjones96 10-06-2008 09:35 AM

Personally this is how I'd wire it.

Have the input to the relay coil come from something, anything that is only on when IGN is 'on'. Then, leave the ground working though the headlight switch.

If the switch is off and the ignition is on, lights are off. If the switch is on and the ignition is off the lights are off. If they are both on then the lights are on. Simple, easy, and doesn't require anything more than a wire moved.

itjstagame 10-06-2008 10:09 AM

It's fine to wire the existing relay to acc on, but I traced for a couple hours and couldn't find the relay, I think I need to dig the mess out from behind the headlight and it's ziptied pretty tight and I'd prefer to avoid it if I can. Especially since I need to do this twice, once for headlight and once for parking lights.

As for putting another relay inline, of course this can be done, but I don't see how that's the easy way. It's bulky and doesn't make a lot of sense since a transistor should be able to be used as a switch and do the exact same thing.

If it's simply just a matter of hooking this up more correctly then why would I want to trouble myself to fabricate something from a junk yard?

Jay2TheRescue 10-06-2008 10:27 AM

Quote:

Originally Posted by itjstagame (Post 120541)

If it's simply just a matter of hooking this up more correctly then why would I want to trouble myself to fabricate something from a junk yard?

Just giving you as many options as possible. You can choose what's best for you. Pulling the chime unit out of a 1980 Century was almost a plug in replacement on my 86 Chevy p/u. All I did was take the old buzzer out, plug in the replacement, then hook up the extra wire to the dash lights. Literally took 2 minutes to do. YMMV.

-Jay

GasSavers_BEEF 10-06-2008 12:11 PM

there are a thousand ways to do the same job. what is easy for me isn't easy for someone else.

it is good to have options. I would consider what everyone has said and take what you think will work the fastest and easiest for you (and still do the job) and run with it.

itjstagame 10-07-2008 04:51 AM

Ok, so everything I read yesterday said that the way I was hooked up was correct and that power should never jumper between collector and emitter with no base connection. My transistor tested out ok on a multimeter diode test but I guess the 12v of the battery was enough to cause some issue, don't know. My guess was that I had shorted or broke it in some way.

So this morning I got out a new one, wired it in the same way (leaving base empty) and the headlights didn't work! Woo! Also reading yesterday, transistors work on current, so wiring Acc On to the 'base' directly is probably what broke it, so I put a 10k resistor inline and voila! Works perfect! Both headlight switch needs to be on and key on 'Acc On'. Turning off either turns off the headlights. In fact I pull 'Acc On' from a spot that goes out during cranking, which I think is even better, less amp load while starting.

There is one slight issue that if I turn the headlights off and back on quickly (< 1sec or so) that they don't come back on, I have to turn off and wait at least 3-4 secs. I'm not sure why that is but it's fine.

So a 5 cent transistor, 5 cent resistor and 10 mins of soldering. For me that's much easier than finding a junkyard (they all suck here) or tracing and pulling apart the harness looking for a relay somewhere. It would have been done yesterday if I hadn't shorted out my transistor.

theholycow 10-07-2008 05:00 AM

Junkyards here suck too.

Can you write it up in a more organized format with drawings? :)

Jay2TheRescue 10-07-2008 05:31 AM

I guess I'm kinda fortunate. There's a huge U-Pull-It yard about 20 miles from my parent's house. Its nice because you can "learn" the easy way to do the job on a car that isn't yours and if there's any collateral damage you know not to do it the same way on your car.

-Jay

itjstagame 10-07-2008 09:25 AM

2 Attachment(s)
Jay we had an awesome pick and pull by my parents, but that's over an hour away and mostly domestic stuff. It was a blast to just take stuff apart for the hell of it. Near me there's only one wrecking yard I know of and they remove it themselves. Their prices are reasonable but their selection sucks, plus they got rid of a lot of cars when scrap metal was high.

Cow: I had a 30 pack of NPN transistors from Radio Shack already, I think they were like $5 or something. They're cheap. Anyway attached is a Paint picture, woo!

It's pretty straight forward, with the flat side of the transistor facing you, left to right is collector, base, emitter, I tried to make this more clear with the 2nd view to the right. The X's mean you cut and splice here.

I said the base can be hook to any signal to turn on the relay and this is true. You could hook it to a Photosensor and use a PNP transistor instead to have headlights only come on when it's dark and there were plans online to use a microphone through another transistor to amplify the current and use that to control a transistor. So then you could turn on a relay based on noise.

It mostly suited my needs because everything I need to do was in the steering column and easily fit inside it, seemless install.

VetteOwner 10-07-2008 04:20 PM

i thought most cars had some sort of key in ignition/headlight buzzer from the factory?

every car weve owned (heck even my chevette had them )

i took them out tho because it got annoying listening to them beeeeeep while listening to the radio with the door open.

u sure noone did that to your car? or the buzzer may have just gotten bad.

Jay2TheRescue 10-07-2008 04:38 PM

The Buick, and the beast have headlight on alarms from the factory. My 86 Chevy Silverado does not. I did pull one from a 1980 Century and it plugged right in though, so Rusty has it (now). I imagine it would have worked on my 74 Chevy truck as well, and definately my 1980 Bonneville wagon. I did rip the buzzer out of the AMC Spirit we had because the switch went bad in the seatbelt buckle, and when you started the car the darn buzzer would not shut off for almost a minute. That early 80's Buick module worked well, and was easily adaptable to other vehicles.

-Jay

itjstagame 10-07-2008 08:36 PM

Yeah all my Chevys had them stock, though one had the buzzer removed. I'm not sure if there is one or not. Either way I've ignored buzzers and chimes before and I prefer my headlights to be off if the key is off so this is better than stock now.

JanGeo 10-08-2008 06:21 AM

You figured it out already but yes the base on an NPN doesn't want to see more than about .6-.7 volts positive applied to it relative to the emmiter. It should look like a diode and in fact it is. The 10k resistor you connected to the base should do the trick but you may also want to measure the relay current in the collector of the transistor and make sure you are appling enough current through the base resistor to keep the transistor turn on hard otherwise it may get warm if it is not operating in saturation. The hFE of the transistor is the current gain so you take the base voltage through the resistor 12volts/10k*hFE = collector emmiter current. You may also want to connect a 5k resistor between the base and emmiter to turn off the transistor when the 10k resistor connected to the Accessory power doesn't quite get to ground to turn off the transistor completely. Chances are there are devices loading the acc power down to ground pretty quick but things like a radio can have caps on the power leads that hold the ACC power high enough to prevent the transistor from turning off quickly and that is what keeps your headlights on for a few seconds. A bigger cap in the right place (base of the transistor with another diode) will give you delayed off headlights.

itjstagame 10-09-2008 12:59 PM

Hmm, yeah, I did notice that the transistor is getting quite hot with the headlights on. I can't expect that the relay is drawing all that much current, but the transistor is only rated for 800ma.

For some reason my multimeter just won't measure amperage, maybe it has a fuse blown inside, I don't know, so I'm not really sure. I do know that the wires through the headlight switch are only 20 or 22 gauge and don't get hot at all. So maybe I'm not saturating the transistor?

My one friend thinks the 10k resistor might be the problem and suggested a voltage divider. So 'Acc On' -> 1k -> base -> .5k -> ground And that way it won't relay on grounding through the transistor as it's ground and should be seeing something like 5V at 10ma.

But with the headlights off and 'Acc On', so I'm putting whatever 12v/10k is through the base to ground off the emitter and that generates no heat from either the resistor or transistor so it must be drawing very little current. So I'm not totally sure the voltage divider/changing the base input will help me much.

Thoughts ?

itjstagame 10-10-2008 01:00 PM

That's a great site you linked. I checked and my transistors are Hfe 200. So I need a 22k resistor, with the 10k I don't have enough current and it's not saturating which could be leading to the heat ?

Should I go get a 22k, use 2 10ks in series or can I just use a 33k?

itjstagame 10-11-2008 12:28 PM

Hmm, well 33k ohm still makes it hot as all hell pretty quickly, so, hmm.

GasSavers_BEEF 10-11-2008 12:53 PM

honestly, I would replace it with a tiny little relay. they pull next to no current and you can get them with a 12 volt coil. go to radio shack and spend a buck or two.

it is much better than having to worry about the thing burning out and not having lights. don't reinvent the wheel. they have been using relays in cars for years.

ground one side of the coil and run the ignition wire to the other side of the coil, good to go.

AMX 10-11-2008 12:54 PM

Quote:

Originally Posted by itjstagame (Post 121101)
Hmm, well 33k ohm still makes it hot as all hell pretty quickly, so, hmm.

Have you calculated the power being dissipated in the resistors? What wattage are you using? Try going to an increased wattage resistor.

theholycow 10-11-2008 01:15 PM

Quote:

Originally Posted by BEEF (Post 121104)
don't reinvent the wheel. they have been using relays in cars for years.

That's not reinventing the wheel...that's just using the appropriate tool for the job. Relays are for switching large loads. Transistors are for switching small loads (or some non-switching jobs like amplification).

Don't use a sledgehammer to pound a finish nail. A transistor is the right tool, keep at it until you get tired of trying, THEN use the sledgehammer.

GasSavers_BEEF 10-11-2008 02:05 PM

you do ralize that you can get a relay that is as small as a pencil eraser. I am not talking about a huge device.

he is trying to engineer a system within his vehicle to work with somewhat unknown values. if they were known then things wouldn't be getting warm.

there are a million ways to get where you want to go. the question is which is the best for what is available. a relay (very small one at that) will do the job and nothing else has to be taken into consideration.

also, fets are used to switch large loads. variable speed motor drives have been using FETS in their output stages for a while now. field effect transistors rated for 1200 amps(each one weighed about a pound and a half ). that is a pretty big load.

honestly, either way would work but the question is how much time do you want to invest? have fun figure it out or just buy a relay (the little one).

VetteOwner 10-11-2008 02:37 PM

I say go with the relay...

multimeter wont measure amps because of 3 things:

1. you didn't switch the leads (most have to switch the red lead to the amps/ma socket)
2. blew the fuse because you didn't break the circuit to measure something
3. cant measure current (havent seen one but do know of some crappy ones that cant)

theholycow 10-11-2008 02:57 PM

Quote:

Originally Posted by BEEF (Post 121109)
you do ralize that you can get a relay that is as small as a pencil eraser. I am not talking about a huge device.

I did not realize that. I've only ever seen the ones that are about 1 inch, cube shaped, and a few about half that size.

The pencil eraser-sized one still has moving parts, but it sounds pretty cool. Where does one find them, and how much do they cost?

Transistors are found in any junk electronics being discarded and are free, of course.

VetteOwner 10-11-2008 04:45 PM

if you know where to look you can pick relays up like candy at a junkyard....lets just say i got enough to last a lifetime :D

i wouldn't worry about size of the relay cuz its most likely going to be shoved up in the dash anyways

GasSavers_BEEF 10-11-2008 08:23 PM

radioshack

Model: 275-233
Catalog #: 275-233

(didn't think the link to the search would show up right)

this is just an example of one. the current that they can handle may be the biggest drawback and yes they are supposed to be mounted in a PCB but so is the transistor that is being used. I think that current through the device may also be making it hot.

transistors are used for switching but the reason they use them for switching is usually for #1 no moving parts but #2 their switching speed is much faster. the second one goes along with the first but it doesn't have much to do with the size. a solid state relay is just a transistor (be it a big one) in a package that fits in a relay socket. it does have all the resistors and other good stuff built into a neat little package so you don't have to do anything but plug and go. they last longer because of the less moving parts which makes them very valuable in industry.

also, those boards that you can find the transistors on, look at them more closeley and you may find relays on them too. most are square and long (the small ones) maybe a qtr to a half an inch square by about 1 inch long. two pins on one side (the coil) and 2 or 3 pins on the other side (the actual contacts) they are used more than people realize in electronics. not necessarily computers but definitely for controllers. old PLCs used them for their outputs. they were very low current though. that may be a problem with them though in this application.

*edit* the way I see this is a low-tech problem with a high-tech answer. that is the reinventing the wheel thing. you want a switch to flip off so that the lights won't come on when the car is off. a relay is simply a switch. flip off the switch to the coil and the contacts open. low-tech but effective. nothing to figure out (other than current capcity you would need) if you use a 20 amp one, you have nothing to worry about but you can figure that out and use an appropriately sized one if you care that much. I guess also remember to use one with a 12VDC coil but that goes without saying.

*edit again*
https://relays.tycoelectronics.com/datasheets/OMR.pdf
here is one from mouser. this pdf shows a lot of things. it shows physical size but it also shows maximum switching rate. these things get really small but also the current handling is small as well. a lot of good data on this data sheet. I wouldn't use this relay but you see what I am saying about relays being small.

sorry for the book ^^^

theholycow 10-12-2008 04:13 AM

Great work, BEEF!

As I was reading it, I got to this part...
Quote:

*edit* the way I see this is a low-tech problem with a high-tech answer. that is the reinventing the wheel thing. you want a switch to flip off so that the lights won't come on when the car is off.
That's when I realized that using a relay or transistor is probably more than necessary, due to an idea that I got:

The headlight switch gets power from somewhere and puts that power through a relay which powers up the headlights. Why not just change the source of the switch's power? You could just tap a wire that's only on when the car is on. This avoids needing any relay or transistor, because you're using that big honkin' ignition switch that's made to control exactly this sort of thing!

According to https://www.bulldogsecurity.com/New%2...stiva91-93.htm OP's Festiva could use the Black/White (ignition) or Blue/Red (accessory) wire from the ignition switch harness. The only gotcha would be if the headlight switch runs on the opposite polarity, which is a distinct possibility...that would pretty much break this idea.

itjstagame 10-12-2008 05:28 AM

Nope, doesn't matter if it runs in the opposite polarity, the headlight switch could switch positive or negative side of the coil, doesn't matter and making that positive controlled by ignition will fix the problem in either case. But I already outlined above why I'm not doing that.

And thanks for all your thoughts, that small relay is a cool idea and quite easy to use. I may just do that. I don't want a big transistor because I'm not under the dash, I'm in the steering column, no room. But the small one will work. I'd just prefer solid state if I've got a million of them. To me it feels like the right solution and to me it seems stupid to give up because we just doing know what we're doing. It should be the thing used for the job we just don't know how.

theholycow 10-12-2008 01:01 PM

Quote:

Originally Posted by itjstagame (Post 121141)
Nope, doesn't matter if it runs in the opposite polarity, the headlight switch could switch positive or negative side of the coil, doesn't matter and making that positive controlled by ignition will fix the problem in either case. But I already outlined above why I'm not doing that.

I thought you couldn't find the relay and that's why you're working at the switch, which is why I figured it is pointless if the polarity is wrong.

GasSavers_BEEF 10-12-2008 04:15 PM

the way I see it, none of us (the guys trying to help) have all the information. it is much easier when the car is right in front of you. the statement about having a million of one particular part (though I understand about using what is on hand) may not matter if it can't handle the job at hand.

the drawing that you showed us (hand drawn) showed the part as a TO-92 style package so I decided to look up the 2N3904 (which we used all through first year electronics in college) these things were only rated 100mA for switching. depending on the current that you are running through it, it may never work. once you found out how much current the device will be seeing when the headlights are on, you could parallel several devices together but one device will see the current more than the rest because it will have less resistance than the other just because of manufacturer variations. this will eventually cause that one to fail and eventually cause a cascading failure which all will fail....eventually.

I can't say what is going to work and what is not. I say not to worry about it and to remember to cut your lights off from now on. lesson learned, be more cautious in the future.

looking at it from a cost analysis point of view. I make a descent salary. (overtime is time and a half). I would assume that you have spent hours on this project trying to figure out how to use these parts that are about a nickel a piece. it would have been much more cost effective to get a relay (small, large, whatever) and use it regardless of price. if space was an issue, solder some wires to the splice (srink wrap the connections) and extend the wires to under the dash. some relays actually have a mounting hole in the housing where you can secure it under your dash somewhere with a zip tie. there is the possibility that you are doing this to increase your knowledge of electronics. personally, I feel like that needs to be done on a bread board in a lab ( be it a basement, garage, or even bed room) not on your vehicle which you rely on for transportation.

good luck to you whatever you decide to do. if you do decide to use the transistor, experimentation and data is the key.

VetteOwner 10-13-2008 09:05 AM

yea, that and most wires in the steering columb end up under the dash anyways, just trace them under there.

dkjones96 10-13-2008 09:28 AM

I was thinking about it and don't know why I didn't tell you this before. You can make a relay into an NPN or PNP switch if you want to. It's low-speed high-current and single voltage but works perfect here.

For PNP you have the hot lead in and connect that directly to one side of the coil. Then, you have the load out and the negative lead from the coil that you ground when you want to turn the device on.

For NPN you do the opposite. You have the load's ground come in, the positive lead to activate the switch and the other end of the coil is tied to ground on the load out side.

I used to do this all the time because it eased wiring.

Now you CAN NOT feed positive to the relay coil and expect it to ground through something like an electric fan. It destabilizes the coil and you end up with a rapidly switching relay that will quickly die. For headlights it would work though. Positive from the battery, positive for the coil, and the coil grounds through the headlights.


All times are GMT -8. The time now is 07:16 PM.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2025, vBulletin Solutions, Inc.