radio.sleep();
LowPower.powerDown(SLEEP_4S, ADC_OFF, BOD_OFF);
SPIFlash flash(8,0);
flash.initialize();
flash.sleep();
Intersting - didn't know that. Check out the following from the data sheet though: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.
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.
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.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!
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?
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.
Hey Tom,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).
how would you go about doing a post-mortem? I'm really interested in what the root problem is as well.
Joe
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.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' ;)
Joe