I have 12v power source, i need to use it to power my nano and also i need to control 8 different output signals which need to be 12v positive. That rules out NPN mosfets. Is it best to just use PNP mosfets? Current drawn from the drain of the mosfets will be very low, just a signal. So would a 5V regulator and 8 logic level PNP mosfets do the job?
And if yes, how do i pull up the gate? Just a resistor between gate and source like with NPN? Or would the 12v source fry my arduino pin? Or is it enough just to set the pin HIGH?
Well, there is no such thing. NPN and PNP are designations for BJT transistors, not mosfets.
Mosfets are classified as N-channel and P-channel, (and there's other categores of power
mosfets)
That being said,
HIGH SIDE SWITCHES is what you need.
Thats what i meant, p-channel. Sorry
How about the connections, havent really used p-channels this way... Can i connect them the same way as i would do with N's, or do i need some extra resistors etc with them? I will be using IRLML5203
Can you control your loads by switching the low side?
Otherwise use a NPN or n-ch FET to level shift.
Not really. You need High side P-channels that turn on with 0V and turn off with Vcc.
You can see from this example that the gate is pulled up by R2 and turned on by
shorting to GND.
(note the SOURCE is connected to + and the mosfet is wired with the cathode (S) to +)
This is a P-channel configured as a LOW SIDE SWITCH (not recommended for your application)
Original circuit is made with 12v inductive sensors, which output 12v positive to the signal line. I need to replace those sensors with arduino so i can control the signals as i want. So i think i need the p-channel fets.
So, what kind of resistors should i have with the fet? Arduino->gate? Source->gate 20k ok? Current flow source-drain is some mA, just a signal
you can set output at low values bjts are NPN or PNP but mosfets are different you can check code pro zone.
I was thinking exactly as your second example, is there any possibility to fry the ardu pin that way? What values the resistors should be? Vcc is 12.xxV and i will power the ardu from the same line
That's not a good idea.
You need a 12V to 5V dc to dc converter for the arduino.
I meant i will use regulator of course but i dont have 2 separate psu, is that ok?
Not sure if we're on the same page. In your post you said:
i need to control 8 different output signals which need to be 12v positive.
And I believe I said use one mosfet for each load, including any dc to dc converters.
(assuming the mosfet rating matches the converter load rating)
You can have any number of different rated mosfets all switching 12V from the same
P.S.
I will draw my schema tomorrow to clarify my needs
This might be helpful
The easy way to do this is with a high-side drive IC like an MIC2981 all the work is done for you in a single package
Of course, it depends on how much output current you need!
As cedarlakeinstruments said; you can use and IC with built in drivers.
Alternative cold be to constuct your own (FETs can be used instead of bipolars):
Ref: High Side switching Raspberry PI with 3904 and 3906 transistors - Electrical Engineering Stack Exchange
Transistor types are not critical, nor resistor values.
So, control n-channel with arduino, which then drives the gate of p-channel? Did i get it right?
Would r1&r2 be ok with 4.7k and r3 10k?
Yes, spot on
The resistor values are not critical (unless you want to power your load in microseconds). FET gate current is miniscule, most of the current is charging/discharging the gate charge (~capacitance).
Ensure that the P-ch FET's gate-source voltage is not to much. As a rule of thumb limit to ~10V. You need to check the FET's data sheet, again not critical unless heavy loads or switching fast. Which I do not think applies accoding to your first posting.