DS1302 RTC relay control

hey guys, im really new using arduino. i currently can have my ds1302 displaying the time and date on my 5 button lcd shield. i have come across a fair few projects using different rtc modules. for the life of me i can not locate a detailed enf description to do this. my plan for the project is to have 8 relays be able to control as i wish. ultimately i would love to be able to access a menu and manually change time setting for the relays. but i would be perfectly ok with just setting them in the code itself. thanks for the help and again i am very new to this

The quick and dirty way would be to go through your list of events every minute (or second) and if any event has a matching time (or days-of-the-week and time) you would switch the event's relay to the position specified by the event (on or off).

What resolution do you want: Minutes or Seconds
Do you want events to be the same every day or be able to specify which days of the week the event will occur?
Do you want to control more than one relay with an event?
If so, do you want some relays to turn ON and some to turn OFF in a single event?

thanks for the reply. i am currently looking to have it control a relay for fans to come on at random intervals threw-out the day currently i am just using a simple blink sketch to do this.

other than that i am looking to have one pump come on for a period of 6 seconds and another pump to come on for about 2-3 min. i would like both pumps to do this every 6 hours.

i currently have a 8 relay board. i only have use for a few of them at this time. and i am sure once i understand the basic principals i can figure things out from there in future.

and ideally i would love to be able to go into a menu from the lcd keypad shield to set relay on off times.

i also have a few temp/ humidity sensors that i would like to be able to view the status of. i have had success uploading the code and getting readings from my lcd. i just dont know how to add this to my time keeping code. in future id like to have it so instead of having fans turn on every half hour or so if the temp gets to hi they will kick on at a certain reading from my sensor

Is there a question in there?

Also posted here:

Ok bradat....how about you give the forum rules a quick once-over...

@bradat, please do not cross-post. Threads merged.

really not overly worried about forum rules. multiple posts got more views.all of you had the time to post a reply. all which was completely useless. thumbs up and thanks for the waste of time…

just looking for a copy and paste solution for me to change various times threw-out the day to have relays turn on and off. same cycle every day.

bradat:
really not overly worried about forum rules. multiple posts got more views.
just looking for a copy and paste solution...

Right...
Better buy a bunch of plug-in timers from the hardware store.
I think nobody is going to help you here with that attitude.
Leo..

bradat:
just looking for a copy and paste solution

You could always contract for a turnkey $olution by asking a moderator to move this thread to here.

bradat:
really not overly worried about forum rules.

I've been on fora since before they gave them the name Forum: nobody in decades got any help starting out like that.

As fora go, this one is actually quite relaxed as far as I can see (compared to say stack exchange anyway) but heck, there have to be some rules. Anybody asking for help in a forum, as opposed to raising a numbered docket in a vendor help desk where you've contracted and paid for a certain level of support, is competing for volunteers' time against other requests. Stands to reason that the ones that get the help are the ones that follow the rules.

well in the real world where people work for a living and dont spend all day sitting at a chair reading forum rules all day. people ask questions and get answers... your seriously telling me i cant ask a simple question without having to somehow assume im supposed to read rules before asking a question? thats absolutely ridiculous. as for the double post i sincerely apologize to the arduino forum gods for upsetting everyone. but yet again the double post got views and a few replys which i was not etting otherwise...

Of course your questions at work get answered, people want to be sure you don't forget their fries.

by long and far dont work in the comforts of a kitchen bub.

bradat:
your seriously telling me i cant ask a simple question without having to somehow assume im supposed to read rules

You don’t have to assume your [sic] supposed to read any rules. It actually asks us all at the top of each board to do exactly that, about 50mm below where you were when you hit the New Topic button.

forum rules.GIF

bradat:
well in the real world where people work for a living and dont spend all day sitting at a chair reading forum rules all day. people ask questions and get answers...

Also in the real world, there is such a thing as "common courtesy".

Of course if you shout in the middle of the town square, more people will hear you. But that does not justify you shouting in the middle of the town square.

odometer:
But that does not justify you shouting in the middle of the town square.

Oyez it does