24 hour timer commands

i am a very very new engineer in arduino big world ,,,
and i need help in my second or third arduino project.
i need to build a code that repeat it self every 24 hour "every day"
without RTC module
Example like:
at 9 clock "pin 3 High"
at 11 clock "pin 4 High"
at 18 clock "pin 5 High"
at 20 clock "pin 6 High"
at 22 clock "pin 7 High"

and repeat that commands every 24 hour ""every day"

How accurate do you need to be?
The standard resonators aren't very good.
You could maybe use a radio time signal to improve time keeping

Okay, have a look @ millis :slight_smile: Its timing from the moment is powers on. So you have to sync it with normal time. No way to do it automatic without extra hardware. But keep in mind millis() only relies on the timing of the Arduino (RC resonator ) so it's not that accurate. Multiple seconds or even minutes per day is what you expect. If you need better you need something like a RTC.

i don't have a problem with RTC, but RTC not available in my country, i searched about it so much.
and i have an idea !!!
if we use Arduino (RC resonator ) and if power off, the arduino will start over from begining,
can i add a function to set the time that will start from and complete the remaining commands.

You can just time from the moment you start the Arduino. If you start it every day @ 9 then work from there. But without RTC or something the Arduino knows noting about the real clock time at all.

Which country do you live? Can't you just buy it on eBay?

Egypt !!!!!
I will try,,,
thanks septillion

you can set the arduino to count to 24 hours.
then reset it self.
all you have to do is to pick the start time and then you hit the reset the first time.

but, all this is moot because I believe that Nick Gammon has a routine that will use the timers to generate a time that is about 0.05% accurate without an RTC.

i don't have a problem with RTC, but RTC not available in my country, i searched about it so much.

Egypt !!!!!

I'm not from Egypt, but I can easily find stores and online store of a company named "future electronics" in Egypt:

Cairo Store: 2 Elsarayat St., Abdo Basha Sq., Abbasia, Cairo.
٢ شارع السرايات- ميدان عبده باشا- العباسية امام كلية الهندسة جامعة عين شمس - القاهرة.

Alexandria Store: 59 Mostafta Kamel Street, Flemeng,Alexandria
٥٩ شارع مصطفي كامل - فلمنج بجوار كلية التربية الرياضية بنات -الاسكندرية

And they also have an online store where they offer a DS1307 based RTC module:

For that RTC module you will also need an additional 3-Volt lithium battery cell in the battery-holder as a backup power (keeps the time accurate when the Arduino is not powered), the battery seems to be not included. I don't know the exact cell size required, in most cases it is a CR2032 lithium cell.