Introduction: Arduino Uno, Weekly Scheduling

Human usually go to work on weekday, and stay at home or go to other places on weekend. Therefore, smart devices should be able to switch their task basing on this human behavior. For examples, traffic light system should act differently between weekday and weekend. RFID-based door in workplace may need to be activated only on weekday.

In this article, I am going to show you how to switch Arduino Uno-based IoT device’s tasks basing on day of week.

If you are a beginner, you can get started with Arduino here

Step 1: Components

Or you can buy DIYables sensor kit

PHPoC Shield not only provide the internet connection for IoT devices but also provide the real-time clock (RTC) which is useful for scheduling.

Step 2: All Steps

1. Stack PHPoC Shield on Arduino

2. Install Arduino library and examples for PHPoC Shield:

On Arduino IDE, Goto Sketch -> Include Library -> Manage Libraries. Type “PHPoC” on search box. Click on PHPoC row and click “Install” button.

Or you can get .zip file here:

3. Run the following code


enum day today;

void weekdayTask() {
Serial.println("This is weekday task");

void weekendTask() {
Serial.println("This is weekend task");

PhpocDateTime datetime;

void setup() {
while (!Serial)


Serial.println("Weekly Scheduling");"Y-m-d D H:i:s");

void loop() {

today = datetime.dayofWeek();

if (today == FAILURE)
Serial.println("System Error!");
else if ( today >= MONDAY && today <= FRIDAY)
weekdayTask(); //Program for weekday
weekendTask(); //Program for weekkend

4. Modify two functions: weekdayTask() and weekendTask() according to your need.

Note that you can do much with Arduino when combining with PHPoC shield because this shield has many powerful features such as IPv4/IPv6, TCP/UDP, SSL, ESMTP… For more information, visit and

If you have any questions or something to discuss, don’t hesitate to leave a comment. I am glad to discuss with you.