Creative Commons images are CC BY-NC-SA 3.0

19.95

added to your
shopping cart

quantity
24 available 24 in stock
19.95 1+ units
17.96 10+ units
15.96 100+ units

Description: Here is a real time clock based on the DS3234 Real Time Clock IC. The DS3234 is a low-cost, extremely accurate SPI bus real-time clock with an integrated temperature-compensated crystal oscillator and crystal.

The RTC maintains seconds, minutes, hours, day, date, month, and year information. The date at the end of the month is automatically adjusted for months with fewer than 31 days, including corrections of leap year. The clock operates in either the 24-hour or 12-hour format with AM/PM indicator. Two programmable time-of-day alarms and a programmable square-wave output are provided.

The underside of the board holds a 12mm coin-cell battery holder for battery backup.

Note: These do not include a battery. See the related products below for a battery.

Features:

  • +-2ppm accuracy
  • Two alarms
  • SPI output
  • Low power consumption
  • Accurate calendar up to year 2100
  • Battery backup included

Documents:

Comments 107 comments

  • I created an implementation of JeeLabs RTClib for this unit. It’s posted on github.

    • Thanks for creating this library!! It helped a lot!!

      One thing I would add, is that you need to set the SPI data mode back to MODE0 after using this library if you are also using the SD card and the ethernet shield.

      Also, make sure you aren’t trying to access the clock while you have a file open on the SD card. I check the time, check for HTTP requests, and then serve a file. It seems you can get away with accessing the ethernet chip while files are open, but the RTC doesn’t work that way.

      I use the following functions:

      void set_time()
      
      {
      
      SPI.begin();
      
      RTC.begin();
      
      // RTC.adjust(DateTime(__DATE__, __TIME__));
      
      SPI.setDataMode(SPI_MODE0);
      
      }
      

      DateTime check_time()

      {

      DateTime now = RTC.now();
      
      SPI.setDataMode(SPI_MODE0);
      
      return now;
      

      }

      • I encountered a similar issue trying to use the sparkfun example with an SD card. In my case, I was using the DeadOn RTC and sparkfun example with the sparkfun microSD shield stacked on top of an arduino uno r3. I was initially only able to get either the SD or RTC working at any time despite an hour of troubleshooting.

        Eventually I came to this comment and changed the ReadTimeDate and SetTimeDate functions (added the two lines below at the beginning/end of the functions) to take care of the SPI mode switching, and everything works great!.

          SPI.setDataMode(SPI_MODE3);  // switch mode to clock
        
          code
        
          SPI.setDataMode(SPI_MODE0);  // switch mode to SD
        

        I also changed this line, as the SD chip select is pin 8

        const int  cs=10; // RTC chip select
        

        Finally, I changed the date format to yyyy-mm-dd hh:mm:ss including 0 placeholders for single digit values, which is much more useful to me:

            temp.concat("20");
            temp.concat(TimeDate[6]);
            temp.concat("-") ;
            if (TimeDate[5]<10) {
              temp.concat("0"); }
            temp.concat(TimeDate[5]);
            temp.concat("-") ;
            if (TimeDate[4]<10) {
              temp.concat("0"); }
        temp.concat(TimeDate[4]);
        temp.concat("  ") ;
            if (TimeDate[2]<10) {
              temp.concat("0"); }
        temp.concat(TimeDate[2]);
        temp.concat(":") ;
            if (TimeDate[1]<10) {
              temp.concat("0"); }
        temp.concat(TimeDate[1]);
        temp.concat(":") ;
            if (TimeDate[0]<10) {
              temp.concat("0"); }
        temp.concat(TimeDate[0]);
        return(temp);
        
    • Hey just wanted to say thanks for the library you posted. I really appreciate it as i am new to all this and was having trouble getting this clock talking with the whole SPI thing then realized the RTClib i had was wrong and meant for a DS1307. After adding your RTClib everything worked perfect! Seeing the differences I now understand a lot more about the arduino environment. I can’t thank you enough!

  • Seriously, $20 and no battery included? Why?
    ALL the other RTC’s I’ve purchased from SFE included a battery. What’s different? My fault for not noticing… but really?

  • Just to put things in perspective, +-2ppm is 2 seconds in 11.57 days or one minute in 347 days. Or just about one minute per year.
    For a simple crystal RTC, this is great. For a highly accurate timepiece it is marginal. If accurate time is your holy grail, then a GPS or radio time piece might be a better choice. In those cases you get tied back to the world time standard and will not suffer drift.

    • I hope you agree with me that it is +- (plus or minus) 2ppm. this means that drift can occur in both directions, so what you are sketching is a worst case scenario.

    • My math comes up with different numbers. +/-2ppm = 2E6, there are 60 sec/min, 3600 sec/hr and 86400 sec/day. 2E6 divided by 86400 sec = 23.148148 Days. Therefore if the error remained constant at plus or minus 2ppm it would take 23 days, 3 hrs, 33 min and 20 sec to gain or loose 1 sec repectively.

      • I think there is something wrong on those numbers! ppm stands for parts-per-million (10E-6) so +/-2ppm is +/-2E-6 or +/-0.0002% of error.

        The error after one day will be 0.0002% of 86400 sec = 0.1728 sec To have 1 second it only needs 5.787 days! And this will be true if the device is operating at ambient temperature (25ºC). If not then the temperature should be taken into account!

        Maxim has a nice Real-Time Clock Calculator for ppm ( http://www.maxim-ic.com/design/tools/calculators/product-design/rtc.cfm ), check it out!

      • Sorry, I wasn’t pay attention to what I was reading. 2 seconds in 11.57 days = 1 second in 23.14 days, therefore my math does agree with your numbers. Can I chalk it up to a long day?

    • Ive just got mine going, and I’m losing about 3 seconds per day right now… This is totally unacceptable! Has anyone else had an issue like this?

    • Yes - this great for small projects, or beginners though, and easier to use. It’s perfectly good for things that don’t need to be at an exact time, but around the same time.

  • Hello, I’ve two DS3234 connected to two different Arduinos, I followed this tutorial http://www.l8ter.com/?p=375 one of them works perfectly but the other show me the following in Serial monitor:

    10/10/10 10:10:0 11/11/11 11:11:11 12/12/12 12:12:12 13/13/13 13:13:13 14/14/14 14:14:14 15/15/15 15:15:15 16/16/16 16:16:16 17/17/17 17:17:17 18/18/18 18:18:18 19/19/19 19:19:19 20/0/20 20:20:20 21/1/21 21:21:21 22/2/22 22:22:22 23/3/23 23:23:23 24/4/24 24:24:24 25/5/25 25:25:25 26/6/26 26:26:26 27/7/27 27:27:27 28/8/28 28:28:28 29/9/29 29:29:29 30/10/30 3:30:30 31/11/31 4:31:31 32/12/32 5:32:32 33/13/33 6:33:33 34/14/34 7:34:34 35/15/35 8:35:35 36/16/36 9:36:36 37/17/37 10:37:37 38/18/38 11:38:38 39/19/39 12:39:39 0/0/40 0:40:40 1/1/41 1:41:41 2/2/42 2:42:42 3/3/43 3:43:43 4/4/44 4:44:44 5/5/45 5:45:45 6/6/46 6:46:46

    It seems that every second increase all records in one unit, if I only read every 5 seconds they increased 5 units. Could it be a wiring or soldering problem or is the DS3234 damaged?

    Best regards.

    • That particular code has an error. The line which reads

            SPI.setDataMode(SPI_MODE1)
      

      should really read

            SPI.setDataMode(SPI_MODE3)
      

      It is true that the manufacturer’s data sheet claims that SPI should work in both modes 1 and 3. However, I have found that, in practice, SPI only works in mode 3 with the chip. That problem may not necessarily be a problem with the manufacturer. The problem may lie with the SPI library itself.

  • Hello, I’ve two DS3234 connected to two different Arduinos, I followed this tutorial http://www.l8ter.com/?p=375 one of them works perfectly but the other show me the following in Serial monitor:

    10/10/10 10:10:0 11/11/11 11:11:11 12/12/12 12:12:12 13/13/13 13:13:13 14/14/14 14:14:14 15/15/15 15:15:15 16/16/16 16:16:16 17/17/17 17:17:17 18/18/18 18:18:18 19/19/19 19:19:19 20/0/20 20:20:20 21/1/21 21:21:21 22/2/22 22:22:22 23/3/23 23:23:23 24/4/24 24:24:24 25/5/25 25:25:25 26/6/26 26:26:26 27/7/27 27:27:27 28/8/28 28:28:28 29/9/29 29:29:29 30/10/30 3:30:30 31/11/31 4:31:31 32/12/32 5:32:32 33/13/33 6:33:33 34/14/34 7:34:34 35/15/35 8:35:35 36/16/36 9:36:36 37/17/37 10:37:37 38/18/38 11:38:38 39/19/39 12:39:39 0/0/40 0:40:40 1/1/41 1:41:41 2/2/42 2:42:42 3/3/43 3:43:43 4/4/44 4:44:44 5/5/45 5:45:45 6/6/46 6:46:46

    It seems that every second increase all records in one unit, if I only read every 5 seconds they increased 5 units. Could it be a wiring or soldering problem or is the DS3234 damaged?

    Best regards.

  • I have this hooked up to an Arduino Uno board, and can set and read time with no problems, although things only work in SPI mode 3.

    Next I tried to get the SQW pin to trigger an interrupt on the Arduino every second, and that’s where I’m not getting things to work. Hoping someone can help me.

    I hooked up Arduino pin 2 to SQW, and added a 4.7K resistor from SQW to Vcc. In my sketch, I do pinMode(2,INPUT) and then hook up the interrupt function. I then set register 0x8E to 0x60. I was expecting the interrupt to fire once a second, but it never does.

    If I disconnect the connection to SQW and move by hand touch it to GND, the interrupt fires as I would expect.

    I unfortunately do not have a scope or logic analyzer handy… I’d appreciate any insight on what I’m missing here.

    Niels.

  • Does this work with Arduino?
    And also, how specifically should I wire it up?

    • Yes.
      Just wired it up like this.
      Pin 13 SCK
      Pin 12 MISO
      Pin 11 MOSI
      Pin 8 SS
      Also i had to change a line in the example code to be able to set the time.
      SPI.setDataMode(SPI_MODE3); // Mode1 didnt work

      • I have mine wired as Pin 13 CLK (there’s no pin marked SCK on the RTC board) Pin 12 MISO, Pin 11 MOSI, and pin 8 SS. Using the example code, I tried MODE1 and MODE3 and both result in the following being displayed:
        45/25/165 18:85:85
        or
        0/0/0 0:0:0
        Any ideas? Thanks.

        • I am having the same issue.
          Wired the RTC up like above but neither MODE1 nor MODE3 are giving a different result from 0/0/0 0:0:0
          Also tried using RTClib as suggested in this thread.
          Possibly a defective part?

        • I would recommend soldering on some break away headers to make sure the connection to the chip and your breadboard is solid. I had the same issue but this solved it.

        • Check on the second line of the example code, that the “cs” constant has the same number with the pin that you connect the “ss” pin on the DS3234

        • I was experiencing the 45/25/165 18:85:85 / 0/0/0 0:0:0 issue as well. Turns out I had the wiring wrong (I’m a beginner). I’m using the Mega 2560 and I have it wired up as follows:
          GND - GND
          VCC - 3.3v
          SQW - GND
          CLK - 52
          MISO - 50
          MOSI - 51
          SS - 8
          battery is attached
          It now works with both Sparkfun’s example and maniacbug’s library (which is awesome!).

    • Yes this works with an Arduino, please see the Example Code. I just named it .c instead of .pde for display in notepad++. As for wiring please check http://www.arduino.cc/playground/Code/Spi. With the exception of SPI slave select which is pin 8 in the Example Code that page should help.

  • Are there any issues using this with a 3.3V micro? I have integrated this with a logomatic via the SSP1 and it works pretty well 99% of the time but sometimes I fail to clear the alarm flag - when this happens repeated writes don’t make much difference

  • Initially I could not get the control register to set using the example sketch. After a lot of troubleshooting I found the problem was that in the example code the CS pin is never set HIGH before going LOW for the initialization transmission. In that case the RTC doesn’t see the falling edge and doesn’t listen to the command.

    It seems to me that the example sketch has a confusing initialization state. It is set to transmit 0x60, which looks like it sets the oscillator enabled, BBSQW to logic 1 (SQW on when in battery mode) and the temp conv to logic 1 (forcing one immediate user-initiated temp conversion). I don’t know if that was the intended setting based on the code’s comments and the data sheet.

    I set my control register to 0x00 which sets: oscillator enabled, a 1 Hz square wave (when normally powered, and SQW off in battery mode) and alarms off. If a square wave is not desired, then the control register could be left in the default condition with no ill effects.

  • It is written in the “Note” than the battery is not include but then in the “Features” than the battery is include??

  • It might be cool to switch the 12mm lithium primary cell out for a rechargeable battery. Connect a series diode and 1.1k resistor from Vdd to recharge the battery. An SMT rechargeable like a Panasonic ML-621S/DN would work well. You could keep a few more batteries out of landfills that way and the clock would still stay set for about a month unplugged.

  • Hi Do you know a full Arduino library for this? That prints time, temperature. Allows to change time and set both alarms. Thx

  • triple post, please delete

  • .double post..please delete

  • Hi, I have an Arduino Mega 2560 R3 and this LCD shield with 5 buttons : http://www.teguna.ro/produse/Shield-Arduino/shield_LCD_tastatura My shield occupies and uses pins 8->13 so I tried to use the example mentioned bellow: 50 (MISO), 51 (MOSI), 52 (CLK), 53 (SS), GND & SQK grounded, VCC to +5 but without any luck. The clock is working Ok on my other Arduino Uno but I can’t seem to be able to make it work on my Mega + LCD shield. Can you please help ?

  • What or who is DeadOn? It would also be nice if it had some M3 holes, because I use M3 screws in my designs.

  • CodeVisionAVR library for DS3234 http://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_type=project&item_id=3864

  • If I don’t ever intend to use the INT/SQW pins, can I omit the 10k resistor and the 22pF cap? Or does the VCC depend on this part of the circuit?

  • does this work at 3.3v?

  • Is there any reason why pins 3 and 6 are not broken out? They are RESET and 32kHz respectively… seems like you’re just throwing away functionality for no reason whatsoever… What am I missing?

  • I recently purchased one of these and am using it in clock. However I find it is somehow gaining time on the order of 10 or so seconds over the course of a few hours. This is clearly more that the 2ppm listed in the spec sheet. I’m not sure how this is happening since I am not writing to the chip so I assume that the RTC chip is not accurate. Is it possible for the DS3234 to drift this much so quickly?

    • Dunno, but regarding to my earlier post, accuracy seems to be pretty good in long term scale. It may fluctuate more than 2 ppm on a single day, but overall stability seems to be far more better instead of extrapolating the drift based on per one day. RTC is near of my window and I’ll open it pretty regularly. I haven’t studied how much temperature fluctuations will affect to the total accuracy. 10 secs sounds still kinda a large drift. May that be some kind of EMI related issue of your circuitry? High SPI-frequency and continuously polling may generate some extra pulses to the clock source. At least INT-pin was affected by SPI-data when scoping of my case.

  • I have purchased couple of these modules. Nice product especially if SPI is already utilized on your MCU. However extremely accurate seems to be just accurate in my case. Maybe I’m doing something wrong like using 512 conversion sample rate instead of 64. I have Maxim’s DS3231M evaluation board which seems to be very accurate as the chip has been run several months with less than one second deviation. These DS3234 modules will deviate about one sec per day which is ~6 minutes/year.

    I have written library with CVAVR and i’m not quite sure how to interpret the datasheet. One is Conversion sample rate seconds. Is this calibration interval or samples per second? I mean should CRATE0 and 1 bits set to zero? Another issue is temperature values below zero. I’m unable to get correct negative values when getting the chip from freezer. Two’s complement value has been noticed, but is the commercial version of the RTC unable to display temperature values below zero?

  • Is it possible to get one of these preprogrammed to the time being transmitted from Fort Collins, Colorado By WWVB (and even better delivered before it gains or looses a full second….)?

    • Without a battery installed, it won’t keep the time during shipping. (Battery sold separately)

  • any chance of sparkfun doing a breakout for the ds3232. Why do only those who use SPI get to use a more accurate clock?

  • Hi, I was wondering if someone could help me understand how to interpret the SPI.transfer function values in the example sketch. I assume that they relate to Figure 1 in the datasheet but don’t know how to translate the hex values 8E and 60 into the values in the table. Also, it seems to me that the day and month variables in the setTimeDate function are in the wrong order (i.e., the first variable is the month and second is the day). Thanks for any help.

  • Has anyone managed to use this to add a hardware clock to a Raspberry Pi?

    I have managed to get the SPI working, I have found I can sudo modprobe rtc-ds3234 but I am not clear on how to tell the kernel that the SS pin is connected to CE0 on the GPIO so that the rtc-ds3234 can access it.

    Help!

  • This code is extra confusing for no apparent reason, took me awhile to mash it out. Ah BCD, I’m an idiot.

  • Hello, I don’t have this thing yet, I am wondering if it’s worth buying it instead of the DS1307. Because in the code I see the temperature compensation is disabled (probably for a good reason), that mean it won’t be more accurate than the DS1307, correct?

  • … just now able to set the time and date on this thing using an Arduino Uno and V1.01 of the IDE. The example sketch provided by Sparkfun on the product page was helpful, but don’t believe everything you read. The sketch has a comment indicating that it will work in either SPI mode 1 or mode 3. This same idea appears in the datasheet for the device. I was only able to set the time/date by changing the example code’s setDataMode command to “SPI.setDataMode(SPI_MODE3);”. Using SPI_MODE1 resulted in seemingly nonsense numbers going to the serial monitor.

    • MFindley,

      Are you saying you finally got the date/time to set? That’s the one thing I’m struggling with now. Using both the library above and the example sketch (modified to SPI_MODE3) I can read date/time no problem, but can’t seem to set it no matter what. Mind sending me you sketch?

      • And after hours of playing around, it appears as though the my RTC in combination with the 1.01 compiler won’t take a time unless Vcc is given 5V and the SPI is set to MODE3. The 3.3V pin only allows me to read off of the RTC.

  • Hi. I am using a pic 18F14K50 with this RTC module. I am connecting the RTC with no battery directly to the PIC via SPI. I would like to know if I have to set anything else. My reception routine is : char getByte(char data){ char var; SPI_CS = 0;
    putcSPI(data); //Send command var = getcSPI(); //receive data SPI_CS = 1;
    return var; }

  • im considering making a watch with this and i need to know how thick is this with and without the battery holder? preferably in metric

  • Has anyone tried to interface this RTC with an MSP430? I am having a really hard time doing so… Using the Arduino code as a flowchart i was able to produce a c code for the msp, but I get bogus readings from the RTC. Any help would be be appreciated.

  • Works fine for a while, then gets bad date somehow: 12/04/22-01:31:04 12/04/22-01:31:34 65/12/31-23:60:46 65/12/31-23:40:16 65/12/31-23:40:46

    (first number is year ie 2012,2012,2065)

    Any idea why this might happen? I am not setting the date, only reading it. But when I see that it has gone bad, I do set the date, and it is fine for a while again. Using arduino mega256, RTC_DS3234.h

  • i’m a bit partial to sparkfun, so before i buy, what are the differences between the chronodot 2.1 breakout and this ds3234 breakout?

    i see the pins are a bit different, headers soldered on, a batt is provided, sram, i2c vs spi.

    i guess its a matter of i2c vs spi and form factor & the price diff?

  • Is there a way for me to change the clock from 24-hours to 12 hours?

  • Can anybody explain what is the PIN SQW? Ive never seen it? Thanks

    • Take a look at the datasheet (link above). This output pin can be configured to provide an interrupt signal (alarm, etc.), or a square wave (hence SQW) at various frequencies.

  • Working fine on mega2560: RTClib.cpp needed <arduino.h> replaced with <Arduino.h>

    50 (MISO), 51 (MOSI), 52 (CLK), 53 (SS), GND & SQK grounded, VCC to +5

    include <Wire.h>

    include <SPI.h>

    include <RTClib.h>

    include <RTC_DS3234.h>

    RTC_DS3234 RTC(53);

    void setup(){

    SPI.begin();

    RTC.begin();

    RTC.adjust(DateTime(DATE, TIME));

    SPI.setDataMode(SPI_MODE0);

    Serial.begin(9600);

    }

    void loop(){ const int len = 32; static char buf[len]; DateTime now = RTC.now(); Serial.println(now.toString(buf,len)); delay(1000); }

  • Hey All –

    I got my DS3234 working, in that I can set the time and read the time, however, the battery back up does not appear to be working. I’ve got it hooked up to an arduino uno and when I remove the unos power and let the chip sit for, say, 24 hours the time is no longer correct.

    I’ve got a CR1225 battery that reads 2.9 V

    Here is how I’ve got it wired:

    *gnd -> gnd

    *vcc -> 3v

    *sqw -> gnd

    *clk -> pin13

    *miso -> pin12

    *mosi -> pin11

    *ss -> A0

    Any thoughts?

    • EOSC bit was set to 1, please read page 10 and 12 of DS3234 datasheet.

      You can alter EOSC bit by sending command to address 8Eh something like this:

      digitalWrite(cs, LOW); SPI.transfer(8Eh); SPI.transfer(00011100b);
      digitalWrite(cs, HIGH);

  • I had been using a DS1307, but the timekeeping was not as good as I had hoped. The DS1307 can easily drift by a minute a week. The DS3234 has, so far, stayed within 1 second per week. If you are data logging, I highly recommend the DS3234 over the DS1307. Check out openlog as well if you are into data collection. Openlog makes saving data very simple. The DS3234 makes the time that data is saved very accurate.

  • PacMan reference in image 4!

  • Must use 3.3v VCC, instead of 5.0v VCC used in the above Example Sketch, otherwise square wave output doesn’t work.
    Must use SPI_MODE3, instead of Mode 1, otherwise one line correct time, followed by one line 00/00….

  • Hello All
    I finally got this guy working. Ref http://www.l8ter.com/?p=375
    for wiring and use the Example sketch.
    Very weird. First the problem seemed to be the jumper wires I was using between my Uno and the breadboard were picking up “noise” - one wire in particular seemd to be most sensitive - the LOW tie down on the SQW pin - when I used a shorter wire it appeared to work ok but after 20 secs or so the output would appear to get corrupted and fix it self agian after another 20secs - I set SPI.setDataMode(SPI_MODE3) and it seemd to stabilze the o/p
    Good Luck

  • Is there any way to make this work with a different coin cell battery? Because I don’t have a CR1225…
    I have 3x G8-A's
    I have 9x 357's
    I have 5x CR2032’s

  • Someone can tell me what is going wrong.
    I have used the DS1307 Engine for the propeller and now my dates don’t work correctly. It uses impossible dates like september 31 and then jumps to october 2 the next day. ?
    Any help is very appreciated !

  • does the library work with the alarm?

  • There is something wrong with the newest version of the arduino ide (0022) and this example code. It calls the ReadTimeDate() one time and outputs it to the serial monitor as expected and it never calls it again. I don’t have enough expertise to understand what is going wrong. I suggest someone with more know-how try compiling the example code in 0022 and note the results. I downgraded to 0021 in order to get this working. I don’t know if the problem is a bug in the 0022 IDE or the code provided here. I would be curious to know if anyone gets it working in 0022, I haven’t ruled out that the problem is exclusive to me/my system.

    • I had the same problem and did what you said, used 0021 and it works fine now.
      Although, the original sketch worked for me. I had problems when changing the numbers sent with the SetTimeDate function. Sometimes it would output the ReadTimeDate correctly until it got to a certain time and would lock up.

      • For what it’s worth, I had the same issue in Arduino 1.0.1. In the ReadTimeDate() function, the String ‘temp’ is not initialized; changing the first temp.concat() call to an assignment resolved this issue for me - e.g. ‘temp=String(TimeDate[4])’; instead of ‘temp.concat(TimeDate[4])’;

  • Any idea how to (easily) calculate duration using this RTC? I can’t track down a function that would let me subtract a start date and time from the retrieved date and time. I want something similar to:
    duration = millis() - startTime;
    Thanks!

    • I think maniacbug’s port of JeeLabs RTClib (grabbed link from comment above) would help with with date calculations.

    • With a little bit of string manipulation, you could change the date and time into seconds.

      • Seems like that would be A LOT of string manipulation. There is no way of “easily” determining the the day number of the current year to be able to “easily” get to a unit of seconds. I would have to figure out what month it is, and then count, in a very specific way, to determine which day (0-364) it is. No? Am I missing something?

  • Perhaps a bit of help to a real new user. I bought the DS3234 and do have it running. I set the clock by entering it into the code supplied on this page. This only gets to clock close not exact. How can this clock be set to the current internet time? As a newcomer to C language coding, how can I reference the clock time in other programs? I need to trigger a camera during a specific time, as I photograph the space shuttle launches and need to listen for the sound of the launch during the time it may take place. I am using PLC’s to do this in the past but want to try an Arduino triggger for the next launch (Images at MarkWidick.com) Thanks in advance.

    • http://arduino.cc/playground/Main/InterfacingWithSoftware Start there. I believe something like Firmata or GoBetwino would help you out. You may be able to just script something up using serial transmissions only. Needing the type of accuracy one would desire for such a one time only event I would think that GPS or radio would be better for you. Get your GPS time, if it matches the desired set time, take the pic.

  • One more post: I spent a couple of hours getting the interrupt to work this morning. Two pieces of info that may be of use– (1) The output of the square wave pin on the ds3234 cannot be tied directly to the input of an Arduino. A 4.7K resistor seemed to work fine. (2)You may need to build a delay into your code between detecting a square wave and reading the registers to let the update complete.

  • Cancel that question. Half asleep this morning. I figured it out.

  • Some help, please. I intend to use the square wave output to trigger an interrupt on a uC. The datasheet says that this line needs a pullup resistor. The schematic for the board shows a 10K resistor and 22pf cap to ground from this pin. I presume that the 10k, since it is on the “high” side of the cap, is not an issue in terms of my pullup resistor.
    So… a couple of questions from this newbie. The reference diagram on the datasheet does not indicate a need for this circuitry. Why is it there? Second, any suggestions for a pullup? I was thinking in the 4.7K range.
    Thanks all.
    Ed

  • It would be great if there was a revision of this which broke out the 32kHz pin - since that can feed the async timer of an AVR for sub-second RTC on the AVR.
    (I hadn’t realised at all the CLK pin is the SPI clock. Yeah, kinda obvious now I look at it.)

  • Is there any chance the next batch of these could be produced using the DS3234SN part instead of the DS3234S? This product would be much better if it could operate in the industrial (-40°C to +85°C) temperature range.

    • The macetech ChronoDot2.0 is made with the DS3231SN, which has the operational range of -40 to 85 deg C. See above post.
      http://macetech.com/store/index.php?mainpage=productinfo&products_id=8

      • Actually, I have been debating between the ChronoDot2.0 with it’s i2c interface, extended temp range and the lower cost, and the Sparkfun DS3234S based module with the sram and SPI interface. Either module would be excellent, but it would be nice if Sparkfun would produce two versions of 3.3volt RTC modules, one based on the DS3231SN for the i2c fans and a second version based on the DS3234SN for the SPI fans. ChronoDot, well, I guess I am a square person.. and I like the form factor Sparkfun is using. Also, my case, I am looking for a device with a bit of memory onboard since I will soon be working with a leaflabs maple board (STM32 based) which does not have eeprom onboard. While the STM32 can emulate eeprom, I would rather use sram external if I have a choice, thus my interest in the Sparkfun module. The DS3234S has a good all around set of features in one package. Also, I’m dealing with some very cold temps, thus the extended temp range request.

        • The ChronoDot - Ultra-precise Real Time Clock - v2.1 uses the DS3231

        • In that case solder it up yourself:
          http://www.sparkfun.com/products/496
          +
          http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=DS3234SN%23-ND
          You can trim the breakout board down to twenty pins and your set!

  • Sweet breakout board. If you don’t need the “256 bytes of battery-backed SRAM”, checkout the ChronoDot2.0 using a sister chip DS3231: http://macetech.com/store/index.php?main_page=product_info&products_id=8.
    Its bulbdial clock compatible: http://www.sparkfun.com/products/10021
    And a bargain at $15, battery included!

    • Somehow, the ChronoDot has been out of stock every time I’ve checked. I’d have bought several and recommended more by now if this wasn’t the case.

  • Does it compensate for DST?

    • From the absence of any DST information in the datasheet, it appears it does not. I would have suspected this as well considering governments are forever changing the rules on DST.

  • This is ALMOST perfect for a project a friend is working on, but it doesn’t have the ability to output in granularity of 1/100s or 1/1000 of a second.. Does anyone know of an accurate time chip which would be able to output 1/1000s of a second? It doesn’t even have to be absolute time - Just knowing a duration is fine, but I need to be able to read the clock twice, and know accurately how many 1/1000s of a second have elapsed.
    Thanks!!

    • The datasheet speaks of a 32kHz (32768 Hz) output pin 3 and a square wave output on pin 5 with selectable frequency. Depending on register settings this can output 1024 Hz. You’d still need something to count those pulses though.

  • Super lol. I just ordered the other RTC two days ago. FML.

  • i think they meant to place Sram instead of crystal.
    the headline of the datasheet says “Extremely accurate SPI bus RTC with integrated crystal and Sram”

  • the decription confuses me abit. it has an temperature-compensated crystal oscillator AND crystal? is this a mistake in the description?
    also because this rtc does not come with a battery everybody will have to set the rtc to the right time/date themselves. right?

    • Yes, you will need to set the clock. I’ll check into the other thing, they claim that in the manual for the IC, and yes, it’s confusing.

  • Cool product! This would go great with the LF radio clock receiver IC. Never set the time in your device again!
    http://www.sparkfun.com/products/10060


Related Products