WeatherShield low power

Started by Jim111, February 15, 2015, 01:23:56 PM

Jim111

I have been playing around with the new WeatherShield.  It works great and I really like the proto type area on the board to add additional small circuits.

I'm trying to get the low power state under 200-300ua and having some problems.  First, I noticed that the voltage divider was always on when the mote is plugged into the USB 5v supply.  From some investigation I find that A3 just can't go high enough to turn off the p-FET completely with a 5.1volt supply - does this makes sense?  If I run it on a 3.7v lipo, then A7 does go to zero volts ( or very close - .7mv ) and the voltage divider is off.  Using 3 AAA cells, the voltage divider is still on, again since A3 can't go high enough.  Since I am using a lipo battery, this seems to be working for me.  Am I missing anything here that would allow the p-FET to switch off on higher Vin's?

Also, something else seems to be consuming power.  Is there a low power mode for the Si7021 or the BMP180 that I should try?   I am using the LowPower.powerDown library and I had about 15ua current flow just on the Mote alone without the weathershield.  Any thoughts appreciated here?

thanks
Jim

Jim111

Update -  I had commented out the code to initialize the flash while debugging other initialization problems.  Once I put that code back in, sleep current dropped to 36ua.  I am happy with that. 

It's 180ua sleep current if I run on 3AAA's versus the lipo at 36 ua.

Felix

Hi Jim,
As seen in the WeatherShield.ino sketch, here's how you turn ON the P-mos to read the voltage:

  //*************** READING BATTERY VOLTAGE *********************
  //turn MOSFET ON and read voltage, should give a valid reading
  pinMode(A3, OUTPUT);
  digitalWrite(A3, LOW);
  Serial.print("  BATT: ");
  Serial.println(analogRead(A7));
  pinMode(A3, INPUT); //put A3 in HI-Z mode (to allow mosfet gate pullup to turn it OFF)
  //*************** READING BATTERY VOLTAGE *********************


You have to make sure the A3 switch is HI-Z otherwise the Pmos will be closed and allow current to flow. It is a very sensitive Pmos and almost anything will turn it on (Vgs). HiZ on A3 will allow the gate to be pulled up to Vin and hence open the switch and turn off the voltage divider.


And yes there are low power modes for the sensors, although they are quite low power already in standby. For more savings please see the datasheets and the libraries.

Jim111

Hi Felix,

I still can't get the voltage divider to turn off while running at 5volts vcc using the usb adapter.  I am running the WeatherShield exactly as it is on github so A3 should be high Z mode.  I see about 3.9 volts on A3 , 3.4 volts on A7 with vin at 5.1v.  pmos s to g is 1.02 volts. Using a 3.7v lipo battery the voltage divider does turn off.

I have the pins gnd through A3 connected from the motino to the weathershield and no other connections.

Any thoughts?

Felix

#4
OK, I think you found a "bug" :P
Basically when the voltage is higher than about 4.3-4.5V the Vgs is too large and the PMOS stays ON, it's that sensitive - the Vgs (ON state) for this PMOS is (min -0.4 to max -1V).
To fix this for most cases where we expect a battery range from 3.5 to 5V+ we can replace the 10K pullup on the gate with a 1K, as seen in photo attachment.
But otherwise the PMOS should turn off when a LiPo battery voltage is used, or less than 4.5v.
I have a large batch of WeatherShields with 10K gate pullups, I need to decide whether I want to fix all these by hand :P
I will fix the current batch to replace the 10K with 1Ks. The first batch was only 36 units that are out there in the wild and will likely not need this fix if they run off battery of less than 4.5V.
I've updated the schematic to reflect this change:
WeatherShield schematic by Felix Rusu, LowPowerLab.com, on Flickr

Jim111

Hi Felix,

Thanks for checking into this so quickly.  As you mention this shouldn't be a problem for me on my lipo batteries.   It is good to hear that a simple 1k resistor substitution will fix the problem.  I guess for a higher vin over 5v you might need something like an additional transistor to switch on and off the gate - although I am not a hardware engineer but I did see a circuit on another forum with an npn transistor to turn the gate on and off when using a 15v supply.

kobuki

Analog design is not my forte either, but wouldn't the following work?

        4k7           10k
Vin---/\/\/\/---+---/\/\/\/---A3
                |
                |
                A7

