HELP!, Arduino keeps rebooting

I'm trying to finish my a project for school (due at 5pm today)

My adruino UNO keeps rebooting for some unknow reason....
power supply is a lab supply 12v set to 1.1amps (DVRs need ~350mA ea) total running is 500-600mA

Binary sketch size: 15758 bytes (of a 32256 byte maximum)

#include <NewSoftSerial.h>
#include <TinyGPS.h>
#include <LiquidCrystal.h>


TinyGPS gps;
NewSoftSerial GPS(9, 8);
NewSoftSerial mDVRRec(12, 13);  //serial for unit that records ***correct 
NewSoftSerial mDVROverlay(10, 11); //serial for unit that draws data on screen *** correct
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
 
  long lat, lon;
  float flat, flon;
  unsigned long age, date, time, chars;
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned short sentences, failed;
  int Time_Zone = 7;
  
int timer;  
int i;
void gpsdump(TinyGPS &gps);
bool feedgps();
void printFloat(double f, int digits = 2);
int byteGPS=-1;
int k=0;

int Flag =0; //Rec triggering
long Time_Alive =0; 
long Time_Check;
int SPEED=0;

int Altitude=0;



int incomingByte=0;  //for serial command passing
int serIn;;// for serial command passing
int j =0;
byte index = 0; // Index into array; where to store the character


//=========================================================================================
void setup() {
 // put your setup code here, to run once:
  Serial.begin(4800);  // Serial to PC
   GPS.begin(4800);
  mDVRRec.begin(115200);  // Serial to mDVR that records -rev 0.10
 // mDVRRec.begin(57600); // revs 0.20 +
  mDVROverlay.begin(57600);  // Serial to mDVR Overlay generator
 
  lcd.begin(16, 2);
  Serial.println("booting....");
  Serial.println("Sofware build date: 12/16/2011");

  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A4, OUTPUT);
  pinMode(A5, OUTPUT);
  
  Overlay_boot();
  RecBoot();
  delay(450); // need to get the mDVRs powered up in time to take commands
  OSD_Setup();
  Serial.println("Booting Complete...");
  digitalWrite(A0, HIGH); // turns off red LED
}
//=========================================================================================
void RecBoot(){
      Serial.println("Booting Recording unit");
      digitalWrite(A4,HIGH); //boot mdvr
      delay(1500);
      digitalWrite(A4,LOW); //boot mdvr
}
//=========================================================================================
void Overlay_boot(){
      Serial.println("Booting Overlay Generator");
      digitalWrite(A5,HIGH); //boot mdvr
      delay(1500);
      digitalWrite(A5,LOW); //boot mdvr
}
//=========================================================================================

