All about the DS3231

Поделиться
HTML-код
  • Опубликовано: 27 мар 2017
  • All about the DS3231 Real Time Clock
    The ds3231 real time clock module has a lot of features that are very simple to implement for your Arduino projects. You can set the clock easily by setting individual elements i.e. seconds minutes hours day month year etc., and it even has alarms that can be set and will provide an interrupt when they are triggered.
    The ds3231 is 5 volt tolerant and operates on the i2c bus. It has an internal oscillator which can be set to three different modes in addition to a standard 32k oscillator. Both oscillators output a square wave which can be read from the external breakout pins.
    The library that we are using in this example can be downloaded within your Arduino IDE by going to sketch, manage libraries and then typing in DS3231. Look for the library created by Eric Ayers.
    DS3131 RTC Module: www.amazon.com/gp/product/B01...
    All of my sketches are available here: www.dropbox.com/sh/m6c40pu99f...
    ~-~~-~~~-~~-~
    Please watch: "Diodes: The basic building block of all digital circuits"
    • Diodes: The basic buil...
    ~-~~-~~~-~~-~
  • РазвлеченияРазвлечения

Комментарии • 33

  • @hdguppies
    @hdguppies Год назад

    I'm late to the Arduino party and I appreciate your videos very much. You're a good teacher. Thanks!

  • @KJ7JHN
    @KJ7JHN 4 года назад

    Nice tutorial. Thank you. Stay creative.

  • @michaelpadovani9566
    @michaelpadovani9566 7 лет назад +2

    One of my favorite Arduino components. I use the Sodaq library but overall very similar. Set it and forget it (at least for a while). Having that battery helps and I keep everything on Standard Time (so no need to reset to DST). You can also modify code to always output YYYY/MM/DD, HH:MM:SS ---- makes it look neater and keeps consistent spacing.

    • @learnelectronics
      @learnelectronics  7 лет назад +1

      Michael Padovani it sure is a great module. couple lines of code and you have a clock in any project.

  • @doormattde
    @doormattde 6 лет назад +1

    Very helpful, I should stop watching yt in bed tho, gonna try this maybe tomorrow

  • @RalphWLundvall
    @RalphWLundvall 3 года назад

    Follow-up with a deep sleep project that awakens every hour by alarm2. That would be golden. I keep searching and what I find keeps falling short.

  • @MaxDiscere
    @MaxDiscere 5 лет назад +5

    you forgot the alram

  • @pairabd3852
    @pairabd3852 3 года назад +2

    Sir Would you please tell me that when i should use enableoscillator() function or when not?

  • @Norfeldt
    @Norfeldt 5 лет назад +1

    Learning electronic by watching your awesome videos. Seeing this makes me want to ask some questions.
    1. Can it be set to auto adjust to summer and winter time (the ridiculous +- 1 hour)?
    2. Can it be programmed to be a timed trigger? In order to make the Arduino consume less power by sleeping it or power on/off
    3. Could you please mention a use case for the oscillation?

  • @MrBobWareham
    @MrBobWareham 4 года назад +2

    How about charging the battery?

  • @Graham1904
    @Graham1904 4 года назад +3

    Bull that the DS3231uses the EEPROM to store RTC data!!!!! It is totally independent

  • @OldCurmudgeon3DP
    @OldCurmudgeon3DP 6 лет назад

    Is one required to set the DoW or will the chip figure it out? I have no use for that one bit of info in my sketches and the uRTClib.h I'm using now has the set command wrapped up like your get command with all parameters required.

    • @learnelectronics
      @learnelectronics  6 лет назад

      I'm pretty sure you can leave it out.

    • @OldCurmudgeon3DP
      @OldCurmudgeon3DP 6 лет назад

      learnelectronics I've found that leaving out the DoW when setting the RTC using the DS3231 library causes the chip to override my year variable with a value that is valid for the month & day setting I send it. Or I need to change the order I send the value to make it set the DoW internally. Trying to decide if I persue that or cut my losses & add DoW to my GUI.

    • @matthewfredregill2516
      @matthewfredregill2516 6 лет назад

      learnelectronics Where is the sketch in your dropbox. What is it called?

  • @shashinair4185
    @shashinair4185 Год назад

    Can u tell me the difference between ds3231m 12c and DS3231 .both can work with the same code

  • @matthewfredregill2516
    @matthewfredregill2516 6 лет назад

    Where is the sketch for this located in your dropbox? What is the file called

    • @biggieb400
      @biggieb400 6 лет назад +1

      I just looked and I can't find it either...

  • @3maisons
    @3maisons 3 года назад

    This board has a pull-up resistor connecting SQW to VCC, which is a BAD THING. That connection assumes that you will never want to use SQW when the I2C is not powered (that is VCC is open). The DS3231 chip with its backup battery is capable of signalling an alarm condition via SQW, but the "pull-up" resistor connects SQW to VCC which is connected to the power on LED (via a 1K resistor) and thence to ground. When VCC is not separately powered, whatever source is connected externally to SQW has its power drained away. That connection can be de-soldered with difficulty from the top right connector on the topmost component labelled 472 (actually a resistor array) (below the POWER label and to the right of the leftmost SDA and VCC labels). When SQW is not low, removing this trace raises the resistance between SQW and GND from 13K to 180K by my measurement. (When SQW is low because an alarm is triggered, SQW to GND is about 32 ohms).
    I agree with other commenters: the 24C32N is not where the clock registers are stored, but rather on the DS3231 chip itself.
    Also remove the resistor above the right hand SCL label for lithium battery health.

  • @joemeissler4876
    @joemeissler4876 7 лет назад +3

    You have to be careful with the ZS-042. It tries charging the battery. See the discussion here: forum.arduino.cc/index.php?topic=278270.0

  • @nikosadie
    @nikosadie 6 лет назад

    Does anyone know how to disable the battery charging on it. The LIR2032 battery it uses is not available in my country and I am concerned what would happen if I used a regular CR2032 battery. So I need to disable the charging.

    • @scottmc2626
      @scottmc2626 5 лет назад +1

      On the 4-pin header side of the board, remove the resistor located immediately above the silkscreened SCL marking. Or the diode to the left of it, or cut the trace to one of them. The Elegoo variety comes with it unpopulated and the CR2032 battery, but unless you want to get one of their kits, you have to order it from their website directly.

    • @scottmc2626
      @scottmc2626 5 лет назад

      @@xiaomong8 Damaging the battery is the least of your worries when charging a non-rechargeable Lithium-ion battery. Yes, you may not notice any issues, but the thing about Lithium batteries is they are little bombs. They contain metallic Luthium, which spontaneously combusts when exposed to air. Also the natural internal resistance is very low, so an internal short can develop temperatures high enough to start a fire. Recall all the stories about exploding cell phones, and notice how newer cell phones do not have user replaceable batteries. That's because people were buying cheap no-name replacement batteries and then blaming the phone manufacturers when suddenly their pockets we're on fire.
      So when the other commenter said it's "safest" to disable the charging circuit, he's referring to fire safety, not just equipment failure.

    • @xiaomong8
      @xiaomong8 Год назад

      Desolder the diode and the resistor on the 4 pin side of the module.

  • @squalazzo
    @squalazzo 7 лет назад

    that module has an I2C 32K eeprom, too...

    • @learnelectronics
      @learnelectronics  7 лет назад +1

      squalazzo yes it does. that's where it does the time and date

    • @scottmc2626
      @scottmc2626 5 лет назад

      @@learnelectronics Yes, but 32k is a whole lotta memory to store just the time and date. Wonder if it could be used for other stuff.

    • @carelx7029
      @carelx7029 5 лет назад +2

      Not true, it''s a separate EEPROM. The jumpers A0-2 are for adressing this chip, the clock is not adressable.

  • @jeanpierredaviau7478
    @jeanpierredaviau7478 4 года назад

    All about the DS1307RTC

  • @senger1985
    @senger1985 4 года назад +1

    Hello,
    may could you tell me what following error means:
    'DS3231 clock' redeclared as different kind of symbol
    I juse this lib:
    github.com/jarzebski/Arduino-DS3231

    • @wchen2340
      @wchen2340 Год назад

      namespace issue. fix : find/replace all "clock" with "cl_ck" or something different.

  • @SurajGrewal
    @SurajGrewal 5 лет назад

    Unfortunately, all of mine, drifts a lot. I know, they are fake, cause, all of them were marked using laser.

  • @barneycarparts
    @barneycarparts Год назад

    what var type does rtc.getime return? I only want the hour to trigger a relay.. How do I o that. Thanks