Author Topic: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield  (Read 7916 times)

ssmall

  • Full Member
  • ***
  • Posts: 112
  • Country: us
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #15 on: January 03, 2017, 04:20:20 PM »
Those two P-fets look like they are surface mounted.  How would I find ones that I could try out on a breadboard?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5138
  • Country: us
    • View Profile
    • LowPowerLab
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #16 on: January 03, 2017, 04:26:49 PM »
Just look for a P-FET with low Rds resistance.

perky

  • Hero Member
  • *****
  • Posts: 831
  • Country: gb
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #17 on: January 03, 2017, 07:25:10 PM »
Don't forget you'll also need an N-channel FET to turn that top P-channel FET on. And if you do it that way you'd be better off using lower value resistors like 10k:20k and maybe a 10nF cap rather than 100nF to give a low RC constant for charging that cap.
Mark.

ssmall

  • Full Member
  • ***
  • Posts: 112
  • Country: us
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #18 on: January 04, 2017, 10:54:31 AM »
perky, thanks for feedback.  I understand lowering the value of the resistors and using a smaller cap so that the charging time is reduced.  I didn't know I would need another N-channel FET to turn the P-channel FET on, not sure how I would hook that up.  I found the following article that explains how to use a P-FET to measure voltage: http://fettricks.blogspot.com/2014/01/reducing-voltage-divider-load-to-extend.html
Going the transistor route seems more straight forward to me although I understand the drawback is that the transistor leaks current.

I did find this P-FET at Mouser http://www.mouser.com/ds/2/427/91080-69932.pdf  It has an Rds resistace of 3 ohms.

perky

  • Hero Member
  • *****
  • Posts: 831
  • Country: gb
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #19 on: January 04, 2017, 12:55:12 PM »
You can use the pulsed gate approach with the capacitor as shown in your links, but personally I'd use an N-channel FET. What you're creating is a high side load switch:
http://www.mbedded.ninja/electronics/circuit-design/power-management/load-switches

BTW the criteria you're looking for is low RDSon, and low gate threshold Vgs (especially for the N-channel FET which has to work at logic levels). The P-FET you posted has way too high Vgs.

Mark.

ssmall

  • Full Member
  • ***
  • Posts: 112
  • Country: us
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #20 on: January 04, 2017, 05:53:19 PM »
The circuit you posted looks understandable.  :D  As far a a P-FET I found this one: http://www.mouser.com/ds/2/149/NDP6020P-1011713.pdf The data sheet says it is a logic level FET.

Thanks again for the help.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5138
  • Country: us
    • View Profile
    • LowPowerLab
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #21 on: January 05, 2017, 07:52:51 AM »
The NPN is only needed if you want to drive your load from an active HIGH logic. Otherwise you can directly do it from a digital pin with inverted logic (p-fet is active low). It's a bit less intuitive and the pin has to be left HIGH-z (arduino pin set to INPUT, and write HIGH to it to turn the pfet switch OFF).
But yeah otherwise use a NPN to drive it just as any other active high load.

perky

  • Hero Member
  • *****
  • Posts: 831
  • Country: gb
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #22 on: January 05, 2017, 08:43:04 AM »
The NPN is only needed if you want to drive your load from an active HIGH logic. Otherwise you can directly do it from a digital pin with inverted logic (p-fet is active low). It's a bit less intuitive and the pin has to be left HIGH-z (arduino pin set to INPUT, and write HIGH to it to turn the pfet switch OFF).
But yeah otherwise use a NPN to drive it just as any other active high load.