void OSD_Setup(){
  int Delay=180; //200 was start, 150 works every time// will effect boot up time
    delay(Delay);
    Serial.println("OSD start");
    mDVROverlay.print(" \r"); // clears any invalid data in the input string 
    delay(Delay);
    mDVROverlay.print(" \r");// clears any invalid data in the input string 
    delay(Delay);
    mDVROverlay.print(" \r");// clears any invalid data in the input string 
    delay(Delay);
    mDVROverlay.print("t4 4 42 00\r"); // 
    delay (Delay);
    mDVROverlay.print("embtxtoffset 0 400 400\r"); // sets overlay top row (x,y) Real Time clock
    delay(Delay);
    mDVROverlay.print("embtxtoffset 0 400 400\r"); // sets overlay top row (x,y) Real Time clock
    delay(Delay);
    mDVROverlay.print("osdtxtoffset 1 30 25\r"); // sets overlay top row (x,y) Latitude 
    delay(Delay);
    mDVROverlay.print("osdtxtoffset 2 30 50\r"); // sets overlay bottom row (x,y) longatude 
    delay(Delay);
    mDVROverlay.print("osdtxtoffset 3 30 400\r");  // sets ovelay bottom row (x,y) speed
    delay(Delay);
    mDVROverlay.print("osdtxtoffset 4 30 75\r");  // sets ovelay bottom row (x,y) Alt
    delay(Delay);
    mDVROverlay.print("osdtxtenable 0 1\r"); // turns overlay string 0 on
    delay(Delay);
    mDVROverlay.print("osdtxtenable 1 1\r"); // turns overlay sting 1 on
    delay(Delay);  
    mDVROverlay.print("osdtxtenable 2 1\r"); // turns overlay sting 1 on
    delay(Delay); 
    mDVROverlay.print("osdtxtenable 3 1\r"); // turns overlay sting 1 on
    delay(Delay); 
    mDVROverlay.print("osdtxtenable 4 1\r"); // turns overlay sting 1 on
    delay(Delay);
    mDVROverlay.print("osdtxtsize 0 20 20 \r"); // turns overlay string 0 on
    delay(Delay);
    mDVROverlay.print("osdtxtsize 1 20 20 \r"); // turns overlay sting 1 on
    delay(Delay);
    mDVROverlay.print("osdtxtsize 2 20 20 \r"); // turns overlay sting 1 on
    delay(Delay);
    mDVROverlay.print("osdtxtsize 3 20 20 \r"); // turns overlay sting 1 on
    delay(Delay);
    mDVROverlay.print("osdtxtsize 4 20 20 \r"); // turns overlay sting 1 on
    delay(Delay);
    mDVROverlay.print("osdtxtcolor 0 3\r"); // sets sting 1  to blue
    delay (Delay);
    mDVROverlay.print("osdtxtcolor 1 3\r"); // set sting 0 on to blue
    delay (Delay);
    mDVROverlay.print("osdtxtcolor 2 3\r"); // set sting 0 on to blue
    delay (Delay);
    mDVROverlay.print("osdtxtcolor 3 3\r"); // set sting 0 on to blue
    delay (Delay);
    mDVROverlay.print("osdtxtcolor 4 3\r"); // set sting 0 on to blue
    delay (Delay);
    //mDVROverlay.print("vcallback 1\r"); // 
    delay (Delay);
    mDVROverlay.print("embtxtrtcauto 1 \r"); // 
    delay (Delay);
    mDVROverlay.print("t4 4 42 00\r"); // 
    delay (Delay);
    mDVROverlay.print("embtxtenable 0 1\r"); // 
    delay (Delay);
    mDVRRec.print(" \r");
    delay(Delay);
    mDVRRec.print(" \r");
    delay(Delay);
    mDVRRec.print("overlay \r");
   Serial.println("OSD End");
    delay(Delay);
}

//=========================================================================================
void mDVR_Print(long lat, long lon, int Altitude, int SPEED) 
{
    int Delay=100;
   // int k =0;
    if (k == 0){
         mDVROverlay.print("osdtxtload 1 "); mDVROverlay.print("Latitude: ");mDVROverlay.print(lat);mDVROverlay.print("\r");//load DATA into string
         ++k;
    }
         //delay(Delay);
     else if(k==1){
       mDVROverlay.print("osdtxtload 2 ");mDVROverlay.print("Longatude: ");mDVROverlay.print(lon);mDVROverlay.print("\r");
       ++k;
     }
         //delay(Delay);
     else if (k==2){
       mDVROverlay.print("osdtxtload 3 "); mDVROverlay.print("Speed: "); mDVROverlay.print(SPEED); mDVROverlay.print(" MPH\r");
       ++k;
     }
        // delay(Delay);
      else if  (k==3){
        mDVROverlay.print("osdtxtload 4 "); mDVROverlay.print("Altitude: ");mDVROverlay.print(Altitude); mDVROverlay.print("Ft\r");
        ++k;
      }
      else
      {
        k=0;
      }
        // delay(Delay);
}

//=========================================================================================

