Switching GPS and Lora off during sleep

I’ve built a simple GPS tracker over lora. It’s a circuit with a pro mini that would transmit it’s GPS location every 10 minutes over a lora radio link. Naturally, I want to extend it’s battery life. I’m switching the GPS off by cutting it’s ground using a mosfet, however, I can’t get the lora’s ground cut. Looks like it’s getting grnd through some of the other pins.

How can I reliably switch off the GPS and LoraRadio during sleep?

I’m attaching my circuit design - this version is only switching off the GPS because I can’t switch off the Lora the same way.

A friend recommended a regulator with an enable pin. If this is an option can someone recommend me an easy to use one.

Thanks for any guidance.

It's often not practical to just cut the ground or Vcc of a chip or module to turn it off, unless you can ensure all the things connected to it go into high-impedance state too. The problem is that a digital input level from some other chip will travel through the protection diodes and be shunted onto the power or ground rail inside the chip and basically keep it powered, but by drawing all the current through the MOSI or SCK or somewhere else, probably overloading the driver on the MCU and causing problems.

The Lora module has a perfectly good sleep and idle mode that you can select via software. Sleep cuts the power requirement to ~0.5uA.

You can use a high side switch to power off unused devices. Pololu has a nice selection, with both manual and digital control.

To avoid current flow into digital inputs of switched off devices, you will also have to place the (powered) processor output pins in INPUT mode (high impedance). So, it is not so straightforward.

There are GPS units with sleep mode, but upon wakeup there will often be a considerable lag while satellites are located.

As has been mentioned, there is no need to switch off the LoRa device, assuming the picture you provided is the entire project.

You will have issues with the GPS, switch it off and it may take 35-60 seconds (or more) to get a fix when you turn it on again.

If you want the best advice you will need to provide information on the actual parts you are using, a picture and schematic of the actual setup and schematic for instance.

jremington:
You can use a high side switch to power off unused devices. Pololu has a nice selection, with both manual and digital control.

To avoid current flow into digital inputs of switched off devices, you will also have to place the (powered) processor output pins in INPUT mode (high impedance). So, it is not so straightforward.

There are GPS units with sleep mode, but upon wakeup there will often be a considerable lag while satellites are located.

Thank you very much. I'm using Lora.h from Sandeep Mistry: GitHub - sandeepmistry/arduino-LoRa: An Arduino library for sending and receiving data using LoRa radios. and try as I might, it will not go into sleep. LoRa.end(); LoRa.sleep(); Is there a "better" library I can use for non-lorawan comms?

heinduplessis:
Thank you very much. I'm using Lora.h from Sandeep Mistry: GitHub - sandeepmistry/arduino-LoRa: An Arduino library for sending and receiving data using LoRa radios. and try as I might, it will not go into sleep. LoRa.end(); LoRa.sleep(); Is there a "better" library I can use for non-lorawan comms?

How do you know the LoRa device is not going into Sleep ?

heinduplessis:
Is there a "better" library I can use for non-lorawan comms?

You may try the RadioHead library. Supports LoRa amongst many different radios.

heinduplessis:
Is there a "better" library I can use for non-lorawan comms?

Define "better".

Sandeeps Library has been around for 2 years or so and is being used with the Arduino MKRWAN boards.

On the balance of probability it would seem unlikely that a basic function of the library such as .sleep() is faulty.

srnet:
As has been mentioned, there is no need to switch off the LoRa device, assuming the picture you provided is the entire project.

You will have issues with the GPS, switch it off and it may take 35-60 seconds (or more) to get a fix when you turn it on again.

If you want the best advice you will need to provide information on the actual parts you are using, a picture and schematic of the actual setup and schematic for instance.

Thanks, yes the picture I provided is the entire project. It does take a very long time to lock again after waking :confused:

srnet:
How do you know the LoRa device is not going into Sleep ?

Current usage of the whole system does not budge at all after executing the sleep command. Still runs are 42ma.

wvmarle:
You may try the RadioHead library. Supports LoRa amongst many different radios.

Thanks, I'll take a look.

srnet:
Define "better".

Sandeeps Library has been around for 2 years or so and is being used with the Arduino MKRWAN boards.

On the balance of probability it would seem unlikely that a basic function of the library such as .sleep() is faulty.

There is an open issue where sandeep requested "help wanted" on the low power functionality.

I've tried modifying the library as recommended in that issue post but still no luck. Maybe CRC and other (excellent) features have more priority and the sleep is just WIP.

heinduplessis:
Current usage of the whole system does not budge at all after executing the sleep command. Still runs are 42ma.

The module might actually be asleep already of course. Its not at all difficult to arrange for the module to go into sleep whenever its not being used. You need to measure the actual current only the module is being used to be sure.

The use of CRC is hardly a feature, its easy to turn on, it would be peverse to turn it off.

If you 'tracker' is using 42mA (useful information for the first post!), whether the LoRa device is in sleep or not is fairly irrelavent anyway, battery life on AAs is going to be around 3 days.

With a decent choice of GPS and proper power management you could extend battery life to 200 days on AAs.

You need to worry about turning off the GPS and using it in hot fix mode. A lot of GPSs have a backup battery but that won't last more than a couple of weeks typically. So you need access to the GPSs Vbkp pin and very few modules actually provide that. The Adafruit Ultimate GPS Breakout is one board that does provide the pins to allow long term hot-fixing to work.

