We are Apogeeweb Semiconductor Electronic

WELCOME TO OUR BLOG

Home  Product Technical Articles   DS1307 Real Time Clock: Pinout, Datasheet, Circuit [Video]

DS1307 Real Time Clock: Pinout, Datasheet, Circuit [Video]

Author: Mia
Date: 2 Apr 2021
 625
ds1307 arduino

DS1307 is a low-power Full Binary (BCD) Real Time Clock (RTC) IC with 56 bytes of SVRAM that communicates via I2C Protocol.

 

This blog provides you a detailed introduction to DS1307 RTC, including  its pinout, application, how does it work in a circuit, what's its difference between DS3231 and more, hope this blog helps and thank you for reading!

 

This is a tutorial video teaching people how to connect DS1307 with Arduino.


Catalog

DS1307 Description

DS1307 Pinout

DS1307 Features

DS1307 Parameter

What is I2C Protocol

DS1307 Working Principle

How to Use DS1307

DS1307 vs DS3231

DS1307 Application

DS1307 Manufacturer

DS1307 Package

Component Datasheet

FAQ


DS1307 Description

The DS1307 serial real-time clock (RTC) is a low-power, full binary coded decimal (BCD) clock/calendar plus 56 bytes of NV SRAM. Address and data are transferred serially through an I2C, bidirectional bus.

 

The clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The end of the month date is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with AM/PM indicator.

 

The DS1307 has a built-in power-sense circuit that detects power failures and automatically switches to the backup supply. Timekeeping operation continues while the part operates from the backup supply.

 

The DS1307 can operate in the following two modes:

  1. Slave Receiver Mode (Write Mode): Serial data and clock are received through SDA and SCL.

  2. Slave Transmitter Mode (Read Mode): The first byte is received and handled as in the slave receiver mode. However, in this mode, the direction bit will indicate that the transfer direction is reversed.


DS1307 Pinout

DS1307 RTC DS1307 RTC Pinout
DS1307 RTC DS1307 RTC Pinout

 

Pin Number Pin Name Description
1,2 X1 , X2 Crystal Oscillator should be connected to these pins
3 V-Bat Connected to Positive terminal of the battery
4 Ground Ground pin of the IC
5,6 SCL and SDA Pins for I2C communication with CPU
7 SQW / Out Square wave output driver pin to obtain square wave frequencies.
8 Vcc Powers the IC typically 5V

DS1307 Features

  • I2C Interface RTC IC

  • Operating Voltage: 5V

  • Less than 500nA current when operating with battery

  • 56bytes SVRAM

  • Operates in power or battery mode

  • Programmable square wave output pin

  • Available in PDIP and SO package


DS1307 Parameter

Type: Clock/Calendar
Features: Leap Year NVSRAM Square Wave Output
Base Product Number: DS1307
Interface: I²C 2-Wire Serial
Memory Size: 56B
Time Format: HH
Date Format: YY-MM-DD-dd
Voltage - Supply Battery: 2V ~ 3.5V
Current - Timekeeping (Max): 200µA @ 5V

What is I2C Protocol

I2C is a serial protocol that transfers data bit by bit.

 

I2C combines the best characteristics of SPI and UART. We can control many slave devices by using it with a single microcontroller.

 

Data is transferred in the form of messages in I2C, and the messages are then converted into data. Each message contains an address frame containing a binary address of the devices under control.

 

The I2C protocol is less expensive to implement than the SPI protocol. SPI controls a single slave device, whereas I2C controls multiple devices.

 

Let's take a look at the I2C protocol diagram for a better understanding.

I2C protocol picture


DS1307 Working Principle

Let's look at a circuit that uses the DS1307 to get a better understanding of how it works.

 

In this simple circuit, we connect the chip's first two pins, X1 and X2, to a 32.768 kHz crystal oscillator as the source.

 

The third pin is linked to a 3V battery.

 

We provide a 5v supply at Vcc, which can be provided by a microcontroller. If Vcc is not supplied, the read and write conditions are disabled.

working of ds1307

When using the I2c protocol, a device must have start and stop conditions in order to communicate with other devices.

 

We provide a specific identification and address register to a device in order to obtain the start condition.

 

For a better understanding of stop and start condition lets have a look at clock figure.

start stop condiction of ds1307


How to Use DS1307

The DS1307 is an 8-pin IC that runs on 5V and communicates with the CPU via the I2C protocol. A typical application circuit for the DS1307 is shown below, taken from the DS1307 datasheet.

ds1307 application circuit

As you can see, the IC has SCL (Serial Clock) and SDA (Serial Data) pins that it uses to communicate with the CPU; both of these pins must be pulled high using a resistor. The IC can be powered by applying 5V to the Vcc pin; if the power fails, it will automatically switch to battery mode, obtaining power from a Lithium cell connected to pin Vbat and ground.

 

Pins X1 and X2 are used to connect the crystal oscillator, which is typically a 32.7KHz Quartz crystal. The SQW pin generates a PWM square wave with programmable frequencies of 1Hz, 4KHz, 8KHz, or 32KHz. This pin also necessitates the use of a pull-up resistor. Only the I2C protocol is used to exchange data between the CPU and the RTC IC. This communication facilitates both reading and writing.

 

The IC can provide information such as a Real-Time Clock that counts seconds, minutes, hours, the date of the month, the month, the day of the week, and the year, with Leap-Year Compensation Valid Up to 2100.


DS1307 vs DS3231

DS3231DS3231

The DS3231 is also a low-cost, extremely accurate I2C real- time clock (RTC). But it is a RTC with an integrated temperature- compensated crystal oscillator (TCXO) and crystal. The device incorporates a battery input, and maintains accu- rate timekeeping when main power to the device is inter- rupted.

 

The main distinction between the DS3231 and the DS1370 is the accuracy of time-keeping.

 

The DS1307 includes an external 32kHz crystal for timekeeping, the frequency of which is easily affected by external temperature. As a result, the clock is usually off by about five or so minutes per month.

 

The DS3231, on the other hand, is much more accurate because it includes an internal Temperature Compensated Crystal Oscillator (TCXO) that is unaffected by temperature, allowing it to be accurate to a few minutes per year at most.

 

DS1307 is still a great value RTC that will serve you well, but DS3231 is recommended for projects that require more accurate time-keeping.


DS1307 Application

  • Robotics

  • Gaming

  • Servers

  • Computer Peripherals

  • GPS

  • Utility power meters


DS1307 Manufacturer

Maxim Integrated develops innovative analog and mixed-signal products and technologies to make systems smaller and smarter, with enhanced security and increased energy efficiency. We are empowering design innovation for our automotive, industrial, healthcare, mobile consumer, and cloud data center customers to deliver industry-leading solutions that help change the world.


DS1307 Package

ds1307 package


Component Datasheet

DS1307 RTC Datasheet


FAQ

  • What is DS1307?

The DS1307 is a low power Full Binary (BCD) Real Time Clock (RTC) IC with 56 bytes of SVRAM that communicates through I2C Protocol. The IC can work from directly supply on Vcc and switch to Battery automatically when required.

  • How do I know if DS1307 is working?

If you had a Master I2C/SMBus Engine tool built up, you could connect just it and the DS1307 together (with pull-ups and other essentials of course) and quickly see if you can communicate with the DS1307 in a few minutes. If you can, then you know that your DS1307 is working and it could be your C code.

  • How do I reset my RTC DS1307?

So to start, remove the battery from the holder while the Arduino is not powered or plugged into USB. Wait 3 seconds and then replace the battery. This resets the RTC chip.

  • Why RTC is used?

A real-time clock (RTC) is an electronic device (most often in the form of an integrated circuit) that measures the passage of time. Although the term often refers to the devices in personal computers, servers and embedded systems, RTCs are present in almost any electronic device which needs to keep accurate time.

 

Ordering & Quality

