Recently, I learned Arduino for the first time and built a digital clock with Arduino Nano module + DS3231 module + 1602 LCD screen + rotary coding switch.

Procedures from the Internet to find, I made some changes and additions.


The temperature data is obtained by the DS3231's internal integrated temperature sensor, and the error given in the manual is plus or minus 3 degrees.

After the actual operation of one week, the clock error is about one second.


This version comes with a single-key shuttle function that allows you to adjust dates and times at any time.


Compared with the previous version without shuttle adjustment function, a rotary encoder with switch was added on the hardware this time, and the connection between the LCD module and Arduino NANO was also adjusted.


The Arduino development software USES version 1.6.7, which can be downloaded from the Arduino official website. The address is as follows:
https://www.arduino.cc/en/Main/Software?setlang=cn

 


Actual working effect:


 

 


 

Circuit diagram:

 

 

Arduino Nano module:

 




DS3231clock module

 

 

 




 

1602 tft lcd display

 

 




 

EC11 Rotate encoder with switch

 

 

 




Module assembly completed

 

  




 

Date time adjustment method:


1. When running normally, press the switch and the clock will stop running. A "N" character will appear on the display screen for confirmation bit (the 10th character bit in line 2). 


2. turn the knob, the year will change.After the correct year, press the switch, the cursor moves to the position of the month, and then turn the knob, the month will change. Repeatedly press the switch, the cursor will stay in the position of day, week, hour, minute and second in order to modify the value of day, week, hour, minute and second in turn.


3. then press the switch, the cursor to confirm the position, that is, "N" character, turn the knob, the character will turn into "Y", "X", "N".


4. After confirming the position of "Y", press the switch, the previous date and time change will be saved immediately and take effect, and the clock will exit the adjustment mode and return to normal travel time;


Or, after confirming the position of "N", press the switch and return the cursor to the position of year.


Alternatively, after confirming the position of "X", press the switch, the date and time changes made will be ignored, and the clock will exit adjustment mode and return to normal travel time.

 

 



TFT LCD Display + Arduino NANO + DS3231 High precision digital clock