UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


guides:ublox_psm

This is an old revision of the document!


Ublox 6 Power Saving Modes

The Ublox 6 gps modules by default have excellent power consumption at around 50 - 60mA to get a lock and then around 40mA with a lock. They however have modes that allow them to reduce their consumption further and only a small loss to performance.

Eco Mode

Reduces average current usage to about 39mA.

Cyclic Mode

This mode is available on all models of the ublox6 family though the maximum update period can vary. When the GPS starts up it is by default in the Maximum Performance mode. You can only set the power saving mode once the GPS has got a lock otherwise the module has a habit of reseting itself and losing all your settings. Once you have switched from Max Perfom to Power Saving the default setting is cyclic with an update period of 1 second resulting in a draw on average (for the 3.3v module) of 14mA-15mA. On the modules with the TCXO* this can be extended to an update period of 10 seconds which reduces the current draw average to 10mA.

* The NEO-6M module doesn't have a TCXO so cannot do 10 second cyclic (it can do 1 second though).

Example Code:

int firstlock = 0;
 
// Send a byte array of UBX protocol to the GPS
void sendUBX(uint8_t *MSG, uint8_t len) {
  for(int i=0; i<len; i++) {
    Serial.write(MSG[i]);
  }
  //Serial.println();
}
 
void setupGPSpower() {
  //Set GPS ot Power Save Mode
  uint8_t setPSM[] = { 0xB5, 0x62, 0x06, 0x11, 0x02, 0x00, 0x08, 0x01, 0x22, 0x92 }; // Setup for Power Save Mode (Default Cyclic 1s)
 
  sendUBX(setPSM, sizeof(setPSM)/sizeof(uint8_t));
}
 
void loop() {
  Serial.println("$PUBX,00*33"); //Poll GPS
  while (Serial.available())
  {
    int c = Serial.read();
    if (gps.encode(c))
    {
      //Get Data from GPS library
      //Get Time and split it
      gps.get_datetime(&date, &time, &age);
      hour = (time / 1000000);
      minute = ((time - (hour * 1000000)) / 10000);
      second = ((time - ((hour * 1000000) + (minute * 10000))));
      second = second / 100;
 
      //Get Position
      gps.get_position(&lat, &lon, &age);
 
      // +/- altitude in meters
      ialt = (gps.altitude() / 100); 
 
      if(firstlock == 0 && lat != 0){
          setupGPSpower();
          firstlock = 1;
      }
    }
  }
  //Transmit data here over radio
  }
 

Turn GPS on and off via software

Another option is to manually control the GPS, while this approach means that when the GPS is off it doesn't draw much it does mean that it'll need to reacquire a lock which will require more current. The ublox offers to options:

1) Switch the whole GPS to backup mode - minimal current draw <5mA, loses all settings, wakes on command via serial or after set time

 //Set GPS to backup mode (sets it to never wake up on its own)
 uint8_t GPSoff[] = {0xB5, 0x62, 0x02, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x4D, 0x3B};
 sendUBX(GPSoff, sizeof(GPSoff)/sizeof(uint8_t));
 
 delay(30000);
 
 //Restart GPS
 uint8_t GPSon[] = {0xB5, 0x62, 0x02, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x4C, 0x37};
 sendUBX(GPSon, sizeof(GPSon)/sizeof(uint8_t));

2) Switch the RF GPS section off, draws about 5mA, retains its settings, wakes on serial command.

 uint8_t GPSoff[] = {0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x08, 0x00, 0x16, 0x74};
 sendUBX(GPSoff, sizeof(GPSoff)/sizeof(uint8_t));
 
 delay(30000);
 
 uint8_t GPSon[] = {0xB5, 0x62, 0x06, 0x04, 0x04, 0x00, 0x00, 0x00,0x09, 0x00, 0x17, 0x76};
 sendUBX(GPSon, sizeof(GPSon)/sizeof(uint8_t));
guides/ublox_psm.1352831000.txt.gz · Last modified: 2012/11/13 18:23 by upu

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki