Moteino power consumption problem .. (and weather node)

Started by E.Walker, June 11, 2018, 10:04:56 AM

E.Walker

Hello again !

I have a new problem, for the past 5 month I've been playing with weather node in my house to monitor temperature and humidity (1 chamber, living room, bathroom + 1 spare node bought later).

Recently, I finaly took some time to investigate.

I have some node discharging more faster than other, and sometimes, much more faster ...

I'm using LIPO bat 1S900mah brand new (I got 4 of them)

I won a mooshimeter 3 years ago, and I decided to try measure power consumption with it.

here are my value, I know that the mooshimeter is not accurate enought, but see the interesting value

During sleep without weather shield ONLY MOTEINO 433 HCW (no flash)
Same software was flashed in the micro (custom, but close to Felix one)

NODE 1 = 0 (too small to be measured by the metter)
NODE 2 = 600µA
NODE 3 = 300µA
NODE 4 = 2000µA

When they wake up current raise and them get back to this value.

To be honest I ruled out :
- batteries
- weather shield
- software

The last topic that is left are my soldering skills ...

Can this be the results of "bad" soldering of plugs / pin / ect ... ?

I plan to unsolder every thing, get the moteino "naked" and do again measurement.

TomWS

Have you configured all unused pins as INPUT_PULLUP to keep them from free floating?  That would cause considerable variability in power consumption.

Tom

E.Walker

Hello,

I did not, but this is not in any examples..

Is enabling all the pull up will create consumption ?, I mean even if there are close to 50kohm that means 66µA for each channel right ?

EDIT: ok I took 1 hours to search more topics here and there ..
I'm going to try to play with my code tonight before unsoldering everything ..

TomWS

Quote from: E.Walker on June 12, 2018, 05:11:00 AM
Is enabling all the pull up will create consumption ?, I mean even if there are close to 50kohm that means 66µA for each channel right ?
No, if there is no place for the current to go then there is no current, other than miniscule leakage that would be far less than a floating input.   Think about the current drawn if you have one end of a 50K resistor tied to 3.3V and the other end tied to nothing...

Tom

perky

It's also worth noting that any inputs used for the ADC should also have their input buffers disabled.

Mark.

TomWS

Quote from: perky on June 12, 2018, 09:00:31 AM
It's also worth noting that any inputs used for the ADC should also have their input buffers disabled.

Mark.
That happens automatically when you do an analogRead(), but the pin is in basic INPUT mode until then.

Tom

E.Walker

I tried

- input pull up
- output and low to all pin
- a few other sketch ..

Still nothing ..

I get 1 node perfect
2 node arround 200 to 400µ
1 node at 1mA

I tried to unsolder my pins, still nothing

I took one last brand new moteino I'm keeping for another project, perfect results with it ...

Are you really sure I cannot mess with the µ with some bad soldering ?

1 thing however, A6 and A7 do not go to pullup, they are still float !
EDIT: Ok I saw that those a analog in only direct on the 328 and no pull up

I use this sketch

#include <SPI.h>     
#include <LowPower.h> 
#include <RFM69.h>  
   
#define LED           9 // Moteinos have LEDs on D9


RFM69 radio;
#define NETWORKID 1234
#define NODEID 999
#define FREQUENCY RF69_433MHZ


void setup () {

radio.initialize(FREQUENCY,NODEID,NETWORKID);
radio.setHighPower();
radio.sleep();


for (uint8_t i=0; i<=A7; i++) {
    pinMode(i, INPUT);
    pinMode(i, INPUT_PULLUP);
    //pinMode(i, OUTPUT);
    //digitalWrite(i, LOW);


}


pinMode(LED, OUTPUT);
digitalWrite(LED, LOW);

}

void loop () 
{
  //sleep MCU for 8seconds
  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}

TomWS

A few observations:
1. Node and Network are 8 bit values and therefore node=999 and network=1234 are invalid.
2. You call radio.setHighPower with no argument which will enable HW mode.
3. You initialize the pins AFTER you do radio.initialize and radio.sleep thereby invalidating the pin configurations made in those steps.
4. Your for loop to initialize the pins should go from 0 to 19 (not A7)

I won't mention the unnecessary pinMode before pinMode...

E.Walker

1 ok I changed to

#define NETWORKID 1
#define NODEID 1

2 Yes I have RFM69HCW variant, so I would be a mistake not to do it ?

3 I tried before, after, never, again and again ..

4 Yep, It was my last attemps, normaly I used A5 as in the lowpowerlab sketch example