No transistors of any kind. A3, A7 are normally input, thus Hi-Z and floating, drawing no power. When measuring, A3 is set to output, low and thus grounding the right side of the R network. While A3 switched to L, a measurement can be taken on A7. I'm hoping that experienced folks say something about the feasibility of this solution.

Felix

Quote from: Jim111 on February 16, 2015, 11:50:37 AM
Thanks for checking into this so quickly.  As you mention this shouldn't be a problem for me on my lipo batteries.   It is good to hear that a simple 1k resistor substitution will fix the problem.  I guess for a higher vin over 5v you might need something like an additional transistor to switch on and off the gate - although I am not a hardware engineer but I did see a circuit on another forum with an npn transistor to turn the gate on and off when using a 15v supply.
Yes a transistor would work but would increase the BOM and take more space. May be a consideration for R2. But this divider will saturate the range of A7 when exceeding 3.3V (ie when VIN is about 5.3V or so). So it's really meant to be used only with batteries under 5V. The reasoning behind that is that the larger VIN is the less efficient it becomes for the Moteino linear regulator.

Quote from: kobuki on February 16, 2015, 12:18:03 PM
Analog design is not my forte either, but wouldn't the following work?
        4k7           10k
Vin---/\/\/\/---+---/\/\/\/---A3
                |
                |
                A7

Not really, you would sink current into A3 and A7 when in HI-Z, depending on how high the voltage then it could be a LOT :)

kobuki

Well, yeah. Good ol' Jeelabs has been through it and back...

http://jeelabs.org/2013/05/17/zero-powe-battery-measurement/
http://jeelabs.org/2013/05/18/zero-power-measurement-part-2/

That circuit with the MOSFET is awfully familiar from a certain design :-X

Felix


A

Quote from: kobuki on February 16, 2015, 03:12:25 PM
Well, yeah. Good ol' Jeelabs has been through it and back...

http://jeelabs.org/2013/05/17/zero-powe-battery-measurement/
http://jeelabs.org/2013/05/18/zero-power-measurement-part-2/

That circuit with the MOSFET is awfully familiar from a certain design :-X


Quote from: A on February 25, 2014, 09:14:15 PM
I'm thinking of using a mosfet off of D3 to turn on and off all of the non-1-wire sensors. Anyone see an issue with this? I might even add in a second fet in the style of http://jeelabs.org/2013/05/18/zero-power-measurement-part-2/ to rework the battery sensor pin.

Felix, and anyone else who wants to chime in, do you have a preferred SMD mosfet? It looks like p-channel is ideal for the battery voltage sensing, but I am more flexible for the sensor power.

It sure does look familiar ;)

DPBaker

Did changing the resistor from 10k to 1k have any effect on the voltage reading that one would see on the analog input?

I have a moteino & weathershield running from USB (so presumably 5V DC though I don't have my multimeter handy) and running the WeatherShield sketch. I see the following output:

************ Si7021 *********************************
C: 3134   F: 8843   H: 64%   DID: 21  BATT: 966
************ BMP180 *********************************
provided altitude: 218 meters, 716 feet
C: 31.46    F:88.63
abs pressure: 999.87 mb, 29.53 inHg
relative (sea-level) pressure: 1026.15 mb, 30.31 inHg
computed altitude: 218 meters, 716 feet
*****************************************************

A BATT reading of 966 indicates 9.66V DC? If so, that seems far too high. Or is the analog reading directly in V DC?
(I just bought 8 of the moteino units & weathershields so am guessing I have modified shields)

Felix

966 means 966 out of 1023, or 95% of acceptable range.
The ratio of the resistor voltage divider of the voltage reader is BATT > 4.7K > A7 (this reads your 966) > 10K > GND.
The resistor divider is there to make sure your voltage is below 3.3V which is the voltage the Moteino runs at. If you pass in a voltage more than that your analog range will max out.

rosswakelin

Hmmm, this explains a lot.

I started off with Motes and ds18b20 sensors, powered from a 9V PP9 battery.  I was getting months of battery life.
I "upgraded" to the weathershield, and now my battery life is less than two weeks.

Recommendations?

Felix

Ross,
The sensors on the weather shield are very low power even if you don't do anything. There is a mosfet driven battery monitor on the WS which is 0 power unless you pull down A3 to enable it. Make A3 hi-z (input) to disable the battery monitor. I don't see any reason other than code not being low power that would cause a weather shield to draw any significant amounts of power.