Real Time Clock & Calendar Module RTC DS1302 w/ Battery Backup

  • Was  RM10.00 
  • RM5.00

  • Product Code: DS1302
  • Availability: In Stock

DS1302 real time clock module
A real-time clock / calendar and 31 bytes of static RAM, via a simple serial interface to communicate with the microcontroller. Real-time clock / calendar circuit provides seconds, minutes, hours, days, weeks, months, years of information, the number of days per month and new year automatically adjusted the number of days. Clock operation by AM / PM indicator decided to use 24 or 12-hour format.

DS1302 between the microcontroller can simply adopt the way synchronous serial communication port only used three lines:

  • RST Reset
  • I / O data lines
  • SCLK Serial Clock. Clock / RAM read / write data in a byte or up to 31 bytes of character set type communication.


DS1302 Features:
Real-time clock with energy calculations before 2100 seconds, minutes, hours, day, week, month, year capacity, as well as the ability to leap year adjustment
serial I / O ports such a way that a minimum number of pins. Order to work to maintain low power consumption less than 1mW.

Specification:

  • Operating voltage: 2V - 5V DC
  • Current: 300nA
  • Backup battery: Genuine celestial CR2032 3V 260mAh non-rechargeable batteries. (Theoretical data retention time is more than 10 years)
  • Crystal 32.768KHz (Japan imported crystal, matching capacitance 6pF, size 2 x 6mm)
  • Working temperature: 0ºC - 70ºC
  • PCB size: 44mm x 23mm x 1.6mm


Note:
1. VCC and GND not to reverse or it will burn the chip
2. C51 MCU P0 port requires pull-up resistor, if your device does not have a pull-up resistor can be connected to other ports data lines 

 

For most applications this code is very long and not very easy to understand, so the staff Virtuabotix adapted this code and created a library called virtuabotixRTC ( click here to download the library). It is very easy to work the DS1302 along with other Arduino functions.

#include  <virtuabotixRTC.h>  //

// Creation of the Real Time Clock Object
//SCLK -> 6, I/O -> 7, CE -> 8
virtuabotixRTC myRTC(6, 7, 8);

void setup() {
  Serial.begin(9600);

  // Set the current date, and time in the following format:
  // seconds, minutes, hours, day of the week, day of the month, month, year
  myRTC.setDS1302Time(00, 59, 23, 6, 10, 1, 2014);
}

void loop() {
  // This allows for the update of variables for time or accessing the individual elements.
  myRTC.updateTime();

  // Start printing elements as individuals
  Serial.print("Current Date / Time: ");
  Serial.print(myRTC.dayofmonth);
  Serial.print("/");
  Serial.print(myRTC.month);
  Serial.print("/");
  Serial.print(myRTC.year);
  Serial.print(" ");
  Serial.print(myRTC.hours);
  Serial.print(":");
  Serial.print(myRTC.minutes);
  Serial.print(":");
  Serial.println(myRTC.seconds);

  // Delay so the program doesn't print non-stop
  delay( 5000);
}

Real Time Clock Project ideas:

This Real Time Clock (RTC) Module could be used for a plethora of projects.  The RTC can be interfaced to the micro controllers in order to control timed events.  This is especially helpful when timing is critical to the project.  

Write a review

Note: HTML is not translated!
    Bad           Good

 

Related Products

Tags: RTC