The thing you won't mention, ok got it

So now I have this code,

#include <SPI.h>     
#include <LowPower.h> 
#include <RFM69.h>  
   
#define LED           9 // Moteinos have LEDs on D9


RFM69 radio;
#define NETWORKID 1
#define NODEID 1
#define FREQUENCY RF69_433MHZ


void setup () {

for (uint8_t i=0; i<=A5; i++) {
    pinMode(i, OUTPUT);
    digitalWrite(i, LOW);
}

radio.initialize(FREQUENCY,NODEID,NETWORKID);
radio.setHighPower();
radio.sleep();
}

void loop () 
{
  //sleep MCU for 8seconds
  LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
}


Results

- 2000µA
- 500
- 400
- (<<100)
too low for my metter

I can clearly see a difference with and without radio.sleep

A brand new moteino is also <<100 with just header on the prog side

Do I need to remove the LED ?

TomWS

Two final comments:
1. I believe the advice was to configure pinmode to INPUT_PULLUP.
2. Do you have a flash chip on these boards?   If so, why aren't they being initialized and put in sleep mode?

LukaQ

Why don't you just upload DeepSleep_usingLowPowerLibrary sketch and comment out #define WITH_SPIFLASH or remove flash part of the code?
with flas or without it, every mote I have was around 5uA.
No, you do not need to remove led as it is off.

E.Walker

#11
Quote from: TomWS on June 12, 2018, 06:58:41 PM
Two final comments:
1. I believe the advice was to configure pinmode to INPUT_PULLUP.
2. Do you have a flash chip on these boards?   If so, why aren't they being initialized and put in sleep mode?

1. I did both output and input, no change
2. No There is no flash chip on my board

Quote from: LukaQ on June 13, 2018, 01:27:17 AM
Why don't you just upload DeepSleep_usingLowPowerLibrary sketch and comment out #define WITH_SPIFLASH or remove flash part of the code?
with flas or without it, every mote I have was around 5uA.
No, you do not need to remove led as it is off.

Hello,

That is one of the first things I did, I get the same results for my 4 node as above ..


I've spend close to 10h trying to get things right, I'm going to keep trying for a while and then sell my weather shields :D
I'm better at moteino with power it seems :P, maybe send the 2mA sleep moteino to Felix to confirm I damaged the board somehow ...

Thank you

EDIT:
I have access to a DMM4050 multimetter at work, I will try to confirm the mooshimeter results ASAP
I confirmed the mooshimeter measurement using a DMM4050 multimeter

I used an unsoldering tool on the 2mA sleep one to remove the headers, I'm down to 1.3mA ...

I remember that I bent the header pin after soldering when I built those wheaternode, maybe I damaged the board creating leakage current ?

LukaQ

Don't know know about that, but how are you measuring then. Show us the setup. If one mote would be with higher current, then ok, something might be wrong with it. But all 4 is impossible IMO.

#include <LowPower.h>
#include <SPI.h>  
#include <RFM69.h>      
#define GATEWAYID   2
#define NODEID      3
#define NETWORKID   4
#define FREQUENCY     RF69_868MHZ
#define ENCRYPTKEY      "sampleEncryptKey" 
#define IS_RFM69HW_HCW

RFM69 radio;


void setup() {
 radio.initialize(FREQUENCY,NODEID,NETWORKID);
#ifdef IS_RFM69HW_HCW
  radio.setHighPower(); //must include this only for RFM69HW/HCW!
#endif
  radio.encrypt(ENCRYPTKEY);

    for (uint8_t i=0; i<=A5; i++)
  {
    if (i == RF69_SPI_CS) continue;
    pinMode(i, OUTPUT);
    digitalWrite(i, LOW);
  }

}

void loop() {
 radio.sleep();
 LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);

}
This gives me 7uA moteino with RFM, no flash
Also gives me 2mA with 3 sensors, that were not put to sleep as you can see from the code (or can't see)

Measured from +3.3v and +5v to mote, not in the ground loop, make sure you don't break the ground loop to do measurement there

E.Walker

Hello,

I uploaded your sketch with 1 modification
#define FREQUENCY     RF69_433MHZ

Results are the same, see picture

My setup is
- LIPO 1S 950mah batt
- JST (red) 2 pin connector
- Mutlimeter DMM4050
- Measuring amp throught the ground wire

Tomorrow I will take the other node at work and do the same measurement on them

LukaQ

lipo is your power for the moteino?
also try measuring on positive line, you can't have high resistance on ground one