How to control a MOSFET switch 16 volts with a microcomtroller?
I've tried this circuit but I still end up measuring 8volts of the base of the transistor with the DMM. I do not want to hook it up to the arduino until I know I won't now up the output.
Can someone please tell me what I am doing wrong?
Or suggest a better circuit to use?
I am using a p-channel MOSFET FQP27P06
And a NPN transistor 2N3904
RL is only 130mA at 16v.
You have the collector and emitter reversed in that diagram.
Arduino to 150 ohm resistor to NPN base. NPN emitter to Gnd. NPN collector to 150 ohm resistor to P-FET Gate. 1K resistor from P-FET Gate to +16V. P-FET Source to 16V. P-FET Drain to Load.
High to NPN turns it on, collector goes Low and turns on P-FET.
Low to NPN turns it off, 1K resistor pulls P-FET Gate high to turn P-FET off.
So you have the NPN Collector/Emitter swapped.
I may have source/drain names swapped, I have to look that up every time to be sure. Want the inherent diode cathode connected to 16V. What you looks correct for that.
Thank you very much for your help. Managed to get circuit working when I switched emitter an collector. Also that 1k resistor is very important to stabilize the MOSFET.
Here is the working circuit for anyone who might stumble across this post:
Many thanks Clark and Crossroads!
Now I just need to learn how to 'code'.
Yes, the 1k resistor pulls the MOSFET gate HIGH so it definitely turns off. Otherwise, with the NPN transistor turned off, the MOSFET gate would float. In fact, once it had been turned on, it might take quite a long time for the gate charge to leak off, leaving the MOSFET turned on for a long time. NPN transistor CE leakage might even keep it turned on all the time, once it has been on once.