Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. High Power Consumption without any reason.

High Power Consumption without any reason.

Scheduled Pinned Locked Moved Hardware
4 Posts 3 Posters 1.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DerManni
    wrote on last edited by DerManni
    #1

    Hello Guys,

    I made a MySensor-Sensor out of an Arduino Pro Mini 3V3 8Mhz Clone a BME280 and a NRF24L01 module. During sending the data my power consumption is about 17-18mA, which is often mentioned in the forum.
    But in sleepmode there is a much higher power consumption of 4mA than I expected and also mentioned in the topics.

    Could you please give me a hint where I had to look for the high power consumption? LED and Regulator are removed.

    My Code:

    // Enable Debugging
    #define MY_DEBUG            //for MySensors connection problems
    #define PROG_DEBUG          //for code debugging
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    
    //MySensors Identification (necessary before MySensors.h)
    #define MY_NODE_ID 1
    
    #include <SPI.h>
    #include <MySensors.h>
    #include <Seeed_BME280.h>
    #include <Wire.h>
    
    BME280 bme280;
    
    //MySensors Sensors Identification
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define CHILD_ID_BARO 2
    #define CHILD_ID_VOLTAGE 254
    
    //For battery voltage measurement
    int BATTERY_SENSE_PIN = A0;       // select the input pin for the battery sense point
    //unsigned long SLEEP_TIME = 5*60000;   // sleep time between reads (seconds * 1000 milliseconds)
    unsigned long SLEEP_TIME = 10000;   // sleep time between reads (seconds * 1000 milliseconds)
    float VinMax = 3.23;          //VinMax calculated from VoltageDivider with 1,1V as referenz (A0);
    float VinMin = 2.6;           //VinMin is 1xCR2450 2.6V
    float VrefMulti = 0.0031543;       //calculated from VinMax/1023
    
    //R1 = 910000;      Voltage Divider R1
    //R2 = 470000;      Voltage Divider R2
    
    // Set this offset if the sensor has a permanent small offset to the real temperatures
    //#define SENSOR_TEMP_OFFSET 0
    
    bool metric = true;
    
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msgBaro(CHILD_ID_BARO, V_PRESSURE);
    MyMessage msgVoltage(CHILD_ID_VOLTAGE, V_VOLTAGE);
    
    
    void presentation()  
    { 
      // Send the sketch version information to the gateway
      sendSketchInfo("BME280", "1.1");
    
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);
      present(CHILD_ID_BARO, S_BARO);
      present(CHILD_ID_VOLTAGE, S_MULTIMETER);
    
      metric = getControllerConfig().isMetric;
    }
    
    
    void setup()
    {
      if(!bme280.init()){
        Serial.println("BME280 Could not be initialised!");
      }
      else {
        Serial.println("BME280 initialised!");
      }
      analogReference(INTERNAL);          // use the 1.1 V internal reference
        
    }
    
    
    void loop()      
    {  
      Serial.println("Waking up...");
      #ifdef PROG_DEBUG
        unsigned long StartTime = millis();
        Serial.println("------NEW READING------");
      #endif
    
      //calculate values
      int sensorValue = analogRead(BATTERY_SENSE_PIN);
      float batteryV  = sensorValue * VrefMulti;
      int Vref0 = (VinMin / VrefMulti);
      float VrefPcnt = (1023 - Vref0) / 100;
      int batteryPcnt = static_cast<int>(((batteryV-VinMin)/(VinMax-VinMin))*100);;
      //Send Battery Voltage
      send(msgVoltage.set(batteryV, 1));
    
      #ifdef PROG_DEBUG
        //Voltage-Stuff
        Serial.println("-----Voltage-Stuff-----");
        Serial.print("A0-Reading:        ");
        Serial.println(sensorValue);
        Serial.print("VinMax:            ");
        Serial.println(VinMax);
        Serial.print("VinMin:            ");
        Serial.println(VinMin);
        Serial.print("Vref0:             ");
        Serial.println(Vref0);
        Serial.print("VrefPcnt:          ");
        Serial.println(VrefPcnt);
        
        //Battery-Stuff
        Serial.print("Battery Voltage:   ");
        Serial.print(batteryV);
        Serial.println(" V");
    
        Serial.print("Battery percent1:  ");
        Serial.print(batteryPcnt);
        Serial.println(" %");
        Serial.println("-----------------------");
      #endif
        sendBatteryLevel(batteryPcnt);
        
          
      // Get temperature from BME280
      float temperature = bme280.getTemperature();
        send(msgTemp.set(temperature, 1));
      #ifdef PROG_DEBUG
        Serial.print("Temp:              ");
        Serial.print(temperature);
        Serial.println("C");
      #endif
      
      // Get humidity from BME280
      float humidity = bme280.getHumidity();
        send(msgHum.set(humidity, 1));
      #ifdef PROG_DEBUG
        Serial.print("Humidity:          ");
        Serial.print(humidity);
        Serial.println("%");
      #endif
      
      // Get pressure from BME280
      float pressure = (bme280.getPressure()/100);
      send(msgBaro.set(pressure, 1));
      #ifdef PROG_DEBUG
        Serial.print("Pressure:          ");
        Serial.print(pressure);
        Serial.println("hPa");
      #endif
      
      #ifdef PROG_DEBUG
        unsigned long CurrentTime = millis();
        unsigned long ElapsedTime = CurrentTime - StartTime;
        Serial.print("Looptime:          ");
        Serial.print(ElapsedTime);
        Serial.println("ms");
      #endif
    
      // Sleep for a while to save energy
      Serial.print("Going to sleep for (Seconds): ");
      Serial.println(SLEEP_TIME/1000);
      sleep(SLEEP_TIME); 
    }
    

    Thanks in advance.
    Tom

    S 1 Reply Last reply
    0
    • D DerManni

      Hello Guys,

      I made a MySensor-Sensor out of an Arduino Pro Mini 3V3 8Mhz Clone a BME280 and a NRF24L01 module. During sending the data my power consumption is about 17-18mA, which is often mentioned in the forum.
      But in sleepmode there is a much higher power consumption of 4mA than I expected and also mentioned in the topics.

      Could you please give me a hint where I had to look for the high power consumption? LED and Regulator are removed.

      My Code:

      // Enable Debugging
      #define MY_DEBUG            //for MySensors connection problems
      #define PROG_DEBUG          //for code debugging
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      
      //MySensors Identification (necessary before MySensors.h)
      #define MY_NODE_ID 1
      
      #include <SPI.h>
      #include <MySensors.h>
      #include <Seeed_BME280.h>
      #include <Wire.h>
      
      BME280 bme280;
      
      //MySensors Sensors Identification
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_BARO 2
      #define CHILD_ID_VOLTAGE 254
      
      //For battery voltage measurement
      int BATTERY_SENSE_PIN = A0;       // select the input pin for the battery sense point
      //unsigned long SLEEP_TIME = 5*60000;   // sleep time between reads (seconds * 1000 milliseconds)
      unsigned long SLEEP_TIME = 10000;   // sleep time between reads (seconds * 1000 milliseconds)
      float VinMax = 3.23;          //VinMax calculated from VoltageDivider with 1,1V as referenz (A0);
      float VinMin = 2.6;           //VinMin is 1xCR2450 2.6V
      float VrefMulti = 0.0031543;       //calculated from VinMax/1023
      
      //R1 = 910000;      Voltage Divider R1
      //R2 = 470000;      Voltage Divider R2
      
      // Set this offset if the sensor has a permanent small offset to the real temperatures
      //#define SENSOR_TEMP_OFFSET 0
      
      bool metric = true;
      
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      MyMessage msgBaro(CHILD_ID_BARO, V_PRESSURE);
      MyMessage msgVoltage(CHILD_ID_VOLTAGE, V_VOLTAGE);
      
      
      void presentation()  
      { 
        // Send the sketch version information to the gateway
        sendSketchInfo("BME280", "1.1");
      
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID_HUM, S_HUM);
        present(CHILD_ID_TEMP, S_TEMP);
        present(CHILD_ID_BARO, S_BARO);
        present(CHILD_ID_VOLTAGE, S_MULTIMETER);
      
        metric = getControllerConfig().isMetric;
      }
      
      
      void setup()
      {
        if(!bme280.init()){
          Serial.println("BME280 Could not be initialised!");
        }
        else {
          Serial.println("BME280 initialised!");
        }
        analogReference(INTERNAL);          // use the 1.1 V internal reference
          
      }
      
      
      void loop()      
      {  
        Serial.println("Waking up...");
        #ifdef PROG_DEBUG
          unsigned long StartTime = millis();
          Serial.println("------NEW READING------");
        #endif
      
        //calculate values
        int sensorValue = analogRead(BATTERY_SENSE_PIN);
        float batteryV  = sensorValue * VrefMulti;
        int Vref0 = (VinMin / VrefMulti);
        float VrefPcnt = (1023 - Vref0) / 100;
        int batteryPcnt = static_cast<int>(((batteryV-VinMin)/(VinMax-VinMin))*100);;
        //Send Battery Voltage
        send(msgVoltage.set(batteryV, 1));
      
        #ifdef PROG_DEBUG
          //Voltage-Stuff
          Serial.println("-----Voltage-Stuff-----");
          Serial.print("A0-Reading:        ");
          Serial.println(sensorValue);
          Serial.print("VinMax:            ");
          Serial.println(VinMax);
          Serial.print("VinMin:            ");
          Serial.println(VinMin);
          Serial.print("Vref0:             ");
          Serial.println(Vref0);
          Serial.print("VrefPcnt:          ");
          Serial.println(VrefPcnt);
          
          //Battery-Stuff
          Serial.print("Battery Voltage:   ");
          Serial.print(batteryV);
          Serial.println(" V");
      
          Serial.print("Battery percent1:  ");
          Serial.print(batteryPcnt);
          Serial.println(" %");
          Serial.println("-----------------------");
        #endif
          sendBatteryLevel(batteryPcnt);
          
            
        // Get temperature from BME280
        float temperature = bme280.getTemperature();
          send(msgTemp.set(temperature, 1));
        #ifdef PROG_DEBUG
          Serial.print("Temp:              ");
          Serial.print(temperature);
          Serial.println("C");
        #endif
        
        // Get humidity from BME280
        float humidity = bme280.getHumidity();
          send(msgHum.set(humidity, 1));
        #ifdef PROG_DEBUG
          Serial.print("Humidity:          ");
          Serial.print(humidity);
          Serial.println("%");
        #endif
        
        // Get pressure from BME280
        float pressure = (bme280.getPressure()/100);
        send(msgBaro.set(pressure, 1));
        #ifdef PROG_DEBUG
          Serial.print("Pressure:          ");
          Serial.print(pressure);
          Serial.println("hPa");
        #endif
        
        #ifdef PROG_DEBUG
          unsigned long CurrentTime = millis();
          unsigned long ElapsedTime = CurrentTime - StartTime;
          Serial.print("Looptime:          ");
          Serial.print(ElapsedTime);
          Serial.println("ms");
        #endif
      
        // Sleep for a while to save energy
        Serial.print("Going to sleep for (Seconds): ");
        Serial.println(SLEEP_TIME/1000);
        sleep(SLEEP_TIME); 
      }
      

      Thanks in advance.
      Tom

      S Offline
      S Offline
      sundberg84
      Hardware Contributor
      wrote on last edited by sundberg84
      #2

      @DerManni - what happens when/if you unplug the sensor - same? If not, you have narrowed down the problem.

      How do you power the node?

      Controller: Proxmox VM - Home Assistant
      MySensors GW: Arduino Uno - W5100 Ethernet, Gw Shield Nrf24l01+ 2,4Ghz
      MySensors GW: Arduino Uno - Gw Shield RFM69, 433mhz
      RFLink GW - Arduino Mega + RFLink Shield, 433mhz

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DerManni
        wrote on last edited by DerManni
        #3

        @sundberg84
        I also unplugged the sensor, nothing happend to the power consumption in both states.

        The note is powered through an CP2102 USB 2.0 zu TTL UART on 3V3. Later I planned to power through an CR2450 coin cell.

        Unfortunately I cannot unplug the NRF-Module because it is soldered directly to the following shield. (https://oshpark.com/shared_projects/uXIff7XO)

        Could it be an faulty NRF-module?

        1 Reply Last reply
        0
        • gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #4

          Try a longer sleep time then disconnect sensor like previously said and see the consumption, if it doesn't change unplug vcc of the radio module too.

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          19

          Online

          12.0k

          Users

          11.2k

          Topics

          113.4k

          Posts


          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • MySensors
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular