Go Down

Topic: GPS module power management (Read 3515 times) previous topic - next topic

Abhijeet8919

Hello Guyz, I am working with GPS module(Neo 6M) with Arduino and sim808.

The thing is because of GPS module is continuously operating it consuming power, while i only want location(latitude and longitude) after an interval(lets take 2 minutes). I am all aware about "delay()" function but i am not looking for it.

so, i am looking for a solution for temporary shut down the GPS module and wake it up after the interval.
I am adding part of my Ino code for you to understand what i am upto.

Code: [Select]

#include <SoftwareSerial.h>
#include <TinyGPS++.h>
#define GPSBaud 9600
#define ConsoleBaud 115200

TinyGPSPlus gps;

SoftwareSerial serialSIM800(SIM800_TX_PIN,SIM800_RX_PIN);

void setup(){
  Serial.begin(ConsoleBaud);
  serialSIM800.begin(19200);
  ss.begin(GPSBaud);

}
void loop(){
   gps.location.lat();
   gps.location.lng();
}
 

While i was surfing Internet Ive come to know about

gps.standby();
gps.wakeup();

but when i use this codes IDE gives me following error:

error: 'class TinyGPSPlus' has no member named 'standby'

same error for "wakeup" too.


Please help me on this topic. Any suggestions will be helpful. Thank you.  :)
 

PaulS

Quote
While i was surfing Internet Ive come to know about

gps.standby();
gps.wakeup();
Well, I was surfing the net, and it said that that was nonsense.

Post a link to the site where you found that. I'm sure that you'll find that gps was an instance of some other class.

How are you powering the GPS? You COULD add an external power supply and a transistor. Use a digital pin on the Arduino to turn the transistor (and therefore the GPS) on when you need it, and off when you don't.

Don't forget that GPSs take a while to wake up.
The art of getting good answers lies in asking good questions.

Abhijeet8919

Hi PaulS, thanks for your reply. This is the link where ive found that two codes.

https://github.com/adafruit/Adafruit_GPS/issues/25

Quote
You COULD add an external power supply and a transistor. Use a digital pin on the Arduino to turn the transistor (and therefore the GPS) on when you need it, and off when you don't.
thanks for this suggestion. i will use this and let you know.

Second thing i am using Arduino pro mini, using pins(vcc,gnd) i am giving power to GPS module.

Is there any other way to put GPS in sleep mode?



PaulS

Quote
This is the link where ive found that two codes.
So, the Adafruit_GPS class has some methods that you want to use with the TinyGPSPlus instance. What would possibly make you think that would work?

Quote
Is there any other way to put GPS in sleep mode?
Sure. Get an Adafruit GPS and use the Adafruit_GPS library.
The art of getting good answers lies in asking good questions.

-dev

#4
Aug 29, 2017, 04:38 pm Last Edit: Aug 29, 2017, 04:39 pm by -dev
Quote
Is there any other way to put GPS in sleep mode?
PaulS' suggestion for using a transistor to turn it on or off will work for any GPS model.  A logic-level MOSFET would work.  As he said, you will have to wait for the GPS device to power up and start tracking satellites.  This can take 30s to 15 minutes, depending on how long the GPS has been off and the quality of the satellite signals (reception).

Since you are using the ublox NEO-6M GPS device, you could send it special binary commands to control how much power it uses.  The ublox NEO-6 Data Sheet specifies how much current it uses in various modes.  The commands are described in the u-blox NEO-6 Protocol Specification.  Section 9 Power Management describes the various modes and settings.  This subsection might be describing what you want to do:

Quote
9.3.1.3 User controlled operation - update and search period of zero

Setting the update period to zero causes the receiver to wait in the Inactive for update state until woken up by the user. Setting the search period to zero causes the receiver to wait in the Inactive for search state indefinitely after an unsuccessful start-up. Any wake-up event will re-start the receiver. See chapter Wake-up for more information on wake-up events.

External wake-up is required when setting update or search period to zero!
The "Wake-up" chapter says you can wake up the receiver by sending it a character.

Using extra components to power the GPS on or off is easy to use in the software -- just turn a digital pin on or off.  It also guarantees that the GPS will not use any current (uA or pA, anyway).

Sending commands to the GPS does not require any extra components, but the GPS device will still use some power when it is in the inactive state.  I don't see a current specification for the Inactive state in the data sheed, byt according to this, it can only go as low as 10mA.  If you need to use less current than that, you will have to switch the power in hardware.

Obligatory link my GPS library, NeoGPS.  Also available from the Arduino IDE Library Manager.
Really, I used to be /dev.  :(

srnet

#5
Aug 29, 2017, 04:43 pm Last Edit: Aug 29, 2017, 04:44 pm by srnet
Is there any other way to put GPS in sleep mode?
Yes, give it a backup voltage  on the GPSs backup pin and turn of the main GPS power.

When you want a new fix, turn the GPS main power back on and assuming a decent GPS antenna and signals it should aquire a new fix within 5 seconds or so.

Most of the modern UBLOXs have a software backup mode, you can turn most of the GPS off, power consumption drops to around 200uA.

Generic GPS libraries, such as TinyGPS++, are written for generic GPSs and are unlikely to have stuff such as software backup mode implemented, that tends to be very specific to each particular manufacturer.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

-dev

#6
Aug 29, 2017, 04:48 pm Last Edit: Aug 29, 2017, 04:48 pm by -dev
Quote from: srnet
Most of the modern UBLOXs have a software backup mode, you can turn most of the GPS off, power consumption drops to around 200uA.
Is this from testing, or from NEO-7/8 specs?  I couldn't find anything for the NEO-6...
Really, I used to be /dev.  :(

srnet

Is this from testing, or from NEO-7/8 specs?  I couldn't find anything for the NEO-6...
From reading the datasheets, amazing what you find when you read datasheets, then implementing and actually testing it.

A feature of the UBLOX 7 and 8.

Its prabably a bit less than 200uA for the GPS, thats the current consumption of the entire tracker when its put to sleep.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

Abhijeet8919

Thank you friends for your suggestions. I will let you know about the progress.

srnet

Is this from testing, or from NEO-7/8 specs?  I couldn't find anything for the NEO-6...
This is the UBX command for software backup, send the array;

FLASH_ARRAY(byte, SoftwareBackup, 0xB5, 0x62, 0x06, 0x57, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x50, 0x4B, 0x43, 0x42, 0x86, 0x46);

Shutdown is not immediate, takes a second or so.

'Activity' on the serial in port wakes it up, just a pulse will do.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

-dev

Quote from: srnet
This is...
Yes, yes, I have practically memorized the NEO-6 specs.  

I was asking how you knew the NEO-6 drew <200uA in the INACTIVE state, because there is no specification of the INACTIVE state current in any of the NEO-6 documents.  All the other states are listed, the lowest of which is 11mA (see Section 3.3 of the NEO-6 Data Sheet).  
Really, I used to be /dev.  :(

srnet

I was asking how you knew the NEO-6 drew <200uA in the INACTIVE state, because there is no specification of the INACTIVE state current in any of the NEO-6 documents
I dont know, since have never measured the sleep current of a 6.

The protocol decription for the 6 does imply that if the update period is set to zero, the receiver will wait in the inactive for search state, maybe the receiver does go to sleep in this mode.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

-dev

#12
Aug 31, 2017, 04:42 pm Last Edit: Aug 31, 2017, 08:37 pm by -dev
LOL, after searching the NEO-7 and 8 docs, I still cannot find an INACTIVE current specification.  I also found an AppNote, but it doesn't have anything either.  The closest it comes:

Quote
2.3.1 General considerations using the PSM
            ...

In ON/OFF mode however, the average current drops significantly when the update period is increased. This is due to the receiver shutting down completely, with the exception of RTC and Battery backup RAM powered.



Figure 6: Average current consumption of a MAX-M8Q receiver in different PSM modes and Update Periods
If I squint, I think the M8Q average current consumption for an ON/OFF period of 10s is 3.75mA, and 10 minutes is 0.6mA.
Really, I used to be /dev.  :(

srnet

I dont recall seing it listed either.

200uA for an M8Q in sleep mode was what I measured. I will investigate that some time since I suspect it ought to be lower, it might depend on the exact state that I\O pins are left in.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

itmoto

Hello. Quite new to electronics/arduino, (one of my first posts) have read many many posts from Pauls and -Dev and others during my research so just like to quickly say hi and hats off to your knowledge/skills.
In my project (328p, neo6m, sim800l Tracker fitted to motorcycle) I have it working on breadboard, of a fashion! I am looking into power efficiency as would like it battery powered.

I can put sim800l to sleep, 328p I am looking into now how to put into sleep mode power down and wake when falling edge (120ms low) interrupt by sim800 RI pin when called or SMS received.

The next step is powering up the gps when required (normally off to save power) I was thinking of using a relay, but I would like project to be as small as possible and after reading what PaulS wrote

" Use a digital pin on the Arduino to turn the transistor (and therefore the GPS) on when you need it, and off when you don't. "

can you suggest a suitable transistor that is small and will do the job?

Thanks in advance.


Go Up