Thanks Stuart, I realised I purchased some of your PCB's and lora modules some time ago, I still have them, never assembled (I need to read voltage and a few other things too). I see you have some great improvements on the new ones. I'm pretty much trying to do what you are, but failing miserably.

I've only mentioned the CRC feature to illustrate that it had more priority than the sleep function.

I've now run a lora on it's own with a pro mini and current is 18ma awake and 13ma asleep which is more than the sub-1ma current everyone else seem to be getting. Maybe I have the wrong lora radio.

I'll start over step by step and see where my fault steps in.

Many thanks for your help.

If your trying to troubleshoot problems with sleep current being too high, it can be very difficult to work on an assembled board.

Start with a bare bones processor on a breadboard, ATmega328 for instance, they are hardly expensive.

Get the sleep current of the basic setup down to 0.1uA or so with an switch to wake up.

Add the regulator, if used, measure sleep current, should be under 2uA with a regulator such as MCP1700.

Add the LoRa device, the sleep current should only increase by 0.1uA or so.

Add other stuff, measuring as you go.

Eventually you will have a test program, that at least with your breadboard setup, puts the board into a very low sleep current.

Sage advice. I should've started with low power consumption as a priority from the start. Well back to the soldering iron :slight_smile:

EDIT: Turns out my voltage divider is eating 10ma on it's own!!??

heinduplessis:
Sage advice. I should've started with low power consumption as a priority from the start. Well back to the soldering iron :slight_smile:

There is a fairly lengthy guide I wrote as to where the power savings are to be made in GPS trackers. Most GPS breakout boards you can buy are of little use if you want a tracker to last more than a couple of weeks on battery.

Guide is here;

GPS Performance Comparisons

EDIT: Turns out my voltage divider is eating 10ma on it's own!!??

Depends where it is of course.

A lot of clone Pro Minis use an adjustable regulator (3.3V/5V) the resitore network for that consumes a fair few mA.

srnet:
There is a fairly lengthy guide I wrote as to where the power savings are to be made in GPS trackers.

I’ve read it before thanks - great info - by sheer luck I selected the better one.

srnet:
Depends where it is of course.

A lot of clone Pro Minis use an adjustable regulator (3.3V/5V) the resitore network for that consumes a fair few mA.

Can you see my original post’s design? That’s where I have my divider. Is there a better location?

I had to look back at your schematic as it’s seriously non-obvious that you have a voltage divider. Just some tiny letters in a drawn line!

100Ω + 200Ω = 300Ω, so at 3.8V (which should be your minimum battery voltage considering you use the RAW pin) you should expect 12.7 mA there. Not 10 mA. Actually even more as running at bare minimum input voltage is a bad idea, the moment your battery voltage starts to drop you have a problem.

There’s probably more wrong with your circuit, but the way it’s drawn it’s too unreadable and I can’t be bothered to try and analyse it as is, tbh. A proper schematic would be helpful, and no doubt someone would’ve picked up on this before.

In the previous posts you talk about a regulator, which I don’t see in that image. Nor is the battery itself specified there, not even the voltage.

heinduplessis:
I've read it before thanks - great info - by sheer luck I selected the better one.
Can you see my original post's design? That's where I have my divider. Is there a better location?

As has been mentioned, you dont have one.

If you want to measure the battery voltage, the divider to read it needs to go ............. ?

srnet:
If you want to measure the battery voltage, the divider to read it needs to go … ?

Depending on the battery used, maybe the resistors of that divider can go back into the parts bin.

wvmarle:
I had to look back at your schematic as it’s seriously non-obvious that you have a voltage divider. Just some tiny letters in a drawn line!

100Ω + 200Ω = 300Ω, so at 3.8V (which should be your minimum battery voltage considering you use the RAW pin) you should expect 12.7 mA there. Not 10 mA. Actually even more as running at bare minimum input voltage is a bad idea, the moment your battery voltage starts to drop you have a problem.

There’s probably more wrong with your circuit, but the way it’s drawn it’s too unreadable and I can’t be bothered to try and analyse it as is, tbh. A proper schematic would be helpful, and no doubt someone would’ve picked up on this before.

In the previous posts you talk about a regulator, which I don’t see in that image. Nor is the battery itself specified there, not even the voltage.

Excuse my ignorance I’m just a software developer so don’t know the first thing about drawing proper schematics. I’ve tried fritzing and eagle but after I while I realise I’m doing it wrong. So I just sketched it using a flow diagram. Thanks for your patience I really appreciate it.

The only regulator I mentioned was what a friend proposed to switch off the gps and lora via an enable pin. I don’t have it on the schematic at the moment.

I’m attaching a zoomed in version on that image to make the lettering clear but it looks like you’ve deciphered it already. Battery + and - is on the right, I did not supply voltage because I haven’t decided what to use yet, maybe a 2 cell for 8.4v - 5.6v range.

In short, the voltage divider is costing me dearly in power budget, so now I’m searching the net for a better way to read v.

I really appreciate your time.

srnet:
As has been mentioned, you dont have one.

If you want to measure the battery voltage, the divider to read it needs to go … ?

I thought I did :expressionless: - a 100 and 200 ohm one on the raw and ground input pins of the pro mini, see my image. It measures the voltage of the battery supplying power to the pro mini.