DS1307 pin out, introduction to ds1307, DS1307 working, DS1307 applications, DS1307Hello friends, I hope you all are doing great. In today’s tutorial, we are gonna have a look at detailed Introduction to DS1307. DS1307 is a real-time clock. It is a low power device and also has battery backup, which provides power when its external power supply not working or is off. It works on the I2C protocol. It is a bidirectional device and it can send and receive data on both sides.

DS1307 is used in industrial projects where constant time and date of some projects or working is required. I will give you a detailed overview of this time and date indicator IC. In today’s post, we will have a look at its pinout, working, basic circuit, protocol, etc. I will also share some links of projects where I have interfaced it with Arduino and some other Microcontrollers. Friends, if you have any questions, please ask in comments and I will try my best to solve your problems and will give you comprehensive answers. So let’s get started with basic Introduction to DS1307:

Introduction to DS1307

  • DS1307 is a Real-Time Control (RTC) IC. In DS1307, data is transferred in binary decimal coded, bits pattern. The data transfer rate in DS1307 is 56 bytes.
  • The memory which is used in DS1307 is NV SRAM. NV SRAM is basically a non-volatile random access memory. In working, NV SRAM is quite similar to static random access memory(SRAM).
  • DS1307 is an electronic device which plays an impotent role in real-time embedded systems. In embedded systems, we can get benefits of system clocks, students attendance time and date, we can also use it as an alarm for special work.
  • DS1307 consists of a built-in power-sense circuit. The purpose of the built-in power-sense circuit is that if power gets cut-off, then it will automatically switch to back up power supply. In this way, our circuit remains in working condition.
  • The protocol on which DS1307 works is I2C. I2C is a single line protocol in which data is transferred bit by bit along a single wire.DS1307 pin out, introduction to ds1307, DS1307 working, DS1307 applications, DS1307
  • Now let’s have a look at DS1307 Pinout:

DS1307 Pinout

  • DS1307 has a total of 8 pinouts, which are described below:
    • PIN 1,2: These pins are for standard 32.768 quartz crystals. Both pins can be used as input and output for internal oscillator. If X1 is input then X2 is used as output.
    • PIN 3: This pin is used for battery connection to DS1307.
    • PIN 4: We have to apply Ground on this pin.
    • PIN 5: This pin is labeled as SDA, which is short for Serial Data Line.
    • PIN 6: It is used for serial clock input (SCL) and data synchronized.
    • PIN 7: This pin is used for output square wave obtainer (SQW).
    • PIN 8: At this pin, we provide an external power supply (Vcc).
  • Now let’s have a look at the pinout picture:DS1307 pinout, introduction to ds1307, DS1307 working, DS1307 applications, DS1307

Now let’s have a look at I2C protocol

I2C Protocol

  • I2C is a serial protocol in which data is transferred bit by bit.
  • I2C combine the best feature of  SPI and UART. By using it with one microcontroller we can control many slave devices.
  • In I2C data is transferred in the form of messages, then we convert messages into data form. Each message has an address frame that contains a binary address of devices which under control.
  • I2C protocol is cheaper to implement then SPI protocol. SPI control one slave device while I2C control more than one device.
  • For better understanding lets have a look at the I2C protocol picture.DS1307 pin out, introduction to ds1307, DS1307 working, DS1307 applications, DS1307 Now let’s have a look at working of DS1307

Working of DS1307

  • For a better understanding of the working of DS1307 let’s discuss a circuit in which we use it.
  • In this simple circuit, we connect its first two pins which are X1 and X2 with 32.768 kHz crystal oscillator as the source for the chip.
  • The third pin is connected with a battery of 3V.
  • At Vcc, we give 5v supply and it can be given by using a microcontroller. If Vcc is not provided then read and write condition are inhibited.

Let us have a look at the circuit:DS1307 pinout, introduction to ds1307, DS1307 working, DS1307 applications, DS1307

  • Starts and stop conditions are required when one device wants to communicate with other devices in the I2c protocol.
  • For obtaining start condition we provide specific identification and address register to a device, by this, we get start condition.
  • For a better understanding of stop and start condition lets have a look at clock figure.DS1307 pinout, introduction to ds1307, DS1307 working, DS1307 applications, DS1307

  • Let’s have a look at Feature of ds1307.

Features of DS1307

  • In this section, I have designed a table where I have placed all features of DS1307 along with their symbols and units.
1.Supply VoltageVCC5V
2Logic 1 InputVIH2.2V
3Logic 0 InputVIL+0.8V
4VBAT Battery VoltageVBAT3.5V
5Input LeakageILI1uA
6I/O LeakageILO1uA
7Logic 0 OUTPUTVOL0.4V
8Active Supply Current
(fSCL = 100kHz)
9Standby CurrentICCS200uA
10VBAT Leakage CurrentIBATLKG50nA
11Power-Fail Voltage (VBAT = 3.0V)VPFtd>1.284 x
12VBAT Current (OSC ON);
13VBAT Current (OSC ON);
SQW/OUT ON (32kHz)
14VBAT Data-Retention Current
(Oscillator Of)
15SCL Clock FrequencyfSCL100kHZ
16Bus Free Time Between a STOP and
START Condition
17Hold Time (Repeated) START
18LOW Period of SCL ClocktLOW4.7us
19HIGH Period of SCL ClocktHIGH4us
20Setup Time for a Repeated START
21Data Hold TimetHD:DAT0us
22Rise Time of Both SDA and SCL
23Fall Time of Both SDA and SCL
24Setup Time for STOP ConditiontSU:STO4.7us

Now, let’s discuss applications of DS1307

Applications of DS1307

  • These are some applications of DS1307, Lets disuses them.
  • As we know DS1307 is used to tell continues time and date showing purpose, that way it is an electronic device such as a computer, mobile, and laptops.
  • By using it with Arduino we can use it in several projects related to data logging, alarm, clocks, etc.

So, that was all about this Real Time Clock DS1307. I hope you have enjoyed today’s tutorial and it will help you with your engineering projects. Will meet you guys in the next tutorial, till then take care and have fun !!! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.