Go Down

Topic: P-Channel mosfet controlling car 12v light (Read 57704 times) previous topic - next topic

dhenry

You can switch from the low side with a n channel mosfet or even switch from the high side with a n channel mosfet (not very efficient).

The issue of chassis polarity (whether it is grounded positive or negative) does come into play, particularly that your fixture isn't coorporating: for example of the low side is grounded to the chassis at the fixture.

But if you are ok with your own fixture, that's not a limiting factor.

kajmaya


You can switch from the low side with a n channel mosfet or even switch from the high side with a n channel mosfet (not very efficient).

The issue of chassis polarity (whether it is grounded positive or negative) does come into play, particularly that your fixture isn't coorporating: for example of the low side is grounded to the chassis at the fixture.

But if you are ok with your own fixture, that's not a limiting factor.



Are you saying (The vehicle being a negative ground) if I ground my device/board the N low side switch will work efficiently? That would great. I could save a transistor. I know it doesn't sound like a big real estate savings. But this circuit is duplicated 5 times.

work efficently?

majenko

You can only use an N-Channel efficiently if you can place the MOSFET between the light and the ground.

In a negative chassis car, you can't do that.

If you use an N channel, you will be using it incorrectly as a high side switch.

Stick with the P-channel, and use the NPN transistor.  They're only small (the ones I work with are about 2mm x 1mm - SOT-23 surface mount).  Even in a TO-92 they don't take up much space.

dhenry

Quote
Are you saying


If your vehicle is ground negatively, and the fixture couldn't be changed, using a n-channel to switch on the high side will not be efficient.

That, obviously, may not be a problem if you aren't switching much current. And that could be a huge problem if you are switching a lot of current.

oric_dan

#19
Nov 03, 2012, 07:42 pm Last Edit: Nov 03, 2012, 07:45 pm by oric_dan(333) Reason: 1
This is without a doubt the most confusing and confused thread I have ever seen.

What people should have done is point you [OP] towards some diagrams that show the proper
circuit in the first place. Eg, see ckt diagram in the section "Prevent Electrostatic Damage".
Note where the S and D pins of the n-channel MOSFET are connected. D1,D2 are not strictly
required, but give extra protection [probably good to use in a car environment].

http://www.softwareforeducation.com/wikileki/index.php?title=MOSFET_Switch

Quote
You can only use an N-Channel efficiently if you can place the MOSFET between the light and the ground.

In a negative chassis car, you can't do that.


The 1st statement here is in line with the diagram cited. I'm not sure what the 2nd statement here
means, because in general, it's easiest to work with ckts which have a common "negative" ground
[ie battery negative is the ground buss], and ALL devices including Arduino and MOSFET ckt would
be tied to this negative ground.

Eveything else on this thread, I find totally confusing.




majenko


Quote
You can only use an N-Channel efficiently if you can place the MOSFET between the light and the ground.

In a negative chassis car, you can't do that.


The 1st statement here is in line with the diagram cited. I'm not sure what the 2nd statement here
means, because in general, it's easiest to work with ckts which have a common "negative" ground
[ie battery negative is the ground buss], and ALL devices including Arduino and MOSFET ckt would
be tied to this negative ground.

The second statement is alluding to the fact that in cars, 9 times out of 10 the bulb holder itself is directly connected to (and is sometimes part of) the chassis, so it is physically impossible to insert any components in the low side of the circuit.

oric_dan

Quote
The second statement is alluding to the fact that in cars, 9 times out of 10 the bulb holder itself is directly connected to (and is sometimes part of) the chassis, so it is physically impossible to insert any components in the low side of the circuit.


Good! That explains that. If that is the case, then OP will have to revert to the p-channel MOSFET
circuit, and switch the high side.

majenko

Which is exactly what we are trying to persuade him to do - that and turn the mosfet over so it's connected the right way :)

He seems to have a fear of adding NPN transistors into the mix...  Just because there might be *gasp* 5 of them!

oric_dan

Quote
Which is exactly what we are trying to persuade him to do - that and turn the mosfet over so it's connected the right way


Yes, that was the proper solution, but for some reason, it seems to have gotten lost in all the
other posts. The correct diagram with S,D shown properly connected is here,

http://www.bristolwatch.com/ele/img/tr9a.gif
http://www.bristolwatch.com/ele/transistor_drivers.htm

majenko

#24
Nov 03, 2012, 07:57 pm Last Edit: Nov 03, 2012, 07:59 pm by majenko Reason: 1
I would still add a pull-down resistor on the NPN's base.  The IO on the Arduino defaults to input (High Impedence).  At this time, the base of the NPN would effectively be floating.  You would get random switch-ons until the Arduino is powered up and booted and the IO pin has been set to OUTPUT and driven low.

This is the circuit I always use:


oric_dan

Quote
I would still add a pull-down resistor on the NPN's base.  The IO on the Arduino defaults to input (High Impedence).  At this time, the base of the NPN would effectively be floating.  You would get random switch-ons until the Arduino is powered up and booted and the IO pin has been set to OUTPUT and driven low.


Yes, holds the MOSFET ckt off while the Arduino boots up. 10K..22K range.

kajmaya


I would still add a pull-down resistor on the NPN's base.  The IO on the Arduino defaults to input (High Impedence).  At this time, the base of the NPN would effectively be floating.  You would get random switch-ons until the Arduino is powered up and booted and the IO pin has been set to OUTPUT and driven low.

This is the circuit I always use:




Yes I'm going with this design. Built it out last night, just need to add the 10k pull-down. Thanks for everyone's help.

jwatte

I still think 10k is too much resistance for the pull-up. Try 2.2k. Although 10k possibly won't blow the P-channel if you don't "blink" the light, and/or it isn't very high wattage.

I also would use a BS170 n-channel MOSFET instead of the NPN transistor. The circuit could look almost exactly the same as the one for the NPN (you could switch the Arduino resistor to 1k, and might not need the pull-down.)  But now I'm just being anti-BJT :-)

dhenry

Yes. If this is a switcher for some thing like 1amp or more, I would use a 110ohm pull-up. 10K would be good if you are switching infrequently small current.

oric_dan

Now I don't know what you guys are talking about again. The drive transistor is a MOSFET, not
a bjt.  All the 10K pullup does is hold the MOSFET "off" when the NPN is off, and bias the MOSFET
gate to approx -12V when the NPN is on.

The only time current flows through the pullup is when the NPN is on. If you lower the value of
the pullup, all you are doing is causing the NPN to work harder, and waste electrons.  With
110 ohms, the NPN will have to pull 12V/110 = 109mA, just a waste.

10K is a good value for the pullup.

Go Up