Remember that the I/O pin cannot go above Vdd+0.3V of the processor, otherwise the substrate diode will conduct and your P-FET will be permanently on (assuming you're switching a voltage that is above Vdd). You either need a capacitor in series with the I/O pin to create a pulse or limit the voltage on that pin by driving an NPN or N-FET to turn the P-FET on.
Mark.

perky

  • Hero Member
  • *****
  • Posts: 831
  • Country: gb
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #23 on: January 05, 2017, 08:58:51 AM »
@ssmall BTW the NDP6020P you quoted has a Vgs max of +/- 8V, you'll violate that spec if you're swiching voltages above 8V unless you use an additional resistor to create a voltage divider. I'd choose one with +/- 20V spec. Also very low RDSon is not really needed if you're switching into a 10k load, even 10 ohms RDSon would only represent a 0.1% error. What you need is a P-FET with a low enough gate threshold to ensure it is hard on under lowest voltage switching conditions and with a max Vgs that is above your maximum swiching voltage.
Mark.
« Last Edit: January 05, 2017, 09:01:31 AM by perky »

ssmall

  • Full Member
  • ***
  • Posts: 112
  • Country: us
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #24 on: January 05, 2017, 06:02:41 PM »
@perky The input voltage will be a max of 6V.  I found this P-FET that has a Vgs of +/- 20, an RDSon of 10 ohms a Vgs(th) min -1 to max -2.  http://www.mouser.com/ds/2/268/TP2104%20C081313-846395.pdf  I am not confident I am looking at the correct values on the data sheet.  :o
I also want to make sure I get an Enhancement type P-FET, correct?  I have also been reading up how FETs work.  Thanks again

perky

  • Hero Member
  • *****
  • Posts: 831
  • Country: gb
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #25 on: January 05, 2017, 08:26:41 PM »
This won't do unfortunately, the TO92 P-FETs appear to have a very high zero gate voltage drain current (i.e. leakage). The best ones for through-hole appear to be TO220. Try this, it has low leakage, low RDSon and low gate threshold:
http://www.infineon.com/dgdl/Infineon-SPP15P10PLH-DS-v01_04-en.pdf?fileId=db3a304325afd6e001264b6ae1090c81

Mark.



ssmall

  • Full Member
  • ***
  • Posts: 112
  • Country: us
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #26 on: January 15, 2017, 08:45:10 PM »
I wanted to report back on my progress.  I was able to implement both circuits successfully.   :)  I do have a few more questions.

1) Why is a resistor needed between the Gate and Source of the FET(s)?
2) I had to put a 200ms delay after pin A3 is set to LOW and the analog measurements are taken.  Is that because the capacitor needs to charge?  I am using a .1uf cap in parallel with a 470k resistor, just like the picture.

Thanks for the help.  This has been a great learning experience.

perky

  • Hero Member
  • *****
  • Posts: 831
  • Country: gb
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #27 on: January 16, 2017, 12:05:35 PM »
Can you post the schematic of the circuit you're using? Setting A3 low implies you're driving the gate of the PET directly from the MCU. If the voltage your trying to measure is above the MCU's Vcc the FET might be on permanently. The resistor is because the gate is usually driven by an open drain or open collector signal, or at least one with capacitor in series from an MCU pin.

Post the circuit and it'll be easier to discuss.

Mark.

ssmall

  • Full Member
  • ***
  • Posts: 112
  • Country: us
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #28 on: January 16, 2017, 09:03:24 PM »
Mark, attached is a diagram of the circuit I built to monitor the battery voltage.  I basically eliminated the N-Channel FET from the load-switch diagram you posted.

-Steve

perky

  • Hero Member
  • *****
  • Posts: 831
  • Country: gb
    • View Profile
Re: Battery monitor/sensing ratio calculation on MotionMote/WeatherShield
« Reply #29 on: January 17, 2017, 08:19:41 AM »
OK, thanks for the diagram.

Firstly the MCU has things called substrate diodes, basically these are diodes at an I/O pin that stop the voltage on it going above Vcc+0.3V or below GND-0.3V. If the input to A3 goes above the MCU's Vcc by 0.3V the diode will conduct, and the voltage at A3 will be clamped to Vcc + 0.3V. Let's ay your Vin is 6V and Vcc is 3.3V, this means the A3, and hence the gate, will be at 3.6V and current will flow through the resistor (in this case with a 10k resistor it will be about 240uA). It also means the FET will be permanently on.

There are two solutions to this, either place a capacitor in series at the A3 pin which will create a negative going pulse on the gate due to the RC constant it creates with the resistor, or use an open drain or open collector driver such as the N-channel FET to drive the gate. In either case you prevent voltages at the A3 pin going above Vcc+0.3V.

Also as you saw the capacitor will need to charge up, and the RC constant for that depends on the values of your potential divider resistors and the capacitor value. This constant is quite long in your diagram. If you are going to switch the supply you don't need high value resistors for this (and 100nF is probably excessive), it would be better to use maybe 10k and 4k7 resistors and a 10nF capacitor, that means you'll only need to wait about 3ms to get a stable voltage.

Mark.
« Last Edit: January 17, 2017, 08:27:29 AM by perky »