Scheduling relays to open/close

Hey Everyone ,

For my project I have 4 channel relay would like channel 1 to turn on at 5 pm and off at 6 pm on Monday. For a length of a hour.

Channel 2 to turn on at 5 pm and off 6 pm on Tuesday.

Channel 3 to turn on at 5 pm and off 6 pm on Wednesday.

Channel 4 to turn on at 5 pm and off 6 pm on Thursday.

1.) No two relays will be on at the same time.
2.) The start time and stop times are the same.
3.) Only the day of the week and relay number changes.
4.) If there is a power outage, the program must sense the correct day and time so it will resume power to the correct relay and not wait for the next cycle.

Can someone point me in the right direction, share a link or video that would help me on this project?

Item list


Adafruit PCF8523 Real Time Clock Assembled Breakout Board

ELEGOO 8 Channel DC 5V Relay Module

4 Port USB Hub

Where are you stuck ?

Can you read the time from the RTC and print it on the Serial monitor ?

Start small. Begin by looking at the examples that come with the Adafruit PCF8523 library. Get one of those working and understood.

Then work on the On/Off functionality
Then work on doing this for more than 1 relay

1 Like

Hi @obzrve,
This could help you with understanding the RTC and coding it. Same for Serial.

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.