🌐
DeepBlue
deepbluembedded.com › home › blog › arduino delay() function tutorial
Arduino delay() Function Tutorial
July 26, 2025 - To calculate delay in Arduino, get the desired delay time and convert it to a milliseconds time unit and pass it to the delay(ms) function. Where ms is the calculated time delay (in milliseconds).
🌐
The Robotics Back-End
roboticsbackend.com › home › arduino delay [tutorial]
Arduino Delay [Tutorial] - The Robotics Back-End
December 3, 2021 - The delay() function expects you to give a number of milliseconds – not seconds – to sleep. So, if you think in seconds, then multiply the number by 1000 and you have the value you need. If you want to make your Arduino sleep for 1 minute, or for multiple minutes, then it’s quite easy.
Discussions

Delay for on off time in minutes?
🌐 r/arduino
13
1
June 1, 2023
maximum delay in arduino an how to make it
I want to make a 1 minute delay on my program? how do I make it? how the maximum delay on the Arduino? please help me More on forum.arduino.cc
🌐 forum.arduino.cc
15
0
May 20, 2013
How do I make a motor spin every 10 minutes? - Arduino Stack Exchange
I am new to Arduino, please don't be harsh. I want to make a motor spin at every x amount of time (Lets say 10 minutes). Once the program is started, I want it to start the motor (stop after 10 sec... More on arduino.stackexchange.com
🌐 arduino.stackexchange.com
My Arduino stops after 1 minute wait - Stack Overflow
As I can see from signature [ arduino.cc/en/Reference/delay ] delay(...) accepts unsigned long. 2013-10-04T05:56:41.627Z+00:00 More on stackoverflow.com
🌐 stackoverflow.com
🌐
Arduino
arduino.cc › reference › en › language › functions › time › delay
delay() | Arduino Documentation
March 9, 2023 - delay() for timing events longer than 10s of milliseconds, unless the Arduino sketch is straightforward.
🌐
Arduino Forum
forum.arduino.cc › projects › programming
maximum delay in arduino an how to make it - Programming - Arduino Forum
May 20, 2013 - I want to make a 1 minute delay on my program? how do I make it? how the maximum delay on the Arduino? please help me
Top answer
1 of 2
1

The simplest option is to use delay() to implement the waits:

void loop() {
    turn_motor_on();
    delay(10000);  // 10 seconds
    turn_motor_off();
    delay(600000);  // 10 minutes
}

Since these long numbers may be difficult to read, you can make them more readable by defining some units:

const unsigned long second = 1000;
const unsigned long minute = 60000;

Then you can for example delay(10 * minute);

Beware there is a trap if you try to do arithmetics with integer literals. The following:

delay(10 * 60 * 1000);  // BUG!

will not work on most Arduinos, as the multiplications will be performed on the int data type, which can only hold numbers up to 32,767. It is safer to use either explicitly typed constants (unsigned long is the appropriate type for delays) or integer literals typed with the suffix UL (which stands for “unsigned long”).

Note that the Arduino will do no useful work while delaying. If you want to do any kind of work during the delay, see the “Blink Without Delay” Arduino example.

2 of 2
0

Yes, of course it's possible. The loop() function might look something like:

loop(){
    turn_motor_on();
    wait_seconds(10);
    turn_motor_off();
    wait_minutes(10);
}

Now all you have to do is write your turn_motor_on() and off functions and also wait_seconds() and wait_minutes(). I'll leave the motor controls to you since you have not provided any detail on how the motor is hooked up.

You could use the Arduino delay() function:

void wait_seconds(int num_seconds){
    for(int i=0; i<num_seconds; i++){
        delay(1000);
    }
}

void wait_minutes(int num_minutes){
    for(int i=0; i<num_minutes; i++){
        delay_seconds(60);
    }
}

Of course there are many other ways to do this but this method is simple and easy to understand and will get you started easily.

Find elsewhere
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Need to add 10 minute delay before closing henhouse door - Programming - Arduino Forum
November 22, 2023 - I have a henhouse door that opens and closes based on light sensor readings. It works, but I have some new hens that can't seem to make it inside before the door closes. I tried adding a delay using the "delay" command, but that didn't work. The door motor kept running instead of stopping at ...
🌐
Instructables
instructables.com › circuits › arduino
Coding Timers and Delays in Arduino : 8 Steps - Instructables
January 26, 2022 - Coding Timers and Delays in Arduino: 20th Dec 2021 update: added PinFlasher class and example (included in SafeString library V4.1.13+) 6th Jan 2020 update: The millisDelay class is now part of the SafeString library V3+. Download SafeString from the Arduino Library manager or from it…
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Switch a relay on for 10 minutes off for 20 and repeat - Programming - Arduino Forum
October 12, 2021 - Hello guys, im struggling to create a code with that turns ON a relay for 10 minutes and OFF for 20 and repeats over time, i can do it easily with delay function but millis is braking my brain :smile: Can someone give m…
🌐
GitHub
gist.github.com › 5724190
arduino structure function. 30 minute interval. time lag = 1 second · GitHub
arduino structure function. 30 minute interval. time lag = 1 second - gist:5724190
🌐
Arduino Forum
forum.arduino.cc › forum 2005-2010 (read only) › software › syntax & programs
Delay() a good way to wait several minutes? - Syntax & Programs - Arduino Forum
July 9, 2008 - I'm making a device that has to do something every 8+minutes, and it has to be pretty precise. At first I thought that delay would be the easiest way to do this, but I wasn't sure. So basically I: DoSomething() //not much, just fire a few LEDs delay(~8mins) DoNextthing() //again, just some LEDs delay(~8mins) DoSomething() delay(~8mins) DoNextThing() etc for like 8 times and then wait another hour and repeat.
🌐
Arduino Forum
forum.arduino.cc › projects › programming
best way to delay one minute - Programming - Arduino Forum
May 18, 2020 - The nice thing about using millis() is you can do other stuff while waiting on the time period to expire. If you do it the first way you don't need a for loop just execute delay(60000) · ToddL1962: The nice thing about using millis() is you can do other stuff while waiting on the time period ...
🌐
Arduino Forum
forum.arduino.cc › international › deutsch
Ausgang soll für 10 Minuten gesetzt bleiben - Deutsch - Arduino Forum
June 20, 2019 - Ich möchte, das wenn der Ausgang "OUT" auf High gesetzt wurde, dass der Ausgang für 10 Minuten anbleibt. Unabhängig davon, ob die Spannung unter 3,83V liegt. Danach soll der Loop wieder weiter gehen und er prüft die Spannung erneut.
🌐
Arduino Forum
forum.arduino.cc › projects › general guidance
How to program a delay in minutes - General Guidance - Arduino Forum
August 4, 2016 - It's me again. I hope someday I get the hang of this. Now my project requires me to set (program) a delay into the program for 20 minutes. Anybody have any ideas ? Thanks in advance for any help. Kurt