Software Serial Power Saving

Evening,

Working on a low power logger using a SIM900 shield from Keystudio and a pro mini (stripped of regulator LED etc)

Consumption is around 22uA when Sim900 is off

Using a P channel FET to power down the module and software serial to communicate with it.

When I enable SS my consumption shoots to 900 uA. If I disconnect the Serial lines, consumption is down again.

This is before using SS.begin. Any thought why enabling SS consumes so much current and can it be effectively disabled during sleep ( Can assign it to two unused pins, but I'd rather just disable whatever is causing the consumption in the first place (Sleep mode is affected)

// **** INCLUDES *****
#include "LowPower.h"
#include "SoftwareSerial.h"


void setup()
{
   
SoftwareSerial mySerial (7, 8); //Sim900 RX,TX - when NOT commented out consumption 900uA

Serial.begin(9600);

}

void loop() 
{
    LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF); 
}

You should be able to use mySerial.end()

colbee89:
Any thought why enabling SS consumes so much current

SoftwareSerial is interrupt driven.

Every time a serial charcter starts to arrive, the processor needs to respond to and deal with the interrupt.

So shut SoftwareSerial down if you want to stop the processor doing this.

Ok, so this makes no difference.

// **** INCLUDES *****
#include "LowPower.h"
#include "SoftwareSerial.h"


void setup()
{
SoftwareSerial mySerial (7, 8); //Sim900 RX,TX - when commented out consumption 900uA
mySerial.end();
}

void loop() 
{

    LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF); 
}

As far as I can see from the SS code MySerial.begin() actually enables the interrupts, which I have not called yet. SoftwareSerial.Myserial(rx,tx) seems to just do pin definitions, so the addition of the pinmode does take me back down to 22uA

// **** INCLUDES *****
#include "LowPower.h"
#include "SoftwareSerial.h"


void setup()
{
SoftwareSerial mySerial (7, 8); //Sim900 RX,TX - when commented out consumption 900uA
mySerial.end();
pinMode(7,INPUT);
pinMode(8,INPUT);

}

void loop() 
{

    LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF); 
}

But with that in mind, you'd think a simple code setting 8 and 9 to their respective states as a TX and RX pin would replicate my issues, but no. Must be missing something

For troubleshooting deep sleep current issues, you need to start by measuring the sleep current with the bare bones processor, there should be no connected devices or components that you just think you have turned off or removed.

A Pro Mini with no regulator, or LEDs, ought to have a deep sleep current under 1uA, if it does not you need to work out why.