Author Topic: Weathershield drawing .47ma  (Read 2603 times)

bruster999

  • Newbie
  • *
  • Posts: 16
Weathershield drawing .47ma
« on: February 05, 2016, 02:35:00 PM »
Hey Felix,
I have a Moteino with a WeatherShield 3v3 attached (soldered piggyback) and I'm using your lowpower.h to reduce power consumption. Even with just the sleep function running the unit is still drawing .47ma. It's odd because my Mailbox Notifier draws 1.4ua. I even tried the Mailbox sketch on the Weathershield Moteino but it still draws .47ua. What am I doing wrong?  I am measuring current with my Amprobe meter in series with the Vin line.

#include <LowPower.h>
void setup() {
//do stuff
}

void loop() {
  // put your main code here, to run repeatedly:
  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5635
  • Country: us
    • LowPowerLab
Re: Weathershield drawing .47ma
« Reply #1 on: February 05, 2016, 02:49:44 PM »
I provided a sample sketch here which should give you a low power consumption.

bruster999

  • Newbie
  • *
  • Posts: 16
Re: Weathershield drawing .47ma
« Reply #2 on: February 05, 2016, 03:07:14 PM »
I should have mentioned that I started with your sketch and in trying find the root cause I removed pretty much everything I could but even your sketch draws exactly the same power -.47ma...but it works great. I have it updating my Motieno Gateway regularly but I want to run it from a battery and this is too much current draw to do that.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5635
  • Country: us
    • LowPowerLab
Re: Weathershield drawing .47ma
« Reply #3 on: February 05, 2016, 03:55:12 PM »
Would have been nice to not solder them together and do the measurements afterwards. Now it's a bit more difficult to do any debugging.
I have pretty much the exact same setup (except I only soldered the actually connecting pins), same sketch, running from the attic at max TX (i think a RFM69HW, 20dBm). Been running on a lipo (1800mah) for the past 5-6 months or so and it's at 4.04v...never touched it.

bruster999

  • Newbie
  • *
  • Posts: 16
Re: Weathershield drawing .47ma
« Reply #4 on: February 05, 2016, 04:03:17 PM »
I was thinking the same thing regarding the overzealous solder job. LOL

If I were to de-solder it, could you give me any pointers on what to look for while debugging?
Bruster

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5635
  • Country: us
    • LowPowerLab
Re: Weathershield drawing .47ma
« Reply #5 on: February 07, 2016, 06:29:20 PM »
Measure the moteino first, then the weather shield, then together.
If coded for low power the moteino should draw very little current.

Also the power shield has a battery circuit (which a 10k+4.7k voltage divider) which should be shutoff by marking pin A3 as INPUT (high Z), and enabled (OUTPUT LOW) only when reading the battery on A7. Otherwise if you don't do this you can fully expect half a milliamp of usage through that resistor network.
You should power the setup via the GND and VIN with no more than 5V if you want valid battery readings.

bruster999

  • Newbie
  • *
  • Posts: 16
Re: Weathershield drawing .47ma
« Reply #6 on: February 08, 2016, 12:06:21 PM »
Felix,
Thanks for the tips.

I de-soldered the entire board then tested the Moteino. By itself it was drawing 1.4ua while using your recommended sketch. Perfect! I then added power and ground to the shield and it drew about the same current. I then reconnected the WeatherShield to the Motieno with just power and ground. Current draw was unchanged-1.4ua. I then soldered A7, SCL and SDA onto the Moteino and saw no change in the current draw.

Once I added pin A3 the current draw went way up. into the hundreds of micro-amps. The code to set A3 to INPUT/OUTPUT is in the sketch.

Any thoughts?
Thanks,
Bruster

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5635
  • Country: us
    • LowPowerLab
Re: Weathershield drawing .47ma
« Reply #7 on: February 08, 2016, 08:28:35 PM »
Here is a sample WM that is very low power, nothing unusual. I used female and male headers so I can plug/unplug whenever I need to:


Here is the code from the sample sketch I am running which is important to shutoff the battery circuit:

Code: [Select]
#define BATT_MONITOR_EN A3 //enables battery voltage divider to get a reading from a battery, disable it to save power
#define BATT_MONITOR  A7   //through 1Meg+470Kohm and 0.1uF cap from battery VCC - this ratio divides the voltage to bring it below 3.3V where it is scaled to a readable range
...
void readBattery()
{
  unsigned int readings=0;
 
  //enable battery monitor on WeatherShield (via mosfet controlled by A3)
  pinMode(BATT_MONITOR_EN, OUTPUT);
  digitalWrite(BATT_MONITOR_EN, LOW);

  for (byte i=0; i<5; i++) //take several samples, and average
    readings+=analogRead(BATT_MONITOR);
 
  //disable battery monitor
  pinMode(BATT_MONITOR_EN, INPUT); //highZ mode will allow p-mosfet to be pulled high and disconnect the voltage divider on the weather shield
   
  batteryVolts = BATT_FORMULA(readings / 5.0);
  dtostrf(batteryVolts,3,2, BATstr); //update the BATStr which gets sent every BATT_CYCLES or along with the MOTION message
  if (batteryVolts <= BATT_LOW) BATstr = "LOW";
}

I do nothing different, I have a RFM69W on one of these, and HW on another, the HW one has been running the longest without a charge.
One thing I probably missed to add is flash.sleep() when FLASH MEM is present, but already the chip is low power so that should not cause a problem.

There are a few things that have to be TRUE (when sleeping and not reading the battery) for the circuit to be low power:
- an A3 voltage reading must be HIGH (pulled up in HIGH-Z INPUT mode)
- A7 must be 0volts, as well as the tip of the little SOT23 mosfet
These are things you can easily verify.

filartrix

  • Newbie
  • *
  • Posts: 2
Re: Weathershield drawing .47ma
« Reply #8 on: March 06, 2016, 01:53:21 AM »
Hi Felix,
unfortunately I can confirm the same results of buster999.
In my configuration the moteino is supplied with +5V.
I've also verified that the voltage on pin A3 is HIGH, but not at 5V, only around 4.05V, and I've measured around 390uA flowing trough that pin. I've also tried to used different (digital pins) but there is the same problem.
A3 instead is at 0V (when not measurning)

I've double checked and in the code is present the command:
Code: [Select]
pinMode(BATT_MONITOR_EN, INPUT)
It seems that the arduino has an internal pulldown around 10k - 15k.
If there is any measurement that can be useful, please let me know.

Bye
Filippo

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5635
  • Country: us
    • LowPowerLab
Re: Weathershield drawing .47ma
« Reply #9 on: March 08, 2016, 08:42:00 AM »
unfortunately I can confirm the same results of buster999.
In my configuration the moteino is supplied with +5V.
I've also verified that the voltage on pin A3 is HIGH, but not at 5V, only around 4.05V, and I've measured around 390uA flowing trough that pin. I've also tried to used different (digital pins) but there is the same problem.
A3 instead is at 0V (when not measurning)
How do you supply 5v? To what pin? Can we see a schematic of what else you have wired?
A3 should be ~3.3v to keep the voltage monitor disabled and no current flow.