What this project doesn’t have
is an easy way to change the start
and end times for the relays. For my
project, this wasn’t a problem. For
those who need to make changes, the only way is to
make changes in the program and then upload the new
program to the Arduino Nano.
Changes could be done with the TSOP38238 infrared
receiver available from Adafruit and also their mini remote
control. There would also need to be some extensive
software additions to receive the various signals to change
the start and end times, but this is certainly a possibility.
Included in the setup block of the Arduino program
are the following:
// Set our times on the two channels
setStartTime(CHAN1, 3, 0, AM);
setEndTime(CHAN1, 3, 1, AM);
setStartTime(CHAN2, 3, 2, AM);
setEndTime(CHAN2, 3, 3, AM);
The cable modem is powered
by channel 1, which will be turned
off at 3:00 a.m. and turned back on
one minute later. The router is
powered by channel 2 and is
connected to the cable modem. It is
turned off at 3:02 a.m. and turned
on one minute later.
The complete program can be
found at the article link.
When programming the
Arduino Nano, here's an
important point not to miss.
Program the Nano with the
Set TimeDate_DS3234 function in
the setup block of the program.
The function includes the current
time and date at your location.
This will set the real time clock
going in the DS3234, and with
the installed CR2032 backup
battery, the clock will continue to
run when power is removed.
Next, comment out the line
with the Set TimeDate_DS3234
function, then program the Nano
again without it. Now if you
remove power, the DS3234 will
continue to run. When you
power-up the Arduino Nano
without the Set TimeDate_
DS3234 function, it will not
overwrite the clock's current
time. Notice also that the five
volt power for the DS3234
comes from the five volt output
of the Nano. This allows you to
plug in your USB cord to
program the Nano, plus the
DS3234 will be powered as well.
This is convenient for debugging
as the five volt LM7805 regulator
does not need to be powered.
August 2016 35