Go Down

Topic: How to make a 15 min. pause ?? (Read 1 time) previous topic - next topic


Hi there..

Im new to arduino and have no programmingexperience whatsoever.. but still did manage to build a Aquariumcontroller which tells Temp, PH on a 4 line LCD, and with these variables turns on and off various equipment..

My new quest is to have it to make a 15 minutes pause on one of the output when i activate a inputpin, and my question is : is there a special way to do this or is it just to make an delay(900000) ?!?



Sep 08, 2008, 05:59 pm Last Edit: Sep 08, 2008, 05:59 pm by Grumpy_Mike Reason: 1
I would use the timer that records the number of seconds the Arduino has been on. Add 15 mins to it and keep checking to see if it has expired. In that way you don't hang (or block) the rest of the processes.


Sep 08, 2008, 06:44 pm Last Edit: Sep 08, 2008, 06:48 pm by mem Reason: 1
You may want to use the DateTime library in the playground to impliment mike's suggestion. Here is one example of how to use the library for something like this:

Code: [Select]

// this sketch makes pin 13 go high for 15 minutes from the time pin 2 goes low.
// once pin 13 is triggered on, the state of the input pin is ignored until the 15 minutes has elapsed and pin 13 is taken low again.

#include <DateTime.h>

void setup(){
pinMode(13,OUTPUT); // we turn the led on for 15 minutes from the time Pin 2 goes low
digitalWrite(13,LOW);  // LED off to start

#define TRIGGER_INACTIVE 0xffffffff  // a special value that indicates that no trigger is active.

unsigned long  endTrigger = TRIGGER_INACTIVE;
void  loop(){

 if( digitalRead(2) == HIGH){  // is the input switch pushed?
     if( endTrigger == TRIGGER_INACTIVE){  // only proceed if no trigger is active.  
       // trigger the led and store the time to turn off the led
        digitalWrite(13, HIGH);
        endTrigger = DateTime.now() + (15 * 60); // set trigger for 15 minutes from now  
             // note that DateTime.now() returns seconds since Arduino started
 if( DateTime.now() >= endTrigger ){
     // check if our trigger time has elapsed since last trigger  
     endTrigger = TRIGGER_INACTIVE;


 Thanks.. Ill try that out in the morning ;-)



I'm starting and I am very interested in your assembly, which compon :)ents as you used for your mounting PH assemble them and how?




I'm starting and I am very interested in your assembly, which compon :)ents as you used for your mounting PH assemble them and how?


Hi there..

First... Thanks MEM, you helped me out again  ;)

For the PH probe i bought a new one on Ebay, and from the technical info i got on it, found out that it gave 0.60 Mv pr 0.1 ph so therefrom it was just a calculation and there you have it.. and AGAIN thanks to MEM i found out how to print decimals on my display so it looks right  :)


Hi Martin, good to hear you have it going

Have fun!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131