Author Topic: Felix, why a mosfet on the weathersheild volt divider  (Read 1248 times)

gregcope

  • Full Member
  • ***
  • Posts: 161
  • Country: gb
Felix, why a mosfet on the weathersheild volt divider
« on: April 27, 2017, 02:47:20 AM »
Question for Felix or anyone who can offer some logic.

Why a mosfet on the Vcc voltage divider instead of very large resistors? 

Is it cost?  Or quiesant power consumption or?

Interested as I am planning something similar and so far have gone down the large resistor route.

Greg

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #1 on: April 28, 2017, 03:47:09 PM »
One problem with using large resistors is the time constant needed to charge the capacitor (which you will need so the AVR sees a low enough source impedance with its ADC). That can run into seconds to stabilize depending on the RC constant. So a better way is to use lower resistor values, like 10k/20k, and only turn the P-FET on when measuring. The RC constant for that is in the order of ms.

Mark.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5905
  • Country: us
    • LowPowerLab
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #2 on: April 28, 2017, 05:38:49 PM »
Greg, sorry i missed this.
The mosfet reasoning was to minimize the drain through the resistors.

There will be no more mosfet and in fact it was removed in the latest batches and a bridge was soldered instead.
I decided to just standardize the simple battery monitor to the following circuit which has worked very well and stable:

VBatt > 1MEG <A7> 2MEG + 0.1uF > GND

This gives a simple 66.6% of the vBat which yields a range of max 5V for the battery. If you have a bigger battery then you need other values or use another monitor since it will exceed the 3.3v on a Moteino analog pin (it would saturate the analog reading to the max 1023 value).

Also this will have a constant drain of around 1uA at 3.3v.

gregcope

  • Full Member
  • ***
  • Posts: 161
  • Country: gb
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #3 on: April 30, 2017, 08:56:02 AM »
Thanks Gents.

Did not know about the capacitor charge issue.  Will have to look at that.

Thanks for those values Felix, good to know something that works.

gregcope

  • Full Member
  • ***
  • Posts: 161
  • Country: gb
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #4 on: April 30, 2017, 12:34:56 PM »
@perky

I am planning a 40V voltage divider to check a 24 or 12v circuit;

VBatt > 27MEG <A7> 3.3MEG + 0.1uF > GND

Will this be a problem?

Present logic is do 10 readings and average.

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #5 on: May 06, 2017, 06:27:38 PM »
Sorry for the delay, been off doing things.. ;)

I think it would be OK, the Thevenin equivalent of that has a series resistance of about 3 megohms, and the 100nF cap will allow the processor to see a low impedance while it's sampling. Leakage current into the AVR will add a small offset, but that should be small. It won't measure fast changing signals because of the time constant, so be prepared to wait about 3 seconds after power-up before you read it.

Mark.

TomWS

  • Hero Member
  • *****
  • Posts: 1883
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #6 on: May 06, 2017, 07:21:28 PM »
@perky

I am planning a 40V voltage divider to check a 24 or 12v circuit;
I'm confused by this statement (emphasis mine).  What is the max voltage you'll have into the divider?  If it's 40V you'll forward bias your processor input pin which isn't a good thing, even at this low current.  You're ok if it's <= 30V.

Tom

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #7 on: May 06, 2017, 09:36:38 PM »
I'm confused by this statement (emphasis mine).  What is the max voltage you'll have into the divider?  If it's 40V you'll forward bias your processor input pin which isn't a good thing, even at this low current.  You're ok if it's <= 30V.
Tom

I'm confused too, I did the calcs based on 24V. So is it 40V, or 24V?

Mark.

gregcope

  • Full Member
  • ***
  • Posts: 161
  • Country: gb
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #8 on: May 07, 2017, 04:42:25 AM »
Sorry. Should have been clearer. 

It is for a nominal 24v system that could be under boost charging, which could take it upto 30V.  It should not go near 40V, but decided to add a margin.

Is that cleaere/okay?

I do not need to measure for a while after boot.

perky

  • Hero Member
  • *****
  • Posts: 871
  • Country: gb
Re: Felix, why a mosfet on the weathersheild volt divider
« Reply #9 on: May 07, 2017, 06:14:44 AM »
OK. In which case it would be best to keep the voltage at the ADC les than 3.3V, so maybe use 27M and 2M2 instead. These are quite high values though so keep an eye on leakage specifications, including the capacitor.

Mark.