Phone

    00852-6915 1330
  • Contents

ⅠIntroduction

RTC is an abbreviation for Real-Time Clock. RTC modules are simply TIME and DATE remembering systems with a battery setup that keeps the module running in the absence of external power. This keeps the TIME and DATE current. As a result, we can get accurate TIME and DATE from the RTC module whenever we want.

Catalog

ⅠIntroduction

Ⅱ RTC Module Explaintion

1.1 What is RTC module?

1.2 Timing

Ⅲ DS1302 RTC Module Basics

3.1 DS1302 RTC Module Pinout

3.2 DS1302 Pin Configuration

3.3 Features

3.4 Technical Specifications

 3.5 Block Diagram of DS1302 RTC Chip

Ⅳ DS1302 RTC Module with Arduino

4.1 Setting up the Hardware

4.2 Making the Code

Ⅴ FAQ

 

Ⅱ RTC Module Explaintion

1.1 What is RTC module?

A real-time clock (RTC) is an electronic device that measures the passage of time (typically in the form of an integrated circuit).

Although the term is most commonly associated with devices found in personal computers, servers, and embedded systems, RTCs can be found in almost any electronic device that requires an accurate time of day.

A real-time clock mechanism and a long-lasting battery are used by an RTC module to keep track of the time. On a small board with five pins, the module contains a 3V lithium-ion battery, a 32 kHz crystal, and a DS1302 chip. The DS1302 chip is extremely power efficient and can run for up to 5 years on a 3V lithium battery.

Figure1:RTC Module

 

 

The power supply voltage  is 5 volts. The serial  I2C  communication protocol is used by the RTC module.  which makes interfacing with the microcontroller very simple. Aside from VCC and GND, only two pins (CLK and DAT) are required for interfacing with  Arduino . CLK and DAT are the required SCL and SDA pins for  I2C communication, respectively, while RST is the reset pin (optional).

 

1.2 Timing

The majority of RTCs use a crystal oscillator,[8][9] but some can use the power line frequency.  The crystal frequency is typically 32.768 kHz, which is also the frequency used in quartz clocks and watches. It is a convenient rate to use with simple binary counter circuits because it is exactly 215 cycles per second. The low frequency saves power while remaining above the range of human hearing. The temperature has little effect on the size of these crystals' quartz tuning forks, so the temperature has little effect on their frequency.

Some RTCs employ a micromechanical resonator on the RTC's silicon chip. This reduces the size and cost of an RTC by reducing the number of parts. Micromechanical resonators are much more temperature-sensitive than quartz resonators. So, using an electronic thermometer and electronic logic, compensate for temperature changes.

Typical crystal RTC accuracy specifications range from 100 to 20 parts per million (8.6 to 1.7 seconds per day), but temperature-compensated RTC ICs are available with accuracy as low as 5 parts per million. In practice, this is adequate for celestial navigation, the traditional function of a chronometer. Chip-scale atomic clocks became available in 2011. Despite being significantly more expensive and power-hungry (120 mW vs. 1 W), they keep time to within 50 parts per trillion.

 

What is RTC and how it is working || real time clock|| diyproject || graspelectronics

RTC Module Video Description: what is rtc ? and how it is working ? RTC stands for real tme clock. RTC module code  is ds3231 the code is given in the datasheet for all components  . it is work in 3.3v  5v may kill the module. it is used to maintain accurate time keeping when main power to the device is interrupted. The rtc maintan maintains second,hours, day,date, month and year information. Real time clockThe date at end of the month is automatically adjusted for month with fewer then 31 days including corrections for leap years.

 

Ⅲ DS1302 RTC Module Basics

Before we start this project, we will have a look at basics of DS1302 RTC Module.

3.1 DS1302 RTC Module Pinout

Figure2: Pinout

 

3.2 DS1302 Pin Configuration

Pin No.

Pin Name

Description

1

Vcc2

Second supply input, when Vcc2 is greater than Vcc1 + 0.2V, DS1302 powers through this pin

2,3

X1 and X2

For connecting external crystal oscillator of 32.768kHz

4

GND

Ground

5

CE

This pin set to HIGH during a Read or a Write

6

I/O (Data Line)

This is the bi-directional data pin to 3-wire interface

7

SCLK(Serial Clock)

Used to synchronize data movement on the serial interface

8

Vcc1

Rechargeable energy source connected to this pin

 

3.3 Features

  • Minutes, seconds, date, hours, month, day of the week, year, and leap-year compensation up to 2100 are all counted in real-time.
  • Single and multiple (Burst mode) data transfers for Clock or RAM data read and write
  • 31*8 general-purpose battery-powered RAM
  • Simple interface based on three TTL-compatible wires
  • Full operation from 2V to 5.5V
  • Small size
  • pin DIP and 8-pin SO packages are available.

