PART 3
Installing the Arduino IDE should also all install the libraries apart from that needed to control the DS3213 real time clock.
The DS3213 library should be downloaded from http://www.arduinolibraries.info/libraries/ds3231 and installed using the Arduino IDE.
Start the IDE by double-clicking the icon on the desktop. (Light Blue, with Infinity sign in white)
Go to the 'Sketch' tab and click on 'Include Libraries', then select 'Add .ZIP Library'. Navigate to your Downloads folder and select 'DS3231-1.0.2.zip'.
To compile the program (aka 'Sketch' , plug the Nano into the PC with a USB cable. Then go to the 'Tools' tab and click on 'Boards'. From the list select 'Arduino Nano'.
Then go to the 'Tools' tab and click on 'Ports'. From the list select the /dev/ttyUSBnn or COM device identifying the Nano.
Clicking the Right Arrow button, top left of window, should compile and load the program into the Arduino and set the RTC. Provided there are no mistakes in the wiring, the display should start showing time, aslo the relay should click every 30 seconds.
If the Nano refuses to load, this may be because they are sold with two different bootloaders. (A bootloader is the short program the microcontoller uses to download and install an new program.) Go to 'Tools', and click on 'Processor'. Select the other bootloader and try again.
As a convenience the Sketch sets the Real Time Clock to the time the Sketch was compiled. Depending on the computer and Arduino used, the time may be a few seconds out-of-date.
To correct the time, go to 'Tools' and select Serial Monitor'. This will open a new window, which should be listing date times from the RTC. If garbage is appearing, the speed is probably wrong. Set it to 9600 bottom right.
Once the screen is listing valid date times, the RTC may be reset by typing in, top left, a string in the form:
dd/mo/yy hh:mm:ss
for example: 14/6/19 13:02:00
Type in a string that will be valid in a few minutes. Then, when an accurate clock reaches that time immediately press the 'Enter' key. This will set the RTC to the typed in time. The website time.is is a convenient accurate clock.
BUGS
None spotted by the limited testing I've done. I bet there's at least one and it's bleeding obvious! No prizes offered…
Dave
Edited By SillyOldDuffer on 14/06/2019 16:19:25