Interfacing RTC DS1307 with atmega32

Interfacing DS1307 with atmega32

Interfacing RTC DS1307 with atmega32

Project Fundamentals:

DS1307 is a Real Time Clock ( RTC ) IC that can count second,minute,hour,day,month,year and day of week precisely. You can use AVR timers to make RTC but when power supply drop from AVR , time will be reset! but DS1307 have a pin to connect a tiny battery, with a coin size battery DS1307 can count time for more than 2 years, non-stop!

DS1307 connect to microcontroller trough I2C protocol. it is so simple to use this IC in Codevision AVR because this IC has header file and library and system designer easily can use this IC in project. DS1307 is precise, cost efficient and easy to use RTC IC. For interfacing DS1307 with I2C you only need 2 Resistor and nothing else.

DS1307 widely used in Commercial, Industrial and academic projects.

Important Notice: If you want to make a precise RTC buy high quality IC and High Quality 32.768 KHz Crystal.

 Project Description :

This is a Codevision AVR Project. you can download Source File + Schematic File ( Proteus ). You can run project in Proteus. For me this project run and work correctly but some people report a problem in simulation.

In this project we use DS1307 as RTC and connect this IC to AVR Atmega32 trough I2C. A 32.768 KHz Crystal connected to DS1307 pin 1 and pin 2  as clock crystal. DS1307 pin3 should be ground if you won’t use battery, if you want use battery you should connect battery + to pin3 and battery – to GND.

We use 16×2 Alphanumeric LCD as Display and show Date and Time on this LCD. 3 key placed to set date and time. this 3 keys connected trough OR gate to External Interrupt ( INT0 ) you can use diode as OR gate. to adjust date and time first should press “SET” key then selected part show in right of lcd (for example “H” means Hour ready to edit), by pressing + and – keys you can increase or decrease selected item, by press SET key again next item will be select and generally use this key to select date, time, hour, …. . to exit edit mode press SET key and hold for 1 second.

Download Project:

File Size: 221.0 KB

Download: Download Interfacing DS1307 Project

  • Renuka

    It helps me alot in project ..Really Thanq so much..
    But I want header files that are included in the code..please if possible send it.

    • Mohammad Hamidi

      Header files sent to your e-mail.

      • shubham hedau

        hello sir , i want header files or project solution for DS1307 and LCD for our project.

  • Apurva

    Please help me with all header files used in this program..and support for my project..

    • Mohammad Hamidi

      I sent you all header files used in this project.

  • Ibrahim

    Dear sir
    Kindly send me the header file of this project.

    • Ibrahim

      Mr Hamidi.
      Iam very much impressed with your product ” Interfacing ATMEGA16+ DS1307+ LCD”. Please help me by providing header files of this project. Its very urgent. I hope u will understand.

  • Athar

    Brother your project is realy amazing but unfortunately i have to edit the code for my project but when i try to edit it says header files missing…kindly bro send me the header files u have used your soon reply will be highly appreciated.

  • ganbayar

    header files please

  • Ram

    Hai sir ,

    I doing ds1307 RTC program mini project . I saw your project is really good .Please help me with all header files used in this program.

  • Ahmed

    Thank you very mush. but I need h files please