Arduino and DS3231 Real Time Clock Tutorial

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 174

  • @jpb10
    @jpb10 Před 3 lety +20

    PSA for anyone using this RTC (DS3231), there is a badly designed charging circuit on this particular module (ZS-042 and probably others). You must either use a rechargeable LIR2032 battery or disable the charging circuit. You can do so by cutting the trace or removing the diode or resistor. Otherwise, using a non-rechargeable CR2032 could cause it to swell and explode. Although, even with a rechargeable LIR2032, the charging voltage is too high at ~4.7 V relative to the spec of 4.2 V, which may also cause issues. The recommenced option is to remove the diode with a pair tweezers or by desoldering, and use a regular CR2032 battery. There is a thread about this issue on the Arduino forums.

  • @EricTViking
    @EricTViking Před 3 lety +8

    This is an excellent video, all the info you need to get started in under 4 minutes - thank you 👍 I get fed up with CZcamsrs that pad a 5 minute video to 35 minutes - droning on with "blah, blah, blah" and naff video animations (naming no names).

    • @First.Last.99
      @First.Last.99 Před 2 lety

      most creators try to hit 10min mark to "get the algorithm going", god bless those who earn money any other way lol, they give info like this, few minutes.

  • @christiankongsted5084
    @christiankongsted5084 Před 5 lety +40

    To anyone that was in my shoes where the serial moniter only prints nonsense, I oversaw the baud rate. If it's making a ton of ????, match your serial moniters baud rate to 115200 (as seen in the video).

  • @drakethomas652
    @drakethomas652 Před 5 lety +9

    I'm having an issue with the programming part. I downloaded both libraries and it still doesn't work but I suspect, based of what I'm reading, that the library is isn't completely identifying certain variables/parts, such as:
    DS3231 rtc(SDA, SCL);
    Serial.print(rtc.getDOWStr());
    Serial.print(rtc.getDateStr());
    Serial.println(rtc.getTimeStr());

    • @garytejeda-godinez4676
      @garytejeda-godinez4676 Před 4 lety +1

      I'm having the same issue

    • @mohamedabdelfattah8627
      @mohamedabdelfattah8627 Před 4 lety +3

      It works with me when I changed the serial as follow:
      // Serial.begin(115200);
      Serial.begin(9600);

    • @shansh23
      @shansh23 Před 2 lety

      @@mohamedabdelfattah8627 Thanks a lot. I was struggling for two hours. Cheers!

    • @edwardowen3212
      @edwardowen3212 Před 2 lety

      @@mohamedabdelfattah8627 I can't thank you enough for this! After an hour struggling I was about to throw it at the wall!

  • @RandomPerson494-12c
    @RandomPerson494-12c Před 3 lety +5

    0:06 captions
    *"Hello then dogs here from how to catch Onix"*

    • @cessposter
      @cessposter Před 3 lety

      Been playing Pokemon recently will need help

  • @user-tr6co8mw4j
    @user-tr6co8mw4j Před 4 lety +2

    Thanks for your great simple explanation in this video .How to use a library to set time automatically with DS3231 RTC?

  • @youpattube1
    @youpattube1 Před 7 lety +1

    Very good instructional video. There are so many bad ones out there that I was getting discouraged. Thanks.

  • @homo_sapiens_sapiens
    @homo_sapiens_sapiens Před 4 lety +2

    Do *NOT* USE CR2032. Most modules are intended to be used with rechargeable LR2032 batteries. When DS3231 is connected to the Arduino, CR2032 is being charged (even though it's not rechargeable). It also won't last too long.

  • @batmantherooster
    @batmantherooster Před 4 lety +2

    Thanks for the Excellent easy to understand video. I am great at building the circuit but horrible at programming. It’s like I’m terrified of programming

  • @user-ii4yl9oq5d
    @user-ii4yl9oq5d Před 3 lety

    Thanks from China Inner Mongolia

  • @redelectron8575
    @redelectron8575 Před 2 lety

    Ds3231 in incredible for time keeping projects😍

  • @adamcowlam5527
    @adamcowlam5527 Před 8 lety +7

    Way too underated

  • @luthodyiki5902
    @luthodyiki5902 Před 9 měsíci

    Thank you very much. I’ve got a problem this device after a day the time becomes of by around 6 seconds from the real time how can I fix that.
    Thank you

  • @plazmax
    @plazmax Před 7 lety

    you can add temp and alarm to this prject better, ds3231 has temp function but not too good like dht22 but its ok for little project

  • @fortnite......
    @fortnite...... Před 8 měsíci

    Where is the circuit diagram for the LCD display?

  • @rakin6488
    @rakin6488 Před 3 lety +2

    Sir can you please add a pushbutton so when we will push it we can see the day and temperature and then we push it second time we can see the time and date again.
    Sir please reply

  • @maxvandervoort3790
    @maxvandervoort3790 Před 6 lety +3

    How can I read out, for example the time, as an integer, so that I can make a alarm clock with it?

    • @HowToMechatronics
      @HowToMechatronics  Před 6 lety +1

      You can read the String and then covert it to integer using the string.toInt() function.

    • @maxvandervoort3790
      @maxvandervoort3790 Před 6 lety +1

      First of all, thanks for the reaction. But I tried it in multiple ways, but the fact that it uses rtc.getTimeStr(); seems the confuse the system. Is this a matter of notation?
      I have: int i = String.toInt(rtc.getTimeStr());

  • @angalamat2328
    @angalamat2328 Před 7 lety +1

    how can i used rtc to trigger a particular time to send a text message ?

  • @zyghom
    @zyghom Před 3 lety +1

    people forget to say: when 5V is in use and non rechargeable battery, you MUST break the charging path - otherwise your 3V battery may explode ;-) if you connect to 3.3V it will not happen as there is a diode in the circuit. same no issue if you use 5V and rechargeable battery ;-)
    one more thing as bonus: this module has extra EEPROM that can be used ;-)

    • @Dvance
      @Dvance Před 2 lety

      What if I have a non-rechargeable battery using 3.3V? Should it be fine, or should I go out and get a rechargeable one?

  • @arahmankabir8405
    @arahmankabir8405 Před 4 lety

    Thank you for your important video on how to add AM PM code to your real time clock.

  • @shivanighadge
    @shivanighadge Před 2 lety

    Thankyou sir... The video is very helpful but I want to know in which software the schematic is made ... Can you mention the name of software please

  • @razaali17
    @razaali17 Před 3 lety +1

    How can I use this setup to connect to a motor and make analog clock in place of a digital one.???? Anyone have any idea ???

  • @Isotope1213
    @Isotope1213 Před 7 lety +2

    can you provide the wiring scheme for the added LCD example? thanks

  • @ifell3
    @ifell3 Před 7 lety +3

    Great video, i got a 'warning deprecated conversion from string constant to 'char*' -wwrite-strings' but can you clarify this is nothing to worry about? Regards

  • @priyaop5040
    @priyaop5040 Před 2 lety

    everything works fine, but when I disconnect the arduino from the PC, wait a few minutes, connect it again, Time starts from the moment where I cut off the power.
    Where is the fault hardware or software?

  • @mohamedabdelfattah8627

    Thanks a lot for this helpful video.
    There is a note:
    It works with me when I changed the serial as follow:
    // Serial.begin(115200);
    Serial.begin(9600);

  • @derekschwontz9072
    @derekschwontz9072 Před 6 lety +2

    Hello Dejan, where may I find the connections between LCD and Arduino board ?

  • @mitropoulosilias
    @mitropoulosilias Před 7 lety

    there is no info on how to connect the LCD. i connect it based on lcd example but dont work with this sketch..

  • @amirsohailansari7465
    @amirsohailansari7465 Před 7 lety

    thank u Dejan
    you always give very useful tutorials..

  • @srinivasperuri2189
    @srinivasperuri2189 Před 3 lety

    sir im getting lot of erros stating same thing i used but im not getting output

  • @rufaiahmed7664
    @rufaiahmed7664 Před 2 lety

    How do I get the RTC to show short date and time 12hr format

  • @profesorjan7614
    @profesorjan7614 Před 7 lety +1

    you gained a new subscriber

  • @lefebvrevanderwalt2435

    I have bought a couple of the DS3231 modules. Trying to build a temp logger. All of them get the temperature wrong by 18 deg C even when using different libraries. And it seems they lose a lot of time as well. I guess the time loss and temp is correlated. Any idea why this might be?

  • @jakobkatrasnik8684
    @jakobkatrasnik8684 Před 4 lety +1

    Does RTC modules change time when the winter of summer time comes?

  • @JakezChannel
    @JakezChannel Před 3 lety

    Sync to time server?

  • @freemanfreed1581
    @freemanfreed1581 Před 4 lety

    What if you need to display this to be seen from 10 meters ??

  • @electronicspassionchannel6622

    Hi!
    I need help about a project to simulate sunrise - sunset with real time clock ⏰.
    E.g. i want to start at 07:00 and stop at 19:00 dimming by time (every 15min) for six hours to peak and onother six hours decrease light to sunset.
    *arduino uno
    *DS1302 Clock Module with Battery
    *AC Light Dimmer Module for PWM control, 1 Channel, 3.3V/5V logic, AC 50/60hz, 220V/110V
    *dimmable led lamp

  • @ThilaganKmed
    @ThilaganKmed Před 3 lety

    I am getting error like error: no matching function for call to 'DS3231::DS3231(const uint8_t&, const uint8_t&)'
    DS3231 rtc(SDA, SCL); Please help me to fix it

  • @raizen0818
    @raizen0818 Před 6 lety

    hi. I want to set a 10 minute down clock. Any idea how I can do it?

  • @strangejmaster
    @strangejmaster Před 4 lety

    Can you make a stopwatch with this?

  • @messiah7948
    @messiah7948 Před 6 lety

    HI how can i add more than 2 alarm tones in this project??

  • @DheeruMoolya
    @DheeruMoolya Před 6 lety

    Nice project easy and simple to understand

  • @MrBobWareham
    @MrBobWareham Před 5 lety

    Why don't you show the day of the week on the display?

  • @babyyoda756
    @babyyoda756 Před 4 lety

    how did you connect the LCD?

  • @phongnguyen-zu1gl
    @phongnguyen-zu1gl Před měsícem

    fantastic video

  • @kobedde
    @kobedde Před 7 lety +1

    tanks mate. Good tutorial.

  • @TOTA1200
    @TOTA1200 Před 7 lety +2

    How can I set the source file for the library. In my project I want to get the time and days and manipulate it to count down to a certain date.

  • @cjb1289
    @cjb1289 Před 7 lety +2

    Is it possible to do without the MEGA

  • @gseric4721
    @gseric4721 Před 4 lety +2

    How exactly would you call the hour/min/seconds separately? I tried the 'now' approach, but for some reason this library doesn't seem to support this.

    • @CoHxBlackWebster
      @CoHxBlackWebster Před 4 lety

      there is a examples called serial hard that shows you how to get hour, min, and seconds separately

  • @sayantanmaiti2513
    @sayantanmaiti2513 Před 7 lety

    If I do not want to use the module(for time being), so can I remove that battery ?? and if I do not remove it,how long the ic /device will last??

  • @taranagnew436
    @taranagnew436 Před 6 lety

    do i need the unisex time and the wait function or no?

  • @RazibShahadat
    @RazibShahadat Před 7 lety +3

    why my RTC module time change ?

  • @arielgeneranta4786
    @arielgeneranta4786 Před 5 lety

    Can we attach 2 external hardware that uses i2C. Example: LCD with i2C and this realtime clock

    • @arielgeneranta4786
      @arielgeneranta4786 Před 5 lety

      ?

    • @EmGi_
      @EmGi_ Před 5 lety

      @@arielgeneranta4786 Yes. you just need the lcd and the rtc as slaves with diffrent l2c adresses

  • @mundex125bieszczady
    @mundex125bieszczady Před 5 lety

    Hello. Why my real time within 24 hours is delaying by 15 minutes?

  • @ateebhassan4655
    @ateebhassan4655 Před 3 lety

    can someone tell me where to find the DS3231 library for proteus? Bcz In proteus only DS3232 is available. So, can we use same code for DS3232?

  • @mohamedafzar1737
    @mohamedafzar1737 Před 2 lety

    Can we use Arduino nano...?

  • @kevinr5058
    @kevinr5058 Před 4 lety

    Hi sir, motor on only 10 sec in Every hour...I need Arduino uno program code....

  • @divacreator259
    @divacreator259 Před 4 lety

    Can't use i2c?

  • @my_google_arifkhan9358

    how can you set time manualy

  • @techwithvanndy5011
    @techwithvanndy5011 Před 4 lety

    Can we do this with Arduino Uno?

  • @kedareswarkaavuri5774
    @kedareswarkaavuri5774 Před 8 lety +5

    Subscribed

  • @Ladysman183
    @Ladysman183 Před 7 lety

    Cao Dejan, ne pravis ni jedan tutorial arduità na Srpskom?

  • @abdellahchioua6404
    @abdellahchioua6404 Před 3 lety

    How can we use the module for timestamping data

    • @HowToMechatronics
      @HowToMechatronics  Před 3 lety

      Yes, you can. I just used it in my latest project, the DIY Air Quality Monitor, for sensors data for the last 24 hours.

  • @atefbenattia913
    @atefbenattia913 Před 5 lety

    hello sir,
    how can I command something with time? for example if I want to command something every day at a certain hour?
    can you help me please!

    • @tojotaco3822
      @tojotaco3822 Před 4 lety

      @Mad Max yo chill out and Atef Ben Attia, you can probably use an if statement like this. You would need to save the hour part to a variable as well. This variable as well as the code would need to be in a loop so it constantly refreshes.
      if ((hour == 2) && (minute == 0)) {
      *insert what you want it to do here*
      }

  • @jaspalsingh-im2pl
    @jaspalsingh-im2pl Před 4 lety

    You need to initialize the I2C bus using pull up resistors.. 2.2k for fast and upto 10k for slow communication bus.. This tutorial is not complete.

  • @DheeruMoolya
    @DheeruMoolya Před 6 lety +1

    How can i convert time from 24 hour format to 12 hour format?
    Can anyone help me please?

    • @DheeruMoolya
      @DheeruMoolya Před 5 lety

      @therealnightwriter Absolutely. U r right.
      I'm trying to find that joy...

    • @saadmgdm706
      @saadmgdm706 Před 5 lety

      IDK why some people act like retards

  • @MilanKarakas
    @MilanKarakas Před 8 lety +6

    Thanks for posting this video. Subbed!

  • @anorihara
    @anorihara Před 4 lety

    can some one help me with count down timer with RTC module?

  • @ruitfsilva
    @ruitfsilva Před 8 lety

    Great video, thanks a lot :)

  • @anokhautomation4453
    @anokhautomation4453 Před 2 lety

    👌👌interesting

  • @gamertuhin9118
    @gamertuhin9118 Před 7 lety

    i have a very simple question to ask related to displaying things in lcd 1602
    please answer

    • @gamertuhin9118
      @gamertuhin9118 Před 7 lety

      i have multiple sensor and from multiple sensor i can get mulitple types of data .
      For instance i can get time, date, month, day of week, temperature, humidity, dstance between objects, etc.

    • @gamertuhin9118
      @gamertuhin9118 Před 7 lety

      I have only 1 lcd1602.
      HOW I CAN DISPLAY EACH DATA LIKE THIS WAY.
      DATE = XX XXXXXX XXXX (DATE MONTH YEAR)
      TIME = XX:XX:XX AM/PM
      DAY = XXXXXXXXXXX
      TEMP = XX.XXX °C/°F
      HUMI = XX.XXX %
      DIST = XXX cm XXX in

    • @gamertuhin9118
      @gamertuhin9118 Před 7 lety

      i want that when only 1 switch is pressed two new lines shown

  • @javasyndicate713
    @javasyndicate713 Před 6 lety

    I get it on Serial Monitor, but it dosn't appear on my 16x2 lcd, help me pls, thx in advance

    • @javasyndicate713
      @javasyndicate713 Před 6 lety

      is there 3 times to upload the code ?
      2 times from example & 1 time code from your web

    • @andresramirezsegura9604
      @andresramirezsegura9604 Před 5 lety

      Hey i want to know how you connected the LCD with the arduino and the ds3231?

  • @amardarwatkar8338
    @amardarwatkar8338 Před 4 lety

    Can Arduino be used to produce business goods? What is your opinion on this?

  • @virajsumanthraperera1586

    Thanks a lot!

  • @adam.walker
    @adam.walker Před 7 lety

    You're awesome.

  • @andrewclarke406
    @andrewclarke406 Před 5 lety

    hooked up lcd and got this message rtc was not declared n this scope. (print get timestr)...any ideas? I used your tutorial on wiring lcd.
    started new sketch, included the two libraries and your code....

  • @LuizCamposTutoriais
    @LuizCamposTutoriais Před 8 lety

    Very good!

  • @josecruz1994
    @josecruz1994 Před 7 lety

    Thank u so much

  • @shashankbagda6970
    @shashankbagda6970 Před 3 lety

    Can u share me pin config. For arduino nano

  • @andrijaadamovic87
    @andrijaadamovic87 Před 8 lety +1

    Very nice, will you ever post a tutorial for raspberry pi?

  • @adamcowlam5527
    @adamcowlam5527 Před 8 lety +1

    Awesome

    • @adamcowlam5527
      @adamcowlam5527 Před 8 lety

      No problem, I have the DS1302, but I might buy the DS3231.

  • @samymsalak401
    @samymsalak401 Před 7 lety

    bonjour je vous remercier j'ai bousoin de programe d'un LCD16-2 avec RTC et Arduino

  • @johnwekesa7501
    @johnwekesa7501 Před 2 lety

    hello someone with the codes for ds3231 with arduino unor3. Im new here

  • @xxrlatkdqhdxx8417
    @xxrlatkdqhdxx8417 Před 6 lety

    May I use the arduino nano I don't have arduino mega. ^^;;

    • @drakethomas652
      @drakethomas652 Před 5 lety +1

      You should be able to use it without an arduino nano, because as far as I know, with any given arduino circuit board; the only difference is how fast it can process info, as well as its storage capacity.

  • @nandahidellearachchi2016

    very hard to understand your demostration

  • @argilaga
    @argilaga Před 6 lety

    Thanks, the video is very clear.

  • @althuelectronics5158
    @althuelectronics5158 Před 4 lety

    Hai Sir you please helping. This program . Am wery interest

  • @s.sradon9782
    @s.sradon9782 Před 5 lety

    The cr2032 cell should be replaced with a lir2032 due to the cr cell series being primary.

  • @jameswinata299
    @jameswinata299 Před rokem

    0:43 voice crack ;)

  • @kunalpandhram7501
    @kunalpandhram7501 Před 2 lety

    hello sir, could you share code for Daily Schedule Timer ON-OFF Using RTC Module with Memory Backup If Power Cuts

  • @eulamieraz4383
    @eulamieraz4383 Před 3 lety

    Good day! I already tried your given codes and I encountered some problems. Like, when its automatically printing on the serial monitor, after the first line being printed, the following lines showing undefined character. Why is that, and how can I solve it?

    • @hakanmf1
      @hakanmf1 Před 3 lety

      Change the Baudrate on your Serial Monitor to the one given in the code, for me it looks like: "Serial.begin(115200)"

  • @magdanoz88
    @magdanoz88 Před 7 lety

    How to make the RTC counting a delay? I'll explain. I have 2 large stepper motors. I need to turn them one revolution per minute. Is it possible to do it with RTC? My delay varies and is from a minute up to 24 hours. :) The delay function is not accurate for long periods of time...

    • @magdanoz88
      @magdanoz88 Před 7 lety

      Thank you, Dejan! Your reply was really helpful! I'll try this tomorrow (I have the setup already made).

  • @Ammu_2722
    @Ammu_2722 Před rokem

    Please vidiga code pettandi

  • @M.4y
    @M.4y Před 5 lety

    But it isn't accurate right?

    • @casper2501
      @casper2501 Před 5 lety

      It's accurate don't worry

    • @M.4y
      @M.4y Před 5 lety

      @@casper2501 thanks

  • @driss25
    @driss25 Před 3 lety

    no push button

  • @venkatramanseetharaman1998

    may-i-know-the-connections-please

  • @nathbdlt5759
    @nathbdlt5759 Před 2 lety

    Math is cool

  • @peopleofengerek7816
    @peopleofengerek7816 Před 3 měsíci

    But I have simple arduino

  • @BlockGod_1832
    @BlockGod_1832 Před 4 lety

    he gave me the wrong code

  • @Alexelectricalengineering

    Thumbs up :)