How to use DS3231 RTC module to build OLED clock

  Переглядів 29,538

Mario's Ideas

Mario's Ideas

3 роки тому

In this video I will show you how to use DS3231 RTC module. It will explain how to connect it to I2C bus.
Also I will show you how to display date and time readings on the OLED display.
Hope that you will find this video useful.
The code and a list of components can be found here:
www.hackster.io/mdraber/tutor...
or here
www.hackster.io/mdraber/tutor...
In the video I use I2C scanner code:
playground.arduino.cc/Main/I2...
And Library:
github.com/jarzebski/Arduino-...
If you like this content and you want to support me in creating similar videos go to my Patreon webpage
/ mariosideas
Or
www.paypal.com/cgi-bin/webscr...
Music credits:
------------------------------
Track: Highlander - Scandinavianz [Audio Library Release]
Music provided by Audio Library Plus
Watch: • Highlander - Scandinav...
Free Download / Stream: alplus.io/highlander
------------------------------

КОМЕНТАРІ: 79
@yogenrai5651
@yogenrai5651 13 годин тому
Thank you so much sir for showing little details and explaining because of mentors like you the world is a better place
@mywschool8910
@mywschool8910 Рік тому
This tutorial helped me a lot. Many thanks man
@geertborloo
@geertborloo 3 місяці тому
Very clear tutorial, explaining all necessary things to know. Thanks !!
@marios_ideas
@marios_ideas 3 місяці тому
Glad you liked it
@alvin0000
@alvin0000 Рік тому
Thank you for share your knowledge. I follow the tutorial and it work as in your video. THANK YOU
@marios_ideas
@marios_ideas Рік тому
Glad you like it.
@nigelholland24
@nigelholland24 Рік тому
Great video. Thank you.
@marios_ideas
@marios_ideas Рік тому
You're welcome:)
@jahirulislamshovon9256
@jahirulislamshovon9256 3 роки тому
Nice and detailed
@marios_ideas
@marios_ideas 3 роки тому
Thanks:)
@charandas6162
@charandas6162 2 роки тому
What will be the connection and code if we use Arduino maga or esp32
@ArkhaanX
@ArkhaanX 3 роки тому
Thank you.
@marios_ideas
@marios_ideas 3 роки тому
You're welcome:)
@armedbacon4169
@armedbacon4169 3 роки тому
love ur new vid btw can u do a dare for me? dare: can you make an atmega328p handheld console without getting the codes from the internet (if u cant np 😁)
@agaldoo
@agaldoo 10 місяців тому
Use the esp32 it has 240 mhz clock and 2MB of storage. The pins are d21(sck) and d22(sda)
@rafteralimagno5997
@rafteralimagno5997 2 роки тому
What part of the code will the address 0x68 (for the DS32321) be used? I understand that Arduino can communicate with I2C devices thru their addresses but I only see the address for the OLED being used. I hope you can respond to this. Thank you!
@marios_ideas
@marios_ideas 2 роки тому
Yes you are right. In declaring the RTC you do not quote the address. So It must be done in the library code and that would indicate that DS3231 has fixed address as opposed to OLED displays which I thinkk have 2 or 3 potentialy different addresses.
@rafteralimagno5997
@rafteralimagno5997 2 роки тому
@@marios_ideas Alright! I understand your explanation. Btw, I'm doing a project now. But I'm using an LCD instead of ng OLED display. The clock.dateFormat won't work whenever I want to print to the LCD or the serial monitor. I use these for trying to print: LCD: lcd.print(clock.dateFormat("H:i:s", dt)); Serial Monitor: Serial.println(clock.dateFormat("m.d.y|H:i:s", dt)); If you have any ideas about this, it will be very helpful! Thanks a lot!
@marios_ideas
@marios_ideas 2 роки тому
Is it possible that it is the same memory problem that I descried for oled displays. So the rtc library plus liquid cristal library together consume too much memory. Try to remove from code lcd part and see if then serial.print works
@billferner6741
@billferner6741 19 днів тому
I run into the memory problem as soon as I started. My solution was putting all text messages (e.g. help or failure code) into the eeprom.
@am1manTravel
@am1manTravel 10 місяців тому
Thank you. I used the code "OLED clock using DS3231 RTC module with the memory problem fix" and it worked! Is there a way I can change the temp from C to F? More importantly, it does not keep time when unplugged from power even though I have a fresh battery in the RTC. Any ideas?
@am1manTravel
@am1manTravel 10 місяців тому
I fixed the time issue! still looking to change C to F.
@marios_ideas
@marios_ideas 10 місяців тому
This should be a simple formula to be applied to a variable storing celcius value . Temperature in degrees Celsius (°C) = (Temperature in degrees Fahrenheit (°F) - 32) * 5/9.
@flameshine2207
@flameshine2207 2 роки тому
I want to know how to make a clock by using u8g2 library, how to set address for oled screen?
@marios_ideas
@marios_ideas 2 роки тому
I do not know that library but I have some projects in the pipeline that will use OLED displays. If I like this library I may use it and do a small tutorial on it
@sibaramdatta5625
@sibaramdatta5625 Рік тому
"Ds3231 clock redeclared as different kind of symbol" this type of message shows when tried to upload the sketch. Please help me in this regard. All libraries has been downloaded.
@davidcircuity6473
@davidcircuity6473 11 місяців тому
I get the same error on ESP32, this seems to be an error with a separate clock library. The compilation error "redeclared as different kind of symbol" typically occurs when you have conflicting declarations or naming issues in your code. In this case, it seems that you have a naming conflict with the symbol 'DS3231 clock'. Perhaps this is due to a separate clock library we have loaded. ...but if so which library is causing the problem?
@sapitron
@sapitron 5 місяців тому
this error happens because there are two different libraries with the same name, "DS3231", one by andrew wickert and the other one by Korneliusz Jarzebski. this last one is used in the present video. uninstall the other one. the author of the video seems to be unaware of this problem.
@am1manTravel
@am1manTravel 10 місяців тому
Can I find/call this up on WOKWI?
@marios_ideas
@marios_ideas 10 місяців тому
WOKWI?
@am1manTravel
@am1manTravel 10 місяців тому
@@marios_ideas Oh, I thought that is how you made the diagram around 7:47. WOKWI is an arduino simulator- I'm new to it.
@vijithcv
@vijithcv 2 роки тому
while running the library DS3231 SIMPLE code , there is no time displayed in the Serial monitor. The code shows no error but while printing the output in the serial monitor, there is an empty space. hence current date or time is not displayed.
@marios_ideas
@marios_ideas 2 роки тому
Having you checked if the device is recognized by i2c bus. Look for the i2c scanner code and run it. It will show you if the module is visible and under which address
@vijithcv
@vijithcv 2 роки тому
@@marios_ideas its not the device issue. Seems some issue with the library. I am able to run the DS3231_simple code of that lib under examples and i get the date and time under Serial Monitor. But when running the DS3231_DATEFORMAT code its not giving any output and gives only blank spaces in the Serial Monitor
@vijithcv
@vijithcv 2 роки тому
@@marios_ideas it was a bug in the library. In the Github page updated library file is there. After downloading that the issue is resolved
@priyaop5040
@priyaop5040 2 роки тому
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?
@marios_ideas
@marios_ideas 2 роки тому
no battery or dead battery in the RTC?
@donzhu4996
@donzhu4996 Рік тому
@@marios_ideas Seems like I have the same issue. I checked the battery and it was full.
@marios_ideas
@marios_ideas Рік тому
@@donzhu4996 I must be the hardware. Software is just reading the time from the RTC. The problem I had once was the time was always reset to the particular time after restart, and the solution was that there was a line in the code that was setting the particular time. But this is not the case you guys have here
@nikodemkarcz310
@nikodemkarcz310 2 роки тому
Are the new version now? I did exactly the same code but it doesn’t work
@marios_ideas
@marios_ideas 2 роки тому
What exactly does not work
@nikodemkarcz310
@nikodemkarcz310 2 роки тому
„RTCDateTime does not name a type
@marios_ideas
@marios_ideas 2 роки тому
Nikodem Karcz so do you have an error when compiling? Can you paste the line of code and an error
@marios_ideas
@marios_ideas 2 роки тому
Did you install the libraries?
@nikodemkarcz310
@nikodemkarcz310 2 роки тому
@@marios_ideas yup
@mominkhadri8062
@mominkhadri8062 2 роки тому
you have not shared your second code, i dont have mega, will you plz send your second custon fuction code.
@mominkhadri8062
@mominkhadri8062 2 роки тому
first one does not run in nano or arduino
@marios_ideas
@marios_ideas 2 роки тому
In create.arduino.cc/projecthub/mdraber/tutorial-on-how-to-use-ds3231-rtc-module-e12b38?ref=user&ref_id=1474727&offset=6 there are both codes provided
@mominkhadri8062
@mominkhadri8062 2 роки тому
@@marios_ideas thank you so much i got it !!!, what changes should i make in the 2nd code to show 12 hr format?
@deniker1
@deniker1 2 роки тому
@@mominkhadri8062 I want a 12 hr code I've been pulling my hair all day
@mominkhadri8062
@mominkhadri8062 2 роки тому
@@deniker1 same here bro
@sapitron
@sapitron 5 місяців тому
the "redeclared as different kind of symbol" error happens because there are two different libraries with the same name, "DS3231", one by andrew wickert and the other one by Korneliusz Jarzebski. this last one is used in the present video. uninstall the other one (which is much more popular and available at the online repository). the author of the video seems to be unaware of this problem.
@marios_ideas
@marios_ideas 5 місяців тому
At the time of vide creation I had to install the library. So at this stage I chose which one I want to install. If you installed one before and then decide to use Jarzembski's library it is clear that you have to remove the library that has the same name as both cannot coexist. I have never run into this problem as I have never installed the other library to start with. Later I experimented with both but that was after i created this video
@mariuspetcu7482
@mariuspetcu7482 2 місяці тому
Hello mate , I have more than 7 weeks since I am trying to reproduce you clock example but for life of me , I can't get rid of """error: no matching function for call to 'DS3231::DS3231()' DS3231 clock; """ ... Can You guide me or explain in simple words (for newbies like me - LOL) where it came from / why / where should I look ? ... I've being reading / watching tones of explanations but none of them sims to work so PLEASE , do You have a solution for this ? ... Thank You for all you hard work and for sharing with us ... Bless You
@marios_ideas
@marios_ideas 2 місяці тому
have you intealled the library?
@mariuspetcu7482
@mariuspetcu7482 2 місяці тому
@@marios_ideas Thank You for the answer ... Yes , the one you provide it , and I put it here : """ C:\Program Files (x86)\Arduino\libraries """ - could be / has to be installed in another place ? ... - it is possible to be in conflict with other libraries that already installed ? ... THANK You
@mariuspetcu7482
@mariuspetcu7482 2 місяці тому
oled_clock_using_ds3231_rtc_module_:11:8: error: no matching function for call to 'DS3231::DS3231()' DS3231 clock; ^~~~~ In file included from E:\Download_NOU_Mar_2020\New folder\oled_clock_using_ds3231_rtc_module_\oled_clock_using_ds3231_rtc_module_.ino:7:0: C:\Program Files (x86)\Arduino\libraries\DS3231/DS3231.h:80:3: note: candidate: DS3231::DS3231(uint8_t, uint8_t) DS3231(uint8_t data_pin, uint8_t sclk_pin); ^~~~~~ C:\Program Files (x86)\Arduino\libraries\DS3231/DS3231.h:80:3: note: candidate expects 2 arguments, 0 provided C:\Program Files (x86)\Arduino\libraries\DS3231/DS3231.h:77:7: note: candidate: constexpr DS3231::DS3231(const DS3231&) class DS3231 ^~~~~~ C:\Program Files (x86)\Arduino\libraries\DS3231/DS3231.h:77:7: note: candidate expects 1 argument, 0 provided C:\Program Files (x86)\Arduino\libraries\DS3231/DS3231.h:77:7: note: candidate: constexpr DS3231::DS3231(DS3231&&) C:\Program Files (x86)\Arduino\libraries\DS3231/DS3231.h:77:7: note: candidate expects 1 argument, 0 provided oled_clock_using_ds3231_rtc_module_:12:1: error: 'RTCDateTime' does not name a type RTCDateTime dt; ^~~~~~~~~~~ E:\Download_NOU_Mar_2020\New folder\oled_clock_using_ds3231_rtc_module_\oled_clock_using_ds3231_rtc_module_.ino: In function 'void setup()': oled_clock_using_ds3231_rtc_module_:24:11: error: 'class DS3231' has no member named 'setDateTime'; did you mean 'setTime'? clock.setDateTime(__DATE__, __TIME__); ^~~~~~~~~~~ setTime E:\Download_NOU_Mar_2020\New folder\oled_clock_using_ds3231_rtc_module_\oled_clock_using_ds3231_rtc_module_.ino: In function 'void loop()': oled_clock_using_ds3231_rtc_module_:42:3: error: 'dt' was not declared in this scope dt = clock.getDateTime(); ^~ oled_clock_using_ds3231_rtc_module_:42:14: error: 'class DS3231' has no member named 'getDateTime'; did you mean 'getTime'? dt = clock.getDateTime(); ^~~~~~~~~~~ getTime oled_clock_using_ds3231_rtc_module_:51:27: error: 'class DS3231' has no member named 'dateFormat' display.println(clock.dateFormat("l", dt)); ^~~~~~~~~~ oled_clock_using_ds3231_rtc_module_:56:25: error: 'class DS3231' has no member named 'dateFormat' display.println(clock.dateFormat("M jS Y ", dt)); ^~~~~~~~~~ oled_clock_using_ds3231_rtc_module_:61:27: error: 'class DS3231' has no member named 'dateFormat' display.println(clock.dateFormat("H:i", dt)); ^~~~~~~~~~ oled_clock_using_ds3231_rtc_module_:66:25: error: 'class DS3231' has no member named 'dateFormat' display.println(clock.dateFormat("s", dt)); ^~~~~~~~~~ 🤣😭😥😳
@marios_ideas
@marios_ideas 2 місяці тому
@@mariuspetcu7482Remove the library from that folder and then install the zip file through Arduino IDE. Make sure you use the exact library from the link. There are various libraries with the same name in the net. So remove all libraries reffered to ds3231 and then install the right library again
@mariuspetcu7482
@mariuspetcu7482 2 місяці тому
@@marios_ideas Thank You for the answer mate ... I will do that and post back the result ...
@BoydGoldie
@BoydGoldie Рік тому
Me too, the link to components and code does not work.
@marios_ideas
@marios_ideas Рік тому
The site where I was storing the code was uprgading and it invalideated all my links. I have moved to hackster.io. Let me know if this works for you
@Dimuuz
@Dimuuz Рік тому
I can't find the code. The link doesn't work ⛔
@marios_ideas
@marios_ideas Рік тому
I will fix it soon. It is the fault of the website i store the code on. They modernised it and it invalidated some of the links
@MrTutitoto
@MrTutitoto 3 роки тому
Nano Every with 6KB of sram or the MKR Zero with 32KB of sram
@marios_ideas
@marios_ideas 3 роки тому
Thanks. Is Nano Every recognised by Arduino IDE as Nano, How do I connect the other board to Arduino IDE
@PolyGameDev
@PolyGameDev 4 місяці тому
9:30 DS3231 clock not working.
@michelforget3638
@michelforget3638 3 роки тому
esp32
@marios_ideas
@marios_ideas 3 роки тому
Can you elaborate?:)
@DuduHN2009
@DuduHN2009 Рік тому
SImple! ESP32!!!!! 512Kb of RAM!
@flashcorp76
@flashcorp76 Рік тому
Clock time size is (2), seconds text size is (2)…..But they are Not displayed as the same size…where is the catch ?
@marios_ideas
@marios_ideas Рік тому
Ups....:) You just spotted the error in my video. I updated the link to the code in the description. There you will find the actual code that was used to achieve the result you see in this video.
@driss25
@driss25 Рік тому
Not push button
@marios_ideas
@marios_ideas Рік тому
Explain?
Make your own Retro Nixie Clock with an RTC!
10:54
GreatScott!
Переглядів 1 млн
How to use LoRa Module with Arduino - Range Test - RYLR406 15KM
13:00
Ahmad Logs
Переглядів 314 тис.
Das RTC DS3231 Modul einfach erklärt, Teil 1  | #EdisTechlab #rtc #ds3231
11:01
ARDUINO CLOCK OLED DISPLAY AND ANIMATION - Arduino project
44:11
Bas on Tech
Переглядів 19 тис.
Arduino Tutorial - 14. Displaymenü
9:19
MaxTechTV
Переглядів 241 тис.
All about the DS3231
13:11
learnelectronics
Переглядів 25 тис.
Arduino Real Time Clock - Using the Tiny RTC
31:29
DroneBot Workshop
Переглядів 197 тис.
Вы поможете украсть ваш iPhone
0:56
Romancev768
Переглядів 385 тис.
APPLE УБИЛА ЕГО - iMac 27 5K
19:34
ЗЕ МАККЕРС
Переглядів 82 тис.
🤯Самая КРУТАЯ Функция #shorts
0:58
YOLODROID
Переглядів 3,3 млн
Я Создал Новый Айфон!
0:59
FLV
Переглядів 2,9 млн
wyłącznik
0:50
Panele Fotowoltaiczne
Переглядів 2,6 млн
Рекламная уловка Apple 😏
0:59
Яблык
Переглядів 796 тис.