Author Topic: High sleep power consumption with some moteinos  (Read 3123 times)

joelucid

  • Hero Member
  • *****
  • Posts: 869
High sleep power consumption with some moteinos
« on: May 23, 2015, 09:35:06 AM »
I've had to change batteries in a couple of moteinos recently - much too early from my calculations. When testing I've found these Moteinos to use ~180 ua in sleep mode, much more power than the 6-7ua I'm usually getting. That's with the same software. All these Moteinos are from the last batch I had ordered with SPIFlash chip.

I use the following code to sleep:

Code: [Select]
		
radio.sleep();
LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);

I also put all pins into INPUT mode.

Since the flash chip is the obvious difference and I don't even use it I tried to explicitly put that to sleep using:

Code: [Select]
SPIFlash flash(8,0);
flash.initialize();
flash.sleep();

This reduces power consumption to 37 ua - still way too high. I suspected that pin 8 was left in OUTPUT which might waste energy so I switched that to input after sleeping the flash, but that pulls it up to 180 ua again.

Frustrated I soldered off the flash but sleep power use stays at 37ua.

Any ideas what could be causing this?

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: High sleep power consumption with some moteinos
« Reply #1 on: May 23, 2015, 09:44:27 AM »
Joe,
you might actually be hurting yourself by putting the pins to INPUT.  If it is a true input, then set it for either pullup or pulldown, defiinitely NOT floating - that will kill your power consumption.  If it's an output and isn't driving a resistive load, leave it as an output.  This won't consume power if it's feeding a MOSFET input and will prevent those lines from floating.

Also, in your code you show powerdown for 4 seconds, is that all you sleep or do you have the powerdown call inside a loop to extend the time?

Tom

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: High sleep power consumption with some moteinos
« Reply #2 on: May 23, 2015, 10:19:41 AM »
Intersting - didn't know that. Check out the following from the data sheet though:

14.2.6 Unconnected Pins
If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, floating inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (Reset, Active mode and Idle mode).

Seems that INPUT without pullup is ok during sleep and probably still better than OUTPUT in that case.


joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: High sleep power consumption with some moteinos
« Reply #3 on: May 23, 2015, 10:31:16 AM »
I checked out a couple more of my Moteinos: not all of the flash chip equipped ones have the problem. In fact after refreshing all moteinos I can only reproduce the problem with one of them.

This Moteino is used as outside hygrometer. Now I've had one similar problem with another outside Moteino: I had one on the top of the sewage container unprotected and since it got very humid in there it stopped working after a while due to shorts. When I recovered it, the moteino still worked, but now used >1ma of sleep power. This problem was fixed by potting the electronics in epoxy for the next version.

So maybe outside weather causes subtle defects in the atmega chip causing these problems? Anybody seen anything like that before?

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: High sleep power consumption with some moteinos
« Reply #4 on: May 23, 2015, 11:01:20 AM »
Intersting - didn't know that. Check out the following from the data sheet though:

14.2.6 Unconnected Pins
If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, floating inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (Reset, Active mode and Idle mode).

Seems that INPUT without pullup is ok during sleep and probably still better than OUTPUT in that case.
Putting the INPUT pin to pinMode(pin,INPUT_PULLUP) does set the pin to "a defined level".  Leaving them float (as in INPUT mode) is 'undefined' and the wrong thing to do.  Also, if the OUTPUT is not pulling current (due to resistive or bipolar load) then it takes NO current to keep it at that state.

I checked out a couple more of my Moteinos: not all of the flash chip equipped ones have the problem. In fact after refreshing all moteinos I can only reproduce the problem with one of them.

This Moteino is used as outside hygrometer. Now I've had one similar problem with another outside Moteino: I had one on the top of the sewage container unprotected and since it got very humid in there it stopped working after a while due to shorts. When I recovered it, the moteino still worked, but now used >1ma of sleep power. This problem was fixed by potting the electronics in epoxy for the next version.