void loop() {
     if (Serial.available()) { //direct to arduino
            incomingByte = Serial.read(); // wait a bit for the entire message to arrive
            delay(100); // read all the available characters
        
        if(incomingByte==49){ //1 command
            while (Serial.available() > 0) {
            serIn = Serial.read(); //read Serial
            Serial.print(serIn, BYTE); //eco commands
            mDVRRec.print(serIn, BYTE); //pass commands
          }
        }
        if (incomingByte==50){ //2comand
            while (Serial.available() > 0) {
            serIn = Serial.read(); //read Serial
            Serial.print(serIn, BYTE); //eco commands
            mDVROverlay.print(serIn, BYTE); //pass commands
          }
        }
        mDVRRec.print("\r");
        Serial.println("");
    }
    // end pass through

  digitalWrite(A1, HIGH); // turns orange LED off
  //digitalWrite(A0, HIGH); // turns red LED off
  byteGPS=GPS.read(); 
   if (byteGPS == -1) {       // See if the port is empty yet
     delay(100); 
   }
  //ssdigitalWrite(A0, LOW); // turns redLED on
  
  bool newdata = false;
  unsigned long start = millis();

  // Every 5 seconds we print an update
  while (millis() - start < 20)
  {
    if (feedgps())
      newdata = true;
       
  }
  
  if (newdata)
  {
    Serial.print("Acquired Data \n");
    Serial.println("-------------");
    gpsdump(gps);
    digitalWrite(A1, LOW); // turns orangeLED on
    mDVR_Print(lat, lon, Altitude, SPEED);
    Serial.println("-------------");
    Serial.println();
  }
  Altitude=(gps.altitude()*0.03281);
  //SPEED=gps.f_speed_mph();
  SPEED = gps.speed()*1.1507;

//---------function ---------------------------------
//=====================================================================
//===== Trigger section ===============================================

stupid 9500 char limit :~

//===== Trigger section ===============================================
  if(analogRead(2)>800 &&Flag==0){
   
      mDVRRec.print("v1\r");
      digitalWrite(A0, LOW); // turns on LED
      Serial.println("Recording Started");
      Time_Check=Time_Alive; //captures current time
      Flag=1; // trigger
  }
  
    if( analogRead(2)>800 &&Flag==1 && ((Time_Alive - Time_Check) > 5)){
      mDVRRec.print("v2\r");
      Serial.println("Recording Stopped");
      digitalWrite(A0, HIGH); // turns off LED
    
      Flag=0;
     
    }
  
  if (analogRead(3) >400){
    mDVRRec.print("c1\r");  // take a still images
    Serial.println("Still Image Captured");
    delay(100);
  }
   
 /*
  if(((Time_Alive - Time_Check) > 5) && Flag ==1 && Rec_Flag==0){ // delta check
      //Flag=1;//do stuff Flag== something.... think
      Rec_Flag=1;
      
    }
  */
  Time_Alive=(millis()/1000); //how many seconds has this been running. overflow at 50 days
//=====================================================================
//====================LCD Pages====================================
  if((millis()%50)==0)
 {
 ++i;
 
 }
 switch(i%4)
{
case 0:
   
     lcd.setCursor(0, 0);
     lcd.print("Time: ");lcd.print(hour,DEC);lcd.print(":");lcd.print(minute,DEC);lcd.print(":");lcd.print(second,DEC);lcd.print(" Z    ");
     lcd.setCursor(0, 1);
     lcd.print("Date: ");lcd.print(month,DEC);lcd.print("/");lcd.print(day,DEC);lcd.print("/");lcd.print(year);
     
     break;
  
case 1:
   
     lcd.setCursor(0, 0);
     lcd.print("Lat: ");lcd.print(lat% 100L);lcd.print((char)228);lcd.print(lat% 1000L);lcd.print("'");lcd.print(lat% 10000L,1);
     lcd.setCursor(0, 1);
     lcd.print("long: ");lcd.print(lon);lcd.print((char)228);lcd.print(lon% 1000L);lcd.print("'");lcd.print(lon% 10000L,1);
     break;
  
   case 2:
    
     lcd.setCursor(0, 0);
     lcd.print("Speed(MPH): ");lcd.print(gps.f_speed_mph(),1);lcd.print("     ");
     lcd.setCursor(0, 1);
     lcd.print("Alt(ft): ");lcd.print((gps.altitude()*0.03281));lcd.print("     "); //centameters to feet
     break;
     
   case 3:
     lcd.setCursor(0, 0);
     lcd.print("# of sat: 7");//lcd.print(gps.get_sat);
     break;

  }  
} // end of main loop 
//================================== this section runs no matter what===========================
void printFloat(double number, int digits)
{
  // Handle negative numbers
  if (number < 0.0)
  {
     Serial.print('-');
     number = -number;
  }

  // Round correctly so that print(1.999, 2) prints as "2.00"
  double rounding = 0.5;
  for (uint8_t i=0; i<digits; ++i)
    rounding /= 10.0;
  
  number += rounding;

  // Extract the integer part of the number and print it
  unsigned long int_part = (unsigned long)number;
  double remainder = number - (double)int_part;
  Serial.print(int_part);

  // Print the decimal point, but only if there are digits beyond
  if (digits > 0)
    Serial.print("."); 

  // Extract digits from the remainder one at a time
  while (digits-- > 0)
  {
    remainder *= 10.0;
    int toPrint = int(remainder);
    Serial.print(toPrint);
    remainder -= toPrint; 
  } 
}


