Real Time Clock with DS1307 Using Arduino

                                               Real-Time Clock With DS1307 Using Arduino



This project shows the time and date using Arduino UNO and DS1307 RTC chip and shows it on the LCD (16X2) and which can be set with two push buttons.  


DS1307

DS1307 RTC is an IC. It maintains the time,  month, date, and year. 


NAME OF THE REQUIRED COMPONENTS:

  • Arduino UNO

  • Button (2)

  • LM016L (LCD 16X2)
  • DS1307 (RTC Chip)
  • Resistor (10k (2))


CIRCUIT DIAGRAM:



In the circuit, there is an LCD that is connected with the Arduino pins (2, 3, 4, 5, 6, 7) and the pin RW (LCD pin) which is connected to the ground. 

There are two Buttons that are connected to the Arduino pin (8, 9).

 DS1307 pins (SCL, SDA) are connected with the Arduino pins (A5, A$).


In the code DS1307 work with the BCD format 

For Example

(convert the BCD to Decimal)

             hour =  (hour >> 4)  *  10  +  (hour & 0x0F);

(Convert the Decimal to BCD)

            hour  = ((hour / 10) << 4)  +  (hour % 10);

 

void DS1307_display()

                         It converts the BCD to decimal format and it shows (display) time, month, and year.



CODE:






HERE YOU CAN DOWNLOAD THE ARDUINO LIBRARY 




FOR HELP CONTACT US

logo by alejandro_velasquez (@pixabay)