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.

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 of between 15 and 20mA. On the max6 modules this can be extended to an update period of 10 seconds which should reduce the current to 12mA

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 }; //Poll NAV5 status
 
  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
  }
 
guides/ublox_psm.1332364149.txt.gz ยท Last modified: 2012/03/21 21:09 by jcoxon