Photo Mfr. Part # Company Description Package PDF Qty Pricing
(USD)
DS1307 DS1307 Company:Maxim Integrated Remark:Real Time Clock (RTC) IC Clock/Calendar 56B I²C, 2-Wire Serial 8-DIP (0.300", 7.62mm) Package:8-DIP (0.300"", 7.62mm)
DataSheet
In Stock:On Order
Inquiry
Price:
Call
Inquiry
DS1307 DS1307 Company:Maxim Integrated Remark:RTC IC, Date Time Format (Day/Date/Month/Year hh:mm:ss), I2C, Serial, 4.5 V to 5.5 V, -8 Package:SOP8
N/A
In Stock:On Order
Inquiry
Price:
Call
Inquiry
DS1307N DS1307N Company:Maxim Integrated Remark:RTC IC, Date Time Format (Day/Date/Month/Year hh:mm:ss), I2C, 4.5 V to 5.5 V, DIP-8 Package:PDIP-8
N/A
In Stock:On Order
Inquiry
Price:
Call
Inquiry
DS1307Z DS1307Z Company:Maxim Integrated Remark:Real Time Clock (RTC) IC Clock/Calendar 56B I²C, 2-Wire Serial 8-SOIC (0.154", 3.90mm Width) Package:8-SOIC (0.154"", 3.90mm Width)
DataSheet
In Stock:On Order
Inquiry
Price:
125+: $2.00720
Inquiry
DS1307Z-T-R DS1307Z-T-R Company:Maxim Integrated Remark:Real Time Clock 64x8 Serial I2C RTC Package:SOIC-8
N/A
In Stock:On Order
Inquiry
Price:
Call
Inquiry
DS1307Z DS1307Z Company:Maxim Integrated Remark:Real Time Clock 64x8 Serial I2C RTC Package:N/A
N/A
In Stock:On Order
Inquiry
Price:
1+: $3.69000
10+: $3.31000
25+: $3.16000
50+: $3.06000
100+: $2.71000
250+: $2.58000
500+: $2.31000
1000+: $1.95000
2000+: $1.87000
Inquiry
DS1307Z-T DS1307Z-T Company:Maxim Integrated Remark:Rtc i²c 56B Nv Sram So8 Package:SOP8
N/A
In Stock:On Order
Inquiry
Price:
Call
Inquiry
DS1307Z-T-R DS1307Z-T-R Company:Maxim Integrated Remark:RTC IC, Date Time Format (Day/Date/Month/Year hh:mm:ss), I2C, 4.5 V to 5.5 V supply, SOIC-8 Package:SOP8
N/A
In Stock:On Order
Inquiry
Price:
Call
Inquiry
DS1307ZN DS1307ZN Company:Maxim Integrated Remark:Real Time Clock Serial 56Byte Clock/Calendar 8Pin SOIC N Package:SOIC-8
N/A
In Stock:On Order
Inquiry
Price:
Call
Inquiry
DS1307ZN-T-R DS1307ZN-T-R Company:Maxim Integrated Remark:Real Time Clock 64x8 Serial I2C RTC Package:SOIC-8
N/A
In Stock:On Order
Inquiry
Price:
Call
Inquiry

Related Articles

IC 74HC595 Application: 8 Bit LED Digital Tube

Mia 9 Oct 2020  952

I DescriptionDo you know what the Digital Tube Display needs? The display of the digital tube requires a digital tube and a control circuit of multiple digital tubes. Take the single-chip microcompute...

Continue reading »

LM386: Circuit of Oscillator

Irene 13 Oct 2020  5730

IntroductonLM386 is a low voltage audio power amplifier. LM386 adopts 8-pin double in-line plastic package with working voltage of 4V-15V. When the power supply voltage is 12V, 300mW output power can ...

Continue reading »

TIP3055 NPN Transistor: Equivalent, Datasheet, Pinouts [Video&FAQ]

Irene 9 Sep 2021  146

Product OverviewTIP3055 is a three layer NPN device within the working range, the collector current IC is a function of the base current IB, a change in the base current giving a corresponding amplifi...

Continue reading »

Introduction to L7812CV Voltage Regulator [FAQ]

Mia 31 Dec 2020  5273

The L7812CV is a three-terminal positive voltage regulator. This regulator can provide local on-card regulation, eliminating the distribution problems associated with single point regulation...

Continue reading »

STM32F4 STMicroelectronics: Features, Advantage, Datasheet

Iggy 2 Mar 2021  1138

STM32F4 is a series of high-performance microcontrollers developed by ST (STMicroelectronics). It uses 90nm NVM technology and ART technology (Adaptive Real-Time Accelerator). Catalog STM32F4 Featur...

Continue reading »

0 comment

Leave a Reply

Your email address will not be published.

 
 
   
 
Rating:

# 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z