So maybe outside weather causes subtle defects in the atmega chip causing these problems? Anybody seen anything like that before?
Yeah, unfortunately, I have.  And it was similar condition, I had a soil moisture sensor that I hadn't assembled properly and was humid inside the enclosure.  It stopped working after a day and, when I took it apart, found that the ATmega328P had 'hair' growing on half of its pins, the beginnings of some serious corrosion! 

I removed the circuit board, thoroughly cleaned with 91% IPA, let it dry and then dipped the whole thing in spar varnish.  I think cleaning was the secret because I am now 'religious' about cleaning all my Moteinos and haven't had a problem since.  I suspect, but haven't confirmed with Felix, that there is 'no clean' flux residue on the board and it's reacting to the high humidity.  Washing with IPA is highly recommended, especially if it's an outdoor circuit.

Tom

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5961
  • Country: us
    • LowPowerLab
Re: High sleep power consumption with some moteinos
« Reply #5 on: May 23, 2015, 09:38:10 PM »
I've had Moteinos used outside although not directly exposed. Ie mailbox or the sump pump are high humidity areas. Never had a real issue or significant corrosion. There is no-clean flux used in the paste. They are not designed to sit in high humidity environments, and any such electronics need to be treated with a special coating as Tom indicated.

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: High sleep power consumption with some moteinos
« Reply #6 on: May 24, 2015, 04:21:10 PM »
Cleaning this Moteino didn't result in any improvement. Since this one seems to have been permanently damaged for low power application I'm now using it for a non battery application (as I've also done with the old sewer tank Moteino). I've coated a working Moteino and will now use that for the outside hygrometer.


TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: High sleep power consumption with some moteinos
« Reply #7 on: May 24, 2015, 06:20:16 PM »
Cleaning this Moteino didn't result in any improvement. Since this one seems to have been permanently damaged for low power application I'm now using it for a non battery application (as I've also done with the old sewer tank Moteino). I've coated a working Moteino and will now use that for the outside hygrometer.
Bummer!  Too bad this isn't a 'spare' Moteino so a post mortem could be done...  It would be nice to know the root cause of the increased power consumption.

Tom

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: High sleep power consumption with some moteinos
« Reply #8 on: May 26, 2015, 07:06:47 AM »
Hey Tom,

how would you go about doing a post-mortem? I'm really interested in what the root problem is as well.

Joe

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: High sleep power consumption with some moteinos
« Reply #9 on: May 26, 2015, 09:56:24 AM »
Hey Tom,

how would you go about doing a post-mortem? I'm really interested in what the root problem is as well.

Joe
I'd do what you've already started, take off one part at a time and measure the incremental power consumption after thoroughly inspecting the board under the removed part for any corrosion bridges - don't replace the removed devices as you go step by step.  Taking off the ATmega328P last.  Needless to say you'll probably end up with a totally dead board in the process (maybe even before the 328P is removed, but I doubt it).

Frankly, that the part went to high power consumption and didn't return to normal after cleaning it leaves that board's integrity in doubt anyway.

Tom

joelucid

  • Hero Member
  • *****
  • Posts: 869
Re: High sleep power consumption with some moteinos
« Reply #10 on: May 29, 2015, 07:56:54 AM »
Amazing: today I gave the old sewage pit moteino a thorough wash in ethanol using a toothbrush and that fixed it! With that success I cleaned the outside thermometer Moteino two more times - but that still has the problem.

Joe

TomWS

  • Hero Member
  • *****
  • Posts: 1892
Re: High sleep power consumption with some moteinos
« Reply #11 on: May 29, 2015, 11:36:55 AM »
Amazing: today I gave the old sewage pit moteino a thorough wash in ethanol using a toothbrush and that fixed it! With that success I cleaned the outside thermometer Moteino two more times - but that still has the problem.

Joe
It may be corrosion under the device... Only possibility to clean, without unsoldering parts, is to bring the board to a jeweler and see if they'd be willing to do an ultrasound clean.  Uh, don't tell them if the board has been in your 'sewage pit'  ;)

Tom