Author Topic: P-MOSFET switching and WeatherShield  (Read 1413 times)

markb

  • Newbie
  • *
  • Posts: 3
  • Country: au
P-MOSFET switching and WeatherShield
« on: July 31, 2016, 07:23:58 PM »
I am finalizing details for a battery-powered water tank level sensor (based around a 5v differential pressure sensor; MPX5050).

I intend powering the unit using a 9v battery; but only "switch on" the pressure sensor during a reading every 5-15 minutes or so (9v regulated down to 5v).

I have successfully prototyped this using a digital pin (plus a transistor/N_MOSFET - 2N7000) to control a P-MOSFET - BSH203.  My research indicated that a transistor or N_MOSFET was desirable between the digital pin and P-MOSFET to protect the pin from the switched voltage which is substantially above Vcc (in this case 9v). 

Here is an example article on the approach I am using - http://parttimeelectronics.blogspot.com.au/2016/06/basics-fet-as-switch-part-2.html.

My query actually relates to the design of the WeatherShield, which uses a digital pin to briefly switch on a P-MOSFET to take battery readings.  In WeatherShield's case, there is no intermediate transistor or N-MOSFET, even though Vin could be substantially higher than Vcc (such as 9v).  I don't want to include a transisitor/N-MOSFET if I don't really need it.

Could Felix (or other knowledgeable contributors) provide their perspective on WeatherShield's particular design considerations around that P-MOSFET component, and driving it directly from a pin in the case that Vin is 9v (I haven't been brave enough to hook up 9v to my moteino and drive the P-MOSFET directly off a pin yet - testing "off moteino" indicates that Vin will be present at the pin?!).

Mark

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: P-MOSFET switching and WeatherShield
« Reply #1 on: August 01, 2016, 07:45:47 AM »
The article you cite gives a reasonable and accurate representation of the issues and techniques to address them.  As you point out, switching a P Channel gate pulled up to Vin where Vin > VCC + 0.3V is a bad idea.  You should use an N Channel MOSFET in these cases. 

Note that you do not need an input resistor to the gate of the N Channel FET and the only reason for the pulldown on the N Channel FET is to cover the power-on case where the GPIO is floating until it is initialized as an output.

Tom

markb

  • Newbie
  • *
  • Posts: 3
  • Country: au
Re: P-MOSFET switching and WeatherShield
« Reply #2 on: August 01, 2016, 05:39:19 PM »
Thanks Tom for your advice.  I've come across dual MOSFETs that include a P and N MOSFET in a single package, which is useful.  Thanks also for confirmation about that resistor - I did wonder what purpose it served.

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: P-MOSFET switching and WeatherShield
« Reply #3 on: August 01, 2016, 08:58:25 PM »
Thanks Tom for your advice.  I've come across dual MOSFETs that include a P and N MOSFET in a single package, which is useful.  Thanks also for confirmation about that resistor - I did wonder what purpose it served.
Just keep an eye on the 'knee' of the transfer curves.  If P Channel only or N channel driving a P Channel gate, the 'knee' (where the curve just flattens out) on Vgs vs RDSon or Drain current, is less than or equal to 3V, you're ok.  Don't just look at the spec for Vgs 'on'.  This is misleading if the knee is 'soft' (roundy vs really sharp).  There are a lot of devices out there that spec a 2V Vgs On when 'on' means >3uA!

Tom

markb

  • Newbie
  • *
  • Posts: 3
  • Country: au
Re: P-MOSFET switching and WeatherShield
« Reply #4 on: August 02, 2016, 08:09:37 PM »
Thank you again Tom for your invaluable advice - very much appreciated.  Slowly but surely learning.

Mark