GPS module into digital out

Hello there guys ,
in order to save some energy i need to power up and power down the GPS module from arduino UNO,
the problem is that is not working that way,

My current module works with 3,3V-5V , i power it from Digital port 8 but i mesure with the multimeter that when is connected there i get 3,8V and no 5V as it sould , and the GPS is not working , if i connect it to 3,3v or 5v is working fine…

is there a way to open and close the GPS programmatically?

#include <SoftwareSerial.h>
#include <TinyGPS.h>

// Define which pins you will use on the Arduino to communicate with your 
// GPS. In this case, the GPS module's TX pin will connect to the 
// Arduino's RXPIN which is pin 3.
#define RXPIN 11
#define TXPIN 12

//Set this value equal to the baud rate of your GPS
#define GPSBAUD 9600

// Create an instance of the TinyGPS object
TinyGPS gps;
// Initialize the SoftwareSerial library to the pins you defined above
SoftwareSerial mySerial = SoftwareSerial (RXPIN, TXPIN);

// This is where you declare prototypes for the functions that will be 
// using the TinyGPS library.
void getgps(TinyGPS &gps);

// In the setup function, you need to initialize two serial ports; the 
// standard hardware serial port (Serial()) to communicate with your 
// terminal program an another serial port (NewSoftSerial()) for your 
// GPS.
void setup()
{
 pinMode(8, OUTPUT); 
      digitalWrite(8, HIGH); 

  // This is the serial rate for your terminal program. It must be this 
  // fast because we need to print everything before a new sentence 
  // comes in. If you slow it down, the messages might not be valid and 
  // you will likely get checksum errors.
  Serial.begin(9600);
  //Sets baud rate of your GPS
  mySerial.begin(GPSBAUD);
  
  Serial.println("");
  Serial.println("GPS Shield QuickStart Example Sketch v12");
  Serial.println("       ...waiting for lock...           ");
  Serial.println("");
}

// This is the main loop of the code. All it does is check for data on 
// the RX pin of the ardiuno, makes sure the data is valid NMEA sentences, 
// then jumps to the getgps() function.
void loop()
{
   while(mySerial.available())     // While there is data on the RX pin...
  {
      int c = mySerial.read();    // load the data into a variable...
       
      if(gps.encode(c))      // if there is a new valid sentence...
      {
        getgps(gps);         // then grab the data.
      }
   }
}

// The getgps function will get and print the values we want.
void getgps(TinyGPS &gps)
{
  // To get all of the data into varialbes that you can use in your code, 
  // all you need to do is define variables and query the object for the 
  // data. To see the complete list of functions see keywords.txt file in 
  // the TinyGPS and NewSoftSerial libs.
  
  // Define the variables that will be used
  float latitude, longitude;
  // Then call this function
  gps.f_get_position(&latitude, &longitude);
  // You can now print variables latitude and longitude
  Serial.print("Lat/Long: "); 
  Serial.print(latitude,5); 
  Serial.print(", "); 
  Serial.println(longitude,5);
  
  // Same goes for date and time
  int year;
  byte month, day, hour, minute, second, hundredths;
  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths);
  // Print data and time
  Serial.print("Date: "); Serial.print(month, DEC); Serial.print("/"); 
  Serial.print(day, DEC); Serial.print("/"); Serial.print(year);
  Serial.print("  Time: "); Serial.print(hour, DEC); Serial.print(":"); 
  Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC); 
  Serial.print("."); Serial.println(hundredths, DEC);
  //Since month, day, hour, minute, second, and hundr
  
  // Here you can print the altitude and course values directly since 
  // there is only one value for the function
  Serial.print("Altitude (meters): "); Serial.println(gps.f_altitude());  
  // Same goes for course
  Serial.print("Course (degrees): "); Serial.println(gps.f_course()); 
  // And same goes for speed
  Serial.print("Speed(kmph): "); Serial.println(gps.f_speed_kmph());
  Serial.println();
   Serial.print(" http://maps.google.com/maps?q=");Serial.print(latitude,4);Serial.print(",");Serial.println(longitude,4); 
    
  // Here you can print statistics on the sentences.
  unsigned long chars;
  unsigned short sentences, failed_checksum;
  gps.stats(&chars, &sentences, &failed_checksum);
  //Serial.print("Failed Checksums: ");Serial.print(failed_checksum);
  //Serial.println(); Serial.println();
}
 float conv_coords(float in_coords)
{
  //Initialize the location.
  float f = in_coords;
  // Get the first two digits by turning f into an integer, then doing an integer divide by 100;
  // firsttowdigits should be 77 at this point.
  int firsttwodigits = ((int)f)/100;                               //This assumes that f < 10000.
  float nexttwodigits = f - (float)(firsttwodigits*100);
  float theFinalAnswer = (float)(firsttwodigits + nexttwodigits/60.0);
  return theFinalAnswer;
}

do i need a pulled-up resistor?? anybody?

what GPS module is it ? do you have a link ? Be careful : most GPS modules I know need between 60mA and 100mA , which is too high for arduino outputs. But the arduino output could drive a switch (BJT or Mosfet transistor) , which would power ON/OFF the GPS module.

alnath: what GPS module is it ? do you have a link ? Be careful : most GPS modules I know need between 60mA and 100mA , which is too high for arduino outputs. But the arduino output could drive a switch (BJT or Mosfet transistor) , which would power ON/OFF the GPS module.

this is exactly what i did , except i used a small hk19f relay

gc9n: this is exactly what i did , except i used a small hk19f relay

and ? did it work ? which hk19f is it (3,5,6,....V ?? 0.2W - 0.36W - 0.45W ?? ) how did you wire it ?

you'd better post a schematic of your actual wiring, nobody can guess what you've done . :roll_eyes: