LowPowerLab Forum

Hardware support => Moteino => Topic started by: E.Walker on June 11, 2018, 10:04:56 AM

Title: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 11, 2018, 10:04:56 AM
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.
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: TomWS on June 11, 2018, 10:23:40 AM
Have you configured all unused pins as INPUT_PULLUP to keep them from free floating?  That would cause considerable variability in power consumption.

Tom
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 12, 2018, 05:11:00 AM
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 ..
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: TomWS on June 12, 2018, 07:22:33 AM
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
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: 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.
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: TomWS on June 12, 2018, 03:35:00 PM
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
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 12, 2018, 03:45:30 PM
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);
}
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: TomWS on June 12, 2018, 04:40:08 PM
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...
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 12, 2018, 05:10:17 PM
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 ?
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: 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?
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: 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.
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 13, 2018, 02:58:55 AM
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 ?
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: LukaQ on June 13, 2018, 07:05:36 AM
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
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 13, 2018, 09:13:17 AM
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
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: LukaQ on June 13, 2018, 10:14:57 AM
lipo is your power for the moteino?
also try measuring on positive line, you can't have high resistance on ground one
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 13, 2018, 10:50:48 AM
Yes the LIPO is the power source

I was using the positive side before, but with the mooshimeter and the negative side I was able to measure voltage on the board at the same time.

I will redo the wiring to measure on the positive side tomorrow !
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 14, 2018, 09:45:11 AM
I made progress

I unsoldered all my mote + an old one R4 + a new one with flash

Results with the code below and a similar one with pullup enabled





1-----2-----3 (flash)4-----5-----6-----
output low3.52.53.23.8901100µA
input pullup (except D9 LED low)9394100962251280µA

My code may not be ok for the inputpullup enable, but it is not the point here.

The point is, it is the same behavior in both case if we look at relative value between the node

A new point is, the unsoldered #2 & #4 are OK now, they were not before unsoldering !

Last discovery before stopping for now, I can measure a steady 2kOHM between GND and 3.3V on the node 6 (the 1.2mA sleep ..) where it is much much much higher on the normal ones.
And 2kohm = 1.5mA at 3.3 ... see my point ?

I'm really starting to think I broke something during initial soldering of pin ect ....



#include <LowPower.h>
#include <SPI.h> 
#include <RFM69.h>     
#include <SPIFlash.h>

#define GATEWAYID   2
#define NODEID      3
#define NETWORKID   4
#define FREQUENCY     RF69_433MHZ
#define ENCRYPTKEY      "sampleEncryptKey"
#define IS_RFM69HW_HCW

#define LED           9 // Moteinos have LEDs on D9
#define FLASH_SS      8 // and FLASH SS on D8
 
RFM69 radio;
//SPIFlash flash(FLASH_SS, 0xEF30); //WINDBOND 4MBIT flash chip on CS pin D8 (default for Moteino)


void setup() {

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

 
radio.initialize(FREQUENCY,NODEID,NETWORKID);
radio.setHighPower(); //must include this only for RFM69HW/HCW!
radio.encrypt(ENCRYPTKEY);


 
//if (flash.initialize()) flash.sleep();

}

void loop() {
radio.sleep();
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
}
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: E.Walker on June 14, 2018, 01:14:42 PM
ok node 6 is ok now

=> C3 was dead (2kohm resistance)
=> replaced with 2.2µ (has it is the biggest I had in this format)
=> Working great :)

Node 1 C3 changed also

node 5 is more complicated


It seems that the process of bending a femalle header after soldering is a bad idea I had.
According to my collegue whos work is electronic in sensor, capacitor SMD are fragile, crack in it is problematic.
I probably damaged the component on the header side ....

At least, I have now 4 working node <10µA sleep current :)

EDIT: I abandon node 5, I will exchange it with another one not on battery !

I really hope this topic is closed :)
Title: Re: Moteino power consumption problem .. (and weather node)
Post by: LukaQ on June 14, 2018, 02:53:30 PM
Quote from: E.Walker on June 14, 2018, 01:14:42 PM
It seems that the process of bending a femalle header after soldering is a bad idea I had.
According to my collegue whos work is electronic in sensor, capacitor SMD are fragile, crack in it is problematic.
I probably damaged the component on the header side ....

At least, I have now 4 working node <10µA sleep current :)

EDIT: I abandon node 5, I will exchange it with another one not on battery !

I really hope this topic is closed :)
Am... YES! and YES!
that might brake more than just smd capacitors