How to simply use DS3231 RTC module with Arduino + OLED display

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 มิ.ย. 2024
  • Hi, welcome to this tutorial where I use the DS3231 Real time clock with Arduino UNO board and displaying different formats of date and time on the OLED screen and also the temperature, step by step tutorial with the help of an easy library to easily embbed in your projects.
    Please consider a Like and Subscribe
    Wiring, libraries and codes:
    surtrtech.com/2019/01/13/how-t...
    Arduino RTC playlist:
    bit.ly/2I7ZwFC
    How to simply use RTC DS1302 with Arduino:
    goo.gl/GmCKSi
    How to setup RTC DS1302 with keypad and Arduino:
    goo.gl/cySS9x
    How to use 128*32 OLED display:
    • Use OLED display + Ard...
    Arduino Modules playlist:
    goo.gl/aYuv4Y
    Arduino Projects playlist:
    goo.gl/sL4Bge
    Arduino Shields playlist:
    goo.gl/X8DaaW
    Siemens TIA Portal playlist:
    goo.gl/VxJTTT
    Facebook: / surtrtech
    Twitter: / surtrtech
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 32

  • @dyvyby
    @dyvyby ปีที่แล้ว

    This one has a nice library and easy to understand unlike the others 🤯
    Also your codes made me understand the Library more, thank you so much 😌

  • @MrBobWareham
    @MrBobWareham 4 ปีที่แล้ว +1

    Thank you for your video very interesting, this display is very good perhaps I will get one to try

  • @am1manTravel
    @am1manTravel 11 หลายเดือนก่อน

    Does your DS3231 maintain the correct time when everything is unplugged from power? So that later when you reconnect it to power it will show the correct time? I've been having lots of issues with a similar setup. Many thanks.

  • @mariuspetcu7482
    @mariuspetcu7482 3 หลายเดือนก่อน

    Hello mate ,
    I was tray to follow your example but NO matter what I have don I can't get rid of this error :
    ///
    sketch_mar06a:22:8: error: 'DS3231 clock' redeclared as different kind of symbol
    DS3231 clock;
    ///
    Any idea why ? ... what could be wrong and where ?
    Many Thanks in Advance ...

  • @danijellikar8779
    @danijellikar8779 4 ปีที่แล้ว

    Hello SurtrTech. Watched closely your tutorial, connected everything carefully, downloaded and included ONLY the DS3231 master library you recomend. Uploaded "simple" example of the library, no errors reported but serial monitor says "Initialize 3231" and nothing happens from that point! It just will not start the clock. any possible solutions?

    • @SurtrTech
      @SurtrTech  4 ปีที่แล้ว

      Hello, are you using other board than Uno?

  • @leohamelinck3524
    @leohamelinck3524 11 หลายเดือนก่อน

    What is wrong ? My IDE gives an error on this line: DS3231 clock"" ; please help me

  • @oceancity1042
    @oceancity1042 3 ปีที่แล้ว

    Your tutorial is one of the few on you tube that has the basis of what I am trying to achieve using a OELD 128 X 32 Screen.
    A couple of questions
    1. Is it possible to display the two different times on the screen at the same time . Showing for example different time zones?
    2. when less than ten , the months and minutes show a single digit on the display , is it possible for this to be preceded by a 0

    • @SurtrTech
      @SurtrTech  3 ปีที่แล้ว +1

      Hello, thanks.
      For different times I think the RTC can only keep one time zone, you can add others timezones by incrasing/decreasing the hours value (you'll be needing a lot of conditions to avoid displaying strange values)...
      Please refer to the library Github page, you'll find all the ways of displaying the values... if not, you can add other conditions that check the value and add 0 if needed.

    • @oceancity1042
      @oceancity1042 3 ปีที่แล้ว

      SurtrTech . Thank you for taking the time to get back to me. I have so far managed to display on the screen 2 clock displays showing the same time but in different formats - the next challenge is to introduce a millis() function into the script of one of the clock displays. Any thoughts ?
      Regards Robert

    • @SurtrTech
      @SurtrTech  3 ปีที่แล้ว

      @@oceancity1042 ​ Hello, millis() returns the time since the Arduino started the program... you can use it to display millis too and you should take the seconds as your reference.

  • @DRZME400
    @DRZME400 4 ปีที่แล้ว +1

    I cannot figure out why the Code_1 sketch seems to work great with my OLED but Code_7 only shows the temperature and not the time? I think it may have to do with the clock.dateFormat("g:i", dt) vs. the dt.hour method

    • @SurtrTech
      @SurtrTech  4 ปีที่แล้ว +1

      Hello, check the library link github.com/jarzebski/Arduino-DS3231 it shows different formats possible to use... and try them.

    • @DRZME400
      @DRZME400 4 ปีที่แล้ว +1

      @@SurtrTech I didn't even get a notification you replied to me. Thank you so much. I will look into this. Ignore my post on the arduino hub.

    • @DRZME400
      @DRZME400 4 ปีที่แล้ว

      @@SurtrTech wait. I have this library. I have the same problem when I run the dateformat example file. Let me make a quick video and show you.

    • @DRZME400
      @DRZME400 4 ปีที่แล้ว

      @@SurtrTech check out my video th-cam.com/video/Gl1-mtAyvkU/w-d-xo.html

  • @oceancity1042
    @oceancity1042 3 ปีที่แล้ว

    Hi, Been following your conversation and had hoped I had cracked it but no avail. My Arduino at version 1.18.3,
    Still getting the same problem ‘RTCDateTime’ does not name a type’. believe subscribers have experience a similar problem. Would sincerely appreciate your help to resolve.

    • @SurtrTech
      @SurtrTech  3 ปีที่แล้ว

      Hello, please make sure you downloaded the library and installed it correctly... sometimes it can be a problem, try to check for new libraries...I already have one in the article but there maybe a change, and I can't keep up with everything.

    • @oceancity1042
      @oceancity1042 3 ปีที่แล้ว

      SurtrTech . Thank you for taking the time to reply , I did indeed upload the software again as suggested and that fixed the problem . Your assistance and you tube videos are exceptional. Thank you again.
      Best regards
      Robert

  • @mkeregha
    @mkeregha 5 ปีที่แล้ว

    hey i am havin problems uploading the code

    • @SurtrTech
      @SurtrTech  5 ปีที่แล้ว

      Hi, can you tell me what kind of problems? Compiling?

    • @SurtrTech
      @SurtrTech  5 ปีที่แล้ว

      @LeafDoode Hi, that's a library problem, did you installed it correctly? And please check that you did not install more than one library for the RTC.

    • @SurtrTech
      @SurtrTech  5 ปีที่แล้ว

      @LeafDoode If you want to use the same library that I used, you can go the Arduino libraries folder (Generaly in Documents/Arduino/Libraries) and delete the other libraries folder, and leave this one its name there is "Arduino-DS3231-master"

    • @SurtrTech
      @SurtrTech  5 ปีที่แล้ว

      @LeafDoode Did you try to look in "Program Files / Arduino / Libraries" ?

    • @SurtrTech
      @SurtrTech  5 ปีที่แล้ว

      @LeafDoode Look also here (C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries)
      Those are the 3 locations where your libraries are stored
      Check this: forum.arduino.cc/index.php?topic=390833.0

  • @Mixa007Master
    @Mixa007Master 5 ปีที่แล้ว +1

    1 button ?
    2 display
    - clock 12:34:56
    - date 01/02/1234 D M Y
    - temperature C* -50.1 +80.1
    =====
    + setup

    • @SurtrTech
      @SurtrTech  5 ปีที่แล้ว

      Sorry I didn't understand what do you mean !

    • @MrBobWareham
      @MrBobWareham 4 ปีที่แล้ว

      Yes, buttons for the display would be good it would make it easy to use I think three buttons would do the job!!