3.4 Technical Specifications

  • 3.3V is the typical supply voltage.
  • Voltage range (concerning ground) on any pin: -0.5V to 7.0°C
  • Temperature range (commercial): 0°C to +70°C
  • Temperature range (Industrial): -40°C to +85°C
  • Temperature range for storage: -55°C to +125°C
  • Temperature for Soldering: 260°C

Note: The DS1302 Datasheet, which is linked at the bottom of this page, contains all of the technical information.

 3.5 Block Diagram of DS1302 RTC Chip

Figure3:Diagram

 

3.6 How to Use a DS1302 Chip?

A typical DS1302 operating circuit is shown below. The DS1302 has two power inputs, one from the cell and one from the controller. To generate the required frequency, a crystal oscillator with a frequency of 32.768 kHz is used. The data line, reset pin, and serial-clock pins of the DS1302 are connected to the microcontroller for interfacing.

Figure4:Example

 

Ⅳ DS1302 RTC Module with Arduino

4.1 Setting up the Hardware

Pins A4 and  A5  on the  Arduino are dedicated to I2C communication. However, with the assistance of software code, any pin can be used to serve the purpose. This is known as a software I2C bus. For our purpose, we will use the "Rtc by Makuna" library, which can be found in the Arduino IDE's Tools -> Manage Libraries... menu. Following installation, the examples provided with the library can be used to learn more about the functions and initialization methods.

Figure5:Library Manager Arduino 

To use the following code, connect the RTC module's DAT, CLK, and RST pins to Arduino's digital pins 6, 7, and 8.

4.2 Making the Code

Now we must write the C code to set the current date and time in the RTC module, read from the module, and write to the serial monitor every second.

 

Figure6 :Code for connection with RTC Module

The line ThreeWire DatClkRst (6,7,8); creates a bundle of three wires that will be used to initialize the object Rtc from the RtcDS1302 class using the command RtcDS1302ThreeWire> Rtc(DatClkRst); The function SetDateTime resets the DS1302 chip's date and time. The date and time at the time of Arduino's C code compilation are saved in the RtcDateTime object "compiled." The loop() method has a one-second delay. Date and time are read from the RTC module and displayed on the serial monitor in each iteration.

To learn how to use this RTC module, remove the line and flash the Arduino with the updated code again. Even if the Arduino's power is turned off or the RTC module is disconnected and reattached, the Arduino will be able to read and display the correct real-time.

 

Ⅴ FAQ

1. Which RTC module is best?

Choosing The Right RTC For Your Project

  • The DS-1307 is often the default choice for an RTC. ...
  • The DS3234 has the distinction of using an SPI interface instead of I2C. ...
  • The RV-1805 draws so little power that this Sparkfun module gets by without a backup battery at all.

2. What is RTC module DS3231?

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

3. What is RTC in mobile phone?

A real-time clock (RTC) is an electronic device (most often in the form of an integrated circuit) that measures the passage of time.

4. What is RTC in laptop?

The real-time clock, or RTC, maintains the internal clock … in real time. That is how the laptop knows the time as well as the date whenever you turn it on. ... Or you can keep the laptop plugged into an AC source.

5. Does RTC work without battery?

The RTC module accurately keeps time with a precise oscillator and is maintained with a small battery (not included).

6. How does RTC module work?

An RTC maintains its clock by counting the cycles of an oscillator – usually an external 32.768kHz crystal oscillator circuit, an internal capacitor based oscillator, or even an embedded quartz crystal. Some can detect transitions and count the periodicity of an input that may be connected.

7. What is the difference between DS1307 and DS3231?

The main difference between the DS3231 and DS1370 is the accuracy of time-keeping. DS1307 comes with an external 32kHz crystal for time-keeping whose oscillation frequency is easily affected by external temperature. This usually results with the clock being off by around five or so minutes per month.

 

Kynix

Kynix was founded in 2008, specializing in the electronic components distribution business. We adhere to honesty and ethics as our business philosophy and have gradually established an excellent reputation and credibility in our international business. With the accurate quotation, excellent credit, reasonable price, reliable quality, fast delivery, and authentic service, we have won the praise of the majority of customers.

Join our mailing list!

Be the first to know about new products, special offers, and more.

Leave a Reply

We'd love to hear from you! Feel free to share your thoughts and comments below. Rest assured, your email address will remain private.

Name *
Email *
Captcha *
Rating:

Kynix

  • How to purchase

  • Order
  • Search & Inquiry
  • Shipping & Tracking
  • Payment Methods
  • Contact Us

  • Tel: 00852-6915 1330
  • Email: info@kynix.com
  • Follow Us

authentication

Kynix

© 2008-2026 kynix.com all rights reserved.