user49956: I am using an Arduino Pro Mini with various sensors.  I am powering it with 2 3.7v 3400mA batteries which I recharge with a solar panel.  I take a reading from the batteries and if the  reading is above a certain number I disconnect the solar panel from the batteries using a relay.  Then when the battery reading gets below a certain number I switch back on the solar panel using the same relay.  This all works fine.
To conserve energy I want to delay the loop to the Arduino's activities for say two hours.
Right now I call lowPower(); at the end of the loop{.
void lowPower(){ is
LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);

Which I continually repeat for the two hours I want.
The problem is during this two hours the high or low limit of the battery charge could be reached but I wouldn't know it.
What I would like to do is repeat
LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);

for 15 minutes and then check the batteries and turn on or off the solar charger as need. 
Then repeat the whole thing until two hrs is reached.
At that point I would rerun the loop{ to check all sensors etc.
I have tried the following
   void loop(){
    //code to run other sensors etc.
    if (Delay ==4) {
  delay(180000);
//check the battery to begin with
sensorBatValue = analogRead(batteryInPin);
  delay(500);
if(chargeSwitch ==1){
 if(sensorBatValue < batteryNoCharge) {
  }
 else if(sensorBatValue > batteryNoCharge) {
     digitalWrite(10,HIGH);
   delay(1000);
   digitalWrite(10,LOW);
   chargeSwitch = 2;
  }
   }
else if(chargeSwitch ==2){
    if(sensorBatValue > batteryCharge) {
    }
    else if(sensorBatValue < batteryCharge) {
      digitalWrite(13,HIGH);
    delay(1000);
   digitalWrite(13,LOW);
   chargeSwitch = 1;
    }
  }
//put to sleep
lowPower();
//check battery again
delay(180000);//real
sensorBatValue = analogRead(batteryInPin);
  delay(500);
if(chargeSwitch ==1){
 if(sensorBatValue < batteryNoCharge) {
  }
 else if(sensorBatValue > batteryNoCharge) {
     digitalWrite(10,HIGH);
   delay(1000);
   digitalWrite(10,LOW);
   chargeSwitch = 2;
  }
   }
else if(chargeSwitch ==2){
    if(sensorBatValue > batteryCharge) {
    }
    else if(sensorBatValue < batteryCharge) {
      digitalWrite(13,HIGH);
    delay(1000);
   digitalWrite(13,LOW);
   chargeSwitch = 1;
    }
  }
// put to sleep
lowPower();
//repeat for total of 2 hours.
}

 void lowPower(){
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    //repeat until 15 minutes is reached
}

This doesn't seem to work.  The Arduino waits the correct time but from what I can tell the battery is never checked.
Or should I try
    void loop(){
    everything
    if (Delay ==4) {
  delay(180000);//real
  sensorBatValue = analogRead(batteryInPin);
  delay(500);
if(chargeSwitch ==1){
 if(sensorBatValue < batteryNoCharge) {
  }
 else if(sensorBatValue > batteryNoCharge) {
     digitalWrite(10,HIGH);
   delay(1000);
   digitalWrite(10,LOW);
   chargeSwitch = 2;
  }
   }
else if(chargeSwitch ==2){
    if(sensorBatValue > batteryCharge) {
    }
    else if(sensorBatValue < batteryCharge) {
      digitalWrite(13,HIGH);
    delay(1000);
   digitalWrite(13,LOW);
   chargeSwitch = 1;
    }
  }
    //include the checking of the battery inside the lowPower
    void lowPower(){
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    etc.
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    //check battery after 15 min.
    delay(500);
       sensorBatValue = analogRead(batteryInPin);
    delay(500);
    if(chargeSwitch ==1){
     if(sensorBatValue < batteryNoCharge) {
     }
     else if(sensorBatValue > batteryNoCharge) {
         digitalWrite(10,HIGH);
       delay(1000);
       digitalWrite(10,LOW);
       chargeSwitch = 2;
      }
       }
    else if(chargeSwitch ==2){
        if(sensorBatValue > batteryCharge) {
       }
        else if(sensorBatValue < batteryCharge) {
          digitalWrite(13,HIGH);
        delay(1000);
       digitalWrite(13,LOW);
       chargeSwitch = 1;
        }
      }
    //then repeat to two hours
    }

Do I need to do something to wake up the Arduino and Turn on the battery sensor pin and turn back on ADC?
Not sure how to do this Please HELP.

user16591: You have to note that if you go in "power down" mode, you will not be able to get the time as millis() will return the wrong time.
If you just want 15 minutes, you can just put it inside a for loop:
for(int j=0;j<112;j++) LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);

So the next instruction will be executed approximately after 15 minutes (15 * 60 / 8 = 112).
I made a similar project with a Teensy. With it you have more functions for the time. Just remember that with the power down, you will not be able to have any time function without an external time module on the Arduino.
Battery measurement schematics is also important. If you insert 2 resistors like 1M and 4M you will not be able to measure it since the measurement is done internally over multiple measurements and the current is not enough to measure it more than 1 time every 10-20ms. You have to add a capacitor to read a good value.

49956: <p>I am using an Arduino Pro Mini with various sensors.  I am powering it with 2 3.7v 3400mA batteries which I recharge with a solar panel.  I take a reading from the batteries and if the  reading is above a certain number I disconnect the solar panel from the batteries using a relay.  Then when the battery reading gets below a certain number I switch back on the solar panel using the same relay.  This all works fine.
To conserve energy I want to delay the loop to the Arduino's activities for say two hours.
Right now I call lowPower(); at the end of the loop{.
void lowPower(){ is</p>

<pre><code>LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
</code></pre>

<p>Which I continually repeat for the two hours I want.
The problem is during this two hours the high or low limit of the battery charge could be reached but I wouldn't know it.</p>

<p>What I would like to do is repeat</p>

<pre><code>LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
</code></pre>

<p>for 15 minutes and then check the batteries and turn on or off the solar charger as need. 
Then repeat the whole thing until two hrs is reached.
At that point I would rerun the loop{ to check all sensors etc.
I have tried the following</p>

<pre><code>   void loop(){
    //code to run other sensors etc.
    if (Delay ==4) {
  delay(180000);
//check the battery to begin with
sensorBatValue = analogRead(batteryInPin);
  delay(500);
if(chargeSwitch ==1){
 if(sensorBatValue &lt; batteryNoCharge) {
  }
 else if(sensorBatValue &gt; batteryNoCharge) {
     digitalWrite(10,HIGH);
   delay(1000);
   digitalWrite(10,LOW);
   chargeSwitch = 2;
  }
   }
else if(chargeSwitch ==2){
    if(sensorBatValue &gt; batteryCharge) {
    }
    else if(sensorBatValue &lt; batteryCharge) {
      digitalWrite(13,HIGH);
    delay(1000);
   digitalWrite(13,LOW);
   chargeSwitch = 1;
    }
  }
//put to sleep
lowPower();
//check battery again
delay(180000);//real
sensorBatValue = analogRead(batteryInPin);
  delay(500);
if(chargeSwitch ==1){
 if(sensorBatValue &lt; batteryNoCharge) {
  }
 else if(sensorBatValue &gt; batteryNoCharge) {
     digitalWrite(10,HIGH);
   delay(1000);
   digitalWrite(10,LOW);
   chargeSwitch = 2;
  }
   }
else if(chargeSwitch ==2){
    if(sensorBatValue &gt; batteryCharge) {
    }
    else if(sensorBatValue &lt; batteryCharge) {
      digitalWrite(13,HIGH);
    delay(1000);
   digitalWrite(13,LOW);
   chargeSwitch = 1;
    }
  }
// put to sleep
lowPower();
//repeat for total of 2 hours.
}

 void lowPower(){
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    //repeat until 15 minutes is reached
}
</code></pre>

<p>This doesn't seem to work.  The Arduino waits the correct time but from what I can tell the battery is never checked.</p>

<p>Or should I try</p>

<pre><code>    void loop(){
    everything
    if (Delay ==4) {
  delay(180000);//real
  sensorBatValue = analogRead(batteryInPin);
  delay(500);
if(chargeSwitch ==1){
 if(sensorBatValue &lt; batteryNoCharge) {
  }
 else if(sensorBatValue &gt; batteryNoCharge) {
     digitalWrite(10,HIGH);
   delay(1000);
   digitalWrite(10,LOW);
   chargeSwitch = 2;
  }
   }
else if(chargeSwitch ==2){
    if(sensorBatValue &gt; batteryCharge) {
    }
    else if(sensorBatValue &lt; batteryCharge) {
      digitalWrite(13,HIGH);
    delay(1000);
   digitalWrite(13,LOW);
   chargeSwitch = 1;
    }
  }
    //include the checking of the battery inside the lowPower
    void lowPower(){
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    etc.
    LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
    //check battery after 15 min.
    delay(500);
       sensorBatValue = analogRead(batteryInPin);
    delay(500);
    if(chargeSwitch ==1){
     if(sensorBatValue &lt; batteryNoCharge) {
     }
     else if(sensorBatValue &gt; batteryNoCharge) {
         digitalWrite(10,HIGH);
       delay(1000);
       digitalWrite(10,LOW);
       chargeSwitch = 2;
      }
       }
    else if(chargeSwitch ==2){
        if(sensorBatValue &gt; batteryCharge) {
       }
        else if(sensorBatValue &lt; batteryCharge) {
          digitalWrite(13,HIGH);
        delay(1000);
       digitalWrite(13,LOW);
       chargeSwitch = 1;
        }
      }
    //then repeat to two hours
    }
</code></pre>

<p>Do I need to do something to wake up the Arduino and Turn on the battery sensor pin and turn back on ADC?</p>

<p>Not sure how to do this Please HELP.</p>
 16591: <p>You have to note that if you go in "power down" mode, you will not be able to get the time as <code>millis()</code> will return the wrong time.</p>

<p>If you just want 15 minutes, you can just put it inside a for loop:</p>

<pre><code>for(int j=0;j&lt;112;j++) LowPower.powerDown(SLEEP_8S,ADC_OFF,BOD_OFF);
</code></pre>

<p>So the next instruction will be executed approximately after 15 minutes (15 * 60 / 8 = 112).</p>

<p>I made a similar project with a Teensy. With it you have more functions for the time. Just remember that with the power down, you will not be able to have any time function without an external time module on the Arduino.</p>

<p>Battery measurement schematics is also important. If you insert 2 resistors like 1M and 4M you will not be able to measure it since the measurement is done internally over multiple measurements and the current is not enough to measure it more than 1 time every 10-20ms. You have to add a capacitor to read a good value.</p>
