Tags: Clock, Module, , sensor, integration, science, kits, kids, projects, robot, car, high, school, primary, secondary, Real, Time, Clock, RTC, Module, DS1302

Real Time Control RTC Module DS1302

  • 10.00 AED
    • Ex Tax:10.00 AED
    • Product Code: DS1302
    • Availability: In Stock
    DS1302  is real time clock module contains 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, th..

    DS1302  is real time clock module contains 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 leap year automatically adjust 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: (1) RST Reset (2) I / O data lines (3) SCLK Serial Clock. Clock / RAM read / write data in a byte or up to 31 bytes of character set type communication. DS1302 work to maintain low power consumption data and clock information when power is less than 1mW

    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
    Wide operating voltage range 2.0 5.5V
    2.0V, operating current of less than 300nA
    read / write clock or RAM data transfer mode, there are two single-byte and multi-byte transfer mode transmission character set
    8-pin DIP package or an optional 8-pin SOIC surface mount package under simple 3-wire interface
    Vcc = 5V and TTL compatible
    Optional industrial temperature range of -40 to +85
    dual power tubes used for the main power supply and backup power supply

     

    And in this Small tutorial we are going demonstrate how to use the DS1302 Real Time Clock with Arduino board
     the DS1302 trickle-charge timekeeping chip contains a real-time clock and calendar and 31bytes of static RAM and its communicating with a microcontroller or microprocessor via a simple serial interface. The DS1302 real time clock and calendar provides seconds, minutes, hours, day, date, month, and a year information, end of the month date is automatically adjusted for months with fewer than 31 days, including corrections for leap year. The clock operates in 24 hours or 12 hours format with AM and PM indicator.

    This module is very useful for making things running on date and time, it can be interface to any micro controller or micro processor in order to control the events. this also helpful specially when driving timings and execution on a precise time.

    Interfacing the DS1302 with a MCU is simplified by using SSC(Synchronous Serial Communication) Only three wires are required to communicate with the DS1302 clock Random Access Memory or RAM. The required wire will be CE(Chip Enable), IO(Input Output Data Line), and SCLK (Serial Clock). from the clock RAM has a 1 byte at a time or in a burst of up to 31 bytes and data can be transferred also. These chip is designed to operate on very low power and retain data and clock information on less than 1uW.

    DS1302_Wireing-Diagram

    DS1302-Pin-Out-Schematic2

    The wiring schematics diagram above for the DS1302 Clock Module, can support two power supply Voltage input 1 and Voltage Input 2, Voltage is set to the primary the chip can handle typically 3.3v ~ 5v, the voltage input 2 also is set to accept the primary power. The VCC 1 is set for the backup power, provided by 3.3v Coin Battery. The quarts crystal is placed between the pin 2 and pin 3, the pin 5 and 7 are assigned for the data communication between the module and the microcontroller. The module also can handle Pulse With Modulation, Digital, Communication or Analog pins and work well.

    Wiring to Arduino Board

    Wiring-DS1302-Arduino-Real-Time-Clock-Diagram2

    Before you can run the code below you need to include the code library witch is can be found here | Zip

    #include <MyRealTimeClock.h>

    MyRealTimeClock myRTC(6, 7, 8); // Assign Digital Pins 

    void setup() {

    Serial.begin(9600);

    /* To set the current time and date in specific format 

    | Second 00 | Minute 59 | Hour 10 | Day 12 |  Month 07 | Year 2015 |

    */

    myRTC.setDS1302Time(00, 59, 10, 12 , 10, 07, 2015);}

    void loop() {

    // Allow the update of variables for time / accessing the individual element. 

    myRTC.updateTime();

    Serial.print("Current Date / Time: "); 

    Serial.print(myRTC.dayofmonth); // Element 1

    Serial.print("/"); 

    Serial.print(myRTC.month); // Element 2

    Serial.print("/");

    Serial.print(myRTC.year); // Element 3

    Serial.print(" ");

    Serial.print(myRTC.hours); // Element 4

    Serial.print(":");

    Serial.print(myRTC.minutes); // Element 5

    Serial.print(":");

    Serial.println(myRTC.seconds); // Element 6

    delay( 5000);

    }

    Download The Code Library Here |  Zip

    Download The Sample Demo Code 1 Here | Zip

    Download The Sample Demo Code 2 Here | Zip

    Download The Data Sheet  Here | PDF