void gpsdump(TinyGPS &gps)
{/*
  long lat, lon;
  float flat, flon;
  unsigned long age, date, time, chars;
  int year;
  byte month, day, hour, minute, second, hundredths;
  unsigned short sentences, failed;
*/
  gps.get_position(&lat, &lon, &age);
  Serial.print("Lat: ");Serial.print(lat); Serial.print("    "); Serial.print("Lat: ");Serial.print(lon); Serial.print("    \n"); //embtxtload <index> <string> 
         
  feedgps(); // If we don't feed the gps during this long routine, we may drop characters and get checksum errors

  gps.f_get_position(&flat, &flon, &age);
  Serial.print("Lat/Long(float): "); printFloat(flat, 5); Serial.print(", "); printFloat(flon, 5);
  Serial.print(" Fix age: "); Serial.print(age); Serial.println("ms.");

  feedgps();

  gps.get_datetime(&date, &time, &age);
 Serial.print("Date(ddmmyy): "); Serial.print(date); Serial.print(" Time(hhmmsscc): "); Serial.print(time);
  Serial.print(" Fix age: "); Serial.print(age); Serial.println("ms.");

  feedgps();

  gps.crack_datetime(&year, &month, &day, &hour, &minute, &second, &hundredths, &age);
Serial.print("Date: "); Serial.print(static_cast<int>(month)); Serial.print("/"); Serial.print(static_cast<int>(day)); Serial.print("/"); Serial.print(year);
  Serial.print("  Time: "); Serial.print(static_cast<int>(hour)); Serial.print(":"); Serial.print(static_cast<int>(minute)); Serial.print(":"); Serial.print(static_cast<int>(second)); Serial.print("."); Serial.print(static_cast<int>(hundredths));
  Serial.print("  Fix age: ");  Serial.print(age); Serial.println("ms.");

  feedgps();
 Serial.print("Alt(cm): "); Serial.print(gps.altitude()); Serial.print(" Course(10^-2 deg): "); Serial.print(gps.course()); Serial.print(" Speed(10^-2 knots): "); Serial.println(gps.speed());
  Serial.print("Alt(float): "); printFloat(gps.f_altitude()); Serial.print(" Course(float): "); printFloat(gps.f_course()); Serial.println();
  Serial.print("Speed(knots): "); printFloat(gps.f_speed_knots()); Serial.print(" (mph): ");  printFloat(gps.f_speed_mph());
  Serial.print(" (mps): "); printFloat(gps.f_speed_mps()); Serial.print(" (kmph): "); printFloat(gps.f_speed_kmph()); Serial.println();

  feedgps();

  gps.stats(&chars, &sentences, &failed);
 // Serial.print("Stats: characters: "); Serial.print(chars); Serial.print(" sentences: "); Serial.print(sentences); Serial.print(" failed checksum: "); Serial.println(failed);

}
  
