The goal is this:
Power the 'PWR' car antenna at all times with 12v
Power the 'CNTRL' car antenna with 12v only when pin2 (arduino) toggles
(This would allow me to retract/extend the car antenna with a toggle of the switch).
I ALREADY KNOW that the 'switch' part of the circuit works -- I have tested it with an LED. It's just the transistor/Mosfet P channel that I don't get.
This is the second post for the same project, because I'm struggling to see whats going on -- sorry guys, and thanks so much for the help. I'm dealing with 12V here, so I really want to make sure everything is in order before I connect it together. Would this circuit work?
Thanks in advance -- see attached circuit.
tinman, the antenna requires 12v so there needs to be some sort of switch, as far as i understand.
You are right, it could be way simpler -- I got a circuit like THIS to work well before. I wanted to try using a MOSFET just because I've never used them before and they seem important to understand. As you can see, they are basically a mystery to me atm.
Conceptually your circuit should work fine. You must be careful about how you actually hook it to the vehicle or antenna and 12Volts.
To help you understand how it works, you should add in the D,G,S (drain, gate, source) annotation to your diagram.
In the below I take a lot of liberities regarding "open" or "full off" and "closed" or "full on"
Lets assume both the transistor and MOSFET are operating in either the "full on" mode or "full off"
When pin 2 is low, there is no current going into the base of the transistor so the collector is "open" With the transistor "open" the 2.2k essentially connects the MOSFET gate to the source. When Vgs = 0 the MOSFET will not conduct.
When Pin 2 goes high, the transistor is "ON" or "Closed". This overcomes the 2.2k and connects the MOSFET gate to ground. Now Vgs =-12 and the MOSFET is "full on"
Keep in mind in an automobile there is no such thing as ground. Things may be close to the "vehicle common" but they change dynamically but up to +/- 2 Vdc. So the Arduino ground, the 5V ground and the 220 ohm resistor must be very close to each other, then only one wire should connect from there to vehicle common.
Also, the 12V car supply can be anywhere from 6 V to 18Vdc for short periods of time. It can also reach 50V for very short periods of time (80V on older cars).
JohnRob -- thanks so much man. That was the clearest explanation of MOSFETSs Ive heard, and I finally see how that chunk of the circuit works. You are the best.
One thing though -- if the 'CNTRL' of the car antenna is getting 12Volts when the MOSFET is 'closed' (ON), then that means that the 2.2kohm resistor between 'CNTRL' and 'GND' is dissipating 12volts.
Isn't that a bit much for such a small resistor? Should I maybe replace that with a 10kohm resistor?
When the gate is at ground level (NPN transistor "on"), battery voltage is between source and gate.
One spike over Vgs will kill that mosfet. 30volt spikes or more are not uncommon in cars.
Leo..
jesuisparle:
Isn't that a bit much for such a small resistor? Should I maybe replace that with a 10kohm resistor?
The value of the resistor doesn't tell you how big it is. I have some very big resistors that are only 6 ohms. (Like they would hurt you if they fell on your foot.) They can absorb 150W of power though.
Work out the power dissipated in the resistor in the worst case. This is a "12V" car, so expect 14V continuous when the engine is running and the alternator has charged the battery. 14V through 2.2K gives what current? Multiply current by voltage to get power.
Most average resistors are 1/4W. Tiny ones are 1/8W. That's 125 milliwatts.
There needs to be protection against overvoltage on the automotive supply, so add some resistance (470 ohms?) betwen NPN collector and MOSFET gate, and add a 12V zener between MOSFET gate and source to protect the gate oxide.
should there be big inductive spikes on the +12V.