Digital Clock Using Arduino Uno, Shift Register CD4094, RTC DS3231. Time , Temperature, Date Display
by rupjit81 in Circuits > Arduino
1129 Views, 0 Favorites, 0 Comments
Digital Clock Using Arduino Uno, Shift Register CD4094, RTC DS3231. Time , Temperature, Date Display

In this project we made a digital clock using Arduino Uno and RTC DS3231. RTC 3231 is used as real time clock. We used DS3231 as DS3231 RTC module. The display uses shift registers. We used CD4094 shift registers for the display.
The circuit displays three parameters
- Time
- Temperature
- Date
The time update if required can be done using serial port.
Supplies
- Arduino Uno 1 no.
- Shift register CD4094 4 no.
- Seven segment displays 4 no.
- Wires and jumpers 1 no.
- Bread board 1 no.
- USB programming cable 1 no.
Description






The circuit of the clock is divided into three parts
Date: The date calculation is done like this
int count_1 = RTC.getDay() / 10 ; // 1 o/p
int count_1_r = RTC.getDay() % 10 ;// 2 o/p
int count_2 = RTC.getMonth() / 10 ; // 1 o/p
int count_3 = RTC.getMonth() % 10 ;// 2 o/p
Temperature: The temperature calculation is done like this
float temp_now = RTC.getTemp();
int count = temp_now*100;
int count_3 = count/1000 ; // display it 9
int count_3_r = count % 1000 ; //812
int count_2 = count_3_r / 100 ; // display it 8
int count_2_r = count_3_r % 100; // 12
int count_1 = count_2_r / 10 ; // 1 o/p
int count_1_r = count_2_r % 10 ;// 2 o/p
Time: The time calculation is done like this
int count_1 = RTC.getHours() / 10 ; // 1 o/p
int count_1_r = RTC.getHours() % 10 ;// 2 o/p
int count_2 = RTC.getMinutes() / 10 ; // 1 o/p
int count_3 = RTC.getMinutes() % 10 ;// 2 o/p
The display is done using shift registers CD4094. We used four shift registers. The output of each shift register is fed to seven segment display.
The sample display routine is shown below
digitalWrite(clockPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, j[count_3]);
digitalWrite(clockPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, j[count_2]);
digitalWrite(clockPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, j[count_1_r]);
digitalWrite(clockPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, j[count_1]);
delay(1000);
digitalWrite(sqw_pin_9, !digitalRead(sqw_pin_9));
digitalWrite(sqw_pin_10, !digitalRead(sqw_pin_10));
The circuit diagram of the project is attached as well.
This was implemented on bread board.