bool feedgps()
{
  while (GPS.available())
  {
    if (gps.encode(GPS.read()))
      return true;
  }
  return false;
}

Serial log

booting....
Sofware build date: 12/16/2011
Booting Overlay Generator
Booting Recording unit
OSD start
OSD End
Booting Complete...
Acquired Data 
-------------
Lat: 3338506    Lat: -11184308    
Lat/Long(float): 33.38506, -111.84308 Fix age: 145ms.
Date(ddmmyy): 161211 Time(hhmmsscc): 17372600 Fix age: 265ms.
Date: 12/16/2011  Time: 17:37:26.0  Fix age: 389ms.
Alt(cm): 999999999 Course(10^-2 deg): 9080 Speed(10^-2 knots): 0
Alt(float): 10000000.00 Course(float): 90.80
Speed(knots): 0.00 (mph): 0.00 (mps): 0.00 (kmph): 0.00
-------------

Acquired Data 
-------------
Lat: 3338506    Lat: -11184308    
Lat/Long(float): 33.38506, -111.84308 Fix age: 165ms.
Date(ddmmyy): 161211 Time(hhmmsscc): 17372800 Fix age: 285ms.
Date: 12/16/2011  Time: 17:37:28.0  Fix age: 406ms.
Alt(cm): 999999999 Course(10^-2 deg): 9080 Speed(10^-2 knots): 0
Alt(float): 10000000.00 Course(float): 90.80
Speed(knots): 0.00 (mph): 0.00 (mps): 0.00 (kmph): 0.00
-------------
booting....
Sofware build date: 12/16/2011
Booting Overlay Generator
Booting Recording unit
OSD start
OSD End
Booting Complete...

Acquired Data 
-------------
-------------

Arduino has very limited RAM and your long code is using a lot of it. I don't have your hardware so there's no way I can test the code. But I would shorten all the serial printouts. Eg.

Serial.println("Sofware build date: 12/16/2011");

Change into:

Serial.println("12/16/11");

You save over 20 bytes on this instruction alone. UNO only has 2048 bytes and you have a ton of those long and nice printouts. For your 5pm deadline, trim down all the strings to see if it helps. For a future with nice long printouts WITHOUT wasting your RAM, you can come back over the weekend and have time to learn it.

Just curious, how frequently (in seconds) does the arduino reboot?

I had the same problem on one of my projects and it would reset after running the void setup() code. The problem was overuse of the SRAM. I had a couple float arrays of 100 items each. :~

ok will do... so in my void OSD_setup would it help if i move those to a while loop as most of them are the same and where they differ just put an "i" and "++i" after each setup?

how do i find out how much sram i'm using?

we the system reboots with the serial prints at the bottom commented out

it varies between 8-20 seconds

Making a string of a single colon or slash is also sily.
What everyone said; cut down on the strings.

AWOL:
Making a string of a single colon or slash is also sily.
What everyone said; cut down on the strings.

the "\r" is need for the mDVRs, that how they know the "enter" k\ey has been pressed, and the ":" is for for the time, lat or lon... is there a better way?

I never said they weren't necessary, I said making strings out of them was silly.

Did you make ANY suggested changes? At the moment, we are trying to help you get your project submitted but later if you want to print many messages the RAM-friendly way, you can still do it, after reading through some sample codes of course.