   //processor and the alarm flag is set. Clear the flag and
   //handle whatever we need to do.
   else {
+    
+     /*get voltage*/
+    // take a number of analog samples and add them up
+    while (sample_count < NUM_SAMPLES) {
+        sum += analogRead(A3);
+        sample_count++;
+        delay(10);
+    }
+    // calculate the voltage
+    // use 5.0 for a 5.0V ADC reference voltage
+    // 5.015V is the calibrated reference voltage
+    voltage = ((float)sum / (float)NUM_SAMPLES * 5.05) / 1024.0;
+    // send voltage for display on Serial Monitor
+    // voltage multiplied by 11 when using voltage divider that
+    // divides by 11. 11.132 is the calibrated voltage divide
+    // value
+#if DEBUG
+    Serial.print(voltage * 11.133);
+    Serial.println (" V");
+#endif    
+    sample_count = 0;
+    sum = 0;
+    append_to_disk(voltage);
+
 #if DEBUG_TO_SD
   write_Text_To_Disk("data.txt","Woke up, logging");
 #endif


  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
    return;
  }

    //we finally hit the specified number of minutes to run, reset and log
    timeCount = 0;

    temperature = getTemp();
    delay(5);
    append_to_disk(temperature);
    
#if DEBUG
    Serial.println(temperature);
#endif

   
    temperature = -54321; //set to this so we dont get the same temp reading each time 
    //if something is wrong with sensor
    
    //clear alarm flag and update time To sleep
    clock.clearAlarm1();

