arduino real time clock ds3231 with lcd display in stock

In today"s world, time is everything, and when it comes to specific electronics, timing is critical; just like us, humans, they also need a way to keep track of time. So how do electronics do it? The answer is DS3231, a Real-Time Clock, often known as an RTC, is a timekeeping device built into an Integrated Circuit, or IC. It is used in many time-critical applications and devices, such as servers, GPS, and data loggers. Let"s see what makes it TICK.

The DS3231 is an I2C real-time clock (RTC) with an inbuilt temperature compensated crystal oscillator (TCXO) and crystal that is both low-cost and exceptionally precise. When the module"s power is interrupted, the device has a battery input and keeps a precise time. The device"s long-term precision is improved by the inclusion of the crystal oscillator. The RTC keeps track of seconds, minutes, hours, days, dates, months, and years. For months with less than 31 days, the date at the end of the month is automatically modified, including leap year corrections. The clock has an AM/PM indication and works in either a 24-hour or 12-hour mode. Two programmable time-of-day alarms are included, as well as a programmable square-wave output. An I2C bidirectional bus is used to transport address and data serially.

The key components of a typical DS3231 RTC Module board are the DS3231 IC and the AT24C32 EEPROM IC to store the time and date data. Other components include a Power ON LED, a few resistors, capacitors, a battery holder, and pins for connecting to the microcontroller.

When the main power to the module is stopped, the DS3231 contains a battery input and maintains accurate time. The built-in power-sense circuit constantly checks the condition of VCC to identify power outages and switches to the backup supply automatically. So, even if the power goes out, your MCU will still be able to maintain track of time. On the DS3231 RTC Module, there is a CR2032 battery holder. A battery holder for a 20mm 3V lithium coin cell is located on the board"s bottom side. Any CR2032 battery will work.

The most significant difference between the DS3231 and the DS1370 is the timekeeping accuracy. For timekeeping, the DS1307 has an external 32kHz crystal oscillator, while the DS3231 has an internal oscillator.

The temperature-compensated crystal oscillator (TCXO) in the DS3231 and DS3234 fits the bill, with precision as good as ±2 ppm in temperatures ranging from 0°C to +40°C.

After making the above connections, you need to connect the Arduino UNO to your PC, open Arduino IDE, and install Arduino DS3231 Time Set Library. Open the Arduino IDE and select Library Manager from the menu bar. Now look for RTCLiband DS3231 and get the most recent version, as shown in the figure below.

You may manually set the time in this line by passing the date-time value to the function in the following order: year, month, date, hour, minute, and second. We"ll set the time of the system in the code below. As a result, we have commented out this line.

We include the below header files to the code, Wire.h to use I2C to communicate with the module, LiquidCrystal.h to show time on the LCD display, RTClib.h to set time to the display and format it.

If in case the RTC loses power and the time in the module goes wrong, the code will automatically set the time in the module and it will take the time from the computer"s clock. So make sure while setting time, the clock on your PC is set at the right time.

arduino real time clock ds3231 with lcd display in stock

It doesn"t look that great on the breadboard with all those wires but it does the job and it can be simplified by using a I2C display, but I"ll cover that subject in a future instructable.

The operation mode is quite simple, you have two buttons, the first one, linked to the pin 8 on arduino is used to select the parameter (date, hour minute ...) and at the end to save the new date. The second button, which is attached to pin 9 on arduino, is used to increment the selected parameter and at the end to cancel data you have just entered (don"t save) in case you"re not happy with it.

arduino real time clock ds3231 with lcd display in stock

About: Maker 101; Beginner and intermediate level Maker projects! You can find projects such as "How to" and "DIY" on programmable boards such as Arduino, ESP8266, ESP32 and Raspberry Pi on this channel. The projects…

arduino real time clock ds3231 with lcd display in stock

In this tutorial, we will discuss the purpose of getting the current date and time on the Arduino, what is a Real-Time Clock, what is a DS3231 RTC module and we will build a project using a DS3231 RTC module, a 16×2 I2C LCD and an Arduino Uno.

Keeping track of the current date/time for an Arduino has many purposes. One use for it is for recording/log purposes. For example, an Arduino Weather Station needs timestamps in recording weather data. Another example is for an Arduino digital clock or calendar. Arduino-based clocks use the current time as a timer for reminders or to execute a scheduled command via the Arduino’s I/O pins. Depending on the project, having a way to get the current date and time is very useful.

Real-Time Clock (RTC) – A Real-Time Clock, or RTC for short, is an integrated circuit that keeps track of time. It uses a back-up battery to maintain the time in the event that the main power source is removed.

Global Positioning Device (GPS) – A GPS device communicates with satellites to determine its location anywhere in the world. Its GPS data also contains time data.

Time Server– A Time Server is a computer on a network that reads the time from some reference clock and distributes it to the network. The clock source of a time server can be another time server, an atomic clock, or a radio clock.

If you want to learn how to communicate with an internet time server to get the current time and date, please read How to Keep Track of the Date and Time on an Arduino.

The DS3231 RTC module is a real-time clock module using the DS3231 IC. The DS3231 IC is a very affordable and extremely accurate RTC with an I2C interface. It is very accurate because it uses an integrated temperature-compensated crystal oscillator (TCXO) along with a crystal. To keep track of time even if the main power source is removed, the DS3231 has a backup battery mounted at the back of the module. The chip automatically switches between main and backup power sources when necessary.

The RTC keeps track of seconds, minutes, hours, day, date, month, and year data. It also automatically adjusts for months with less than 31 days and also for leap years. The clock can operate in either 24H or 12H (with AM/PM) formats. There are also two programmable time-of-day alarms and also a programmable square-wave output. Communication with the RTC is done through an I2C interface with a fixed default address of 0x68.

Aside from the RTC chip, this particular module also has a 24C32 EEPROM chip. An EEPROM is a kind of data storage device wherein you can read/write data. The 24C32 has 32 bytes of available data storage space. It shares the module’s I2C bus with the DS3231 and has the default address of 0x57. We can change the EEPROM’s default address by bridging the solder pads indicated by A0, A1, and A2 as shown in Figure 2.

SQW – outputs a square-wave signal from the DS3231 chip. The frequency of the square-wave can be changed between 1Hz, 4kHz, 8kHz, or 32kHz programmatically. this pin can also be used programmed as an interrupt output.

After learning about timekeeping and the DS3231 RTC, it is now time to build a project using the DS3231 RTC. For this project, we will make a simple Arduino Calendar Clock using a DS3231 module, a 16×2 I2C LCD, and an Arduino Uno board.

If you want to learn more about the Arduino, check out our Ultimate Guide to the Arduino video course. You’ll learn basic to advanced Arduino programming and circuit building techniques that will prepare you to build any project.

To start our sketch, add the abovementioned libraries to our code by using the keyword #include. We will also initialize two objects lcd() and rtc to be used for communicating with the LCD and DS3231 respectively.

The first function we will code is the function updateRTC(). This function will be responsible for asking the user for the date and time and updating the RTC’s internal clock with the user’s input data. After getting the user input, we can update the RTC’s internal clock by using the function rtc.adjust() from the RTCLib.h library. The rtc.adjust() function receives a parameter with type DataTime which it uses to update the rtc’s internal time and date.

The second custom function we will create is the function updateLCD(). This function will update or refresh the text displayed on the LCD. Inside this function, we will first get the time and date from the RTC. This is done by calling rtc.now() function which is included in the RTCLib.h library.

The function rtc.now() in our code returns a DateTime data type that contains the current date and time of the rtc. We then assign the data to different variables for additional formatting on the LCD. After assigning the variables, we use the functions lcd.setCursor() and lcd.print() from the LiquidCrystal_I2C.hto position the cursor and to display the text respectively on the LCD. The code below shows how these functions come together to get the rtc time, format the text and display it to the LCD.

Inside setup(), we will initialize the serial interface, the lcd and the rtc objects. To initialize the serial with a baud rate of 9600 bps, we will use the code Serial.begin(9600);. For the LCD, we need to initialize the LCD object and switch-on the backlight of the display. This is achieved by the codes lcd.init(); and lcd.backlight();. And finally, we add the code rtc.begin(); to initialize the rtc object.

For the loop() function, we will update the text displayed on the LCD by calling updateLCD();. We will also add the capability to accept user input to update the RTC’s internal clock. If the user sends the char ‘u’ via the serial monitor, it means the user wants to modify the set time and date of the rtc. If this is the case, then we call the function updateRTC(); to handle user input and update the RTC internal clock.

To change the date/time, open your Serial Monitor, and send the letter ‘u’. And then just follow the on-screen prompts to enter the new date and time.

In summary, an RTC module is an easy and inexpensive way to add timekeeping capability to an Arduino based project. This tutorial just showed the basic capability of the DS3231 RTC module. And with more tinkering, you can find lots of uses for this module. Feel free to leave a comment below if you have any questions.

arduino real time clock ds3231 with lcd display in stock

We are happy to present to you Arduino & DS3231 Based Real Time Clock (RTC) & Temperature Monitor. This is a simple real time clock with time, day, date using Arduino UNO board, and DS3231 module. We have also added a temperature monitor to further extend this project.

The alternative IC for DS3231 is DS1307. The DS3231 RTC has a built-in alarm function as well as a temperature sensor with a resolution of 0.25 and an accuracy of ±3°C which makes this project easier.

The DS3231 is a low-cost, extremely accurate I²C real-time clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO) and crystal. The device incorporates a battery input and maintains accurate timekeeping when main power to the device is interrupted.

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 for leap year. The clock operates in either the 24-hour or 12-hour format with an active-low AM/PM indicator. Two programmable time-of-day alarms and a programmable square-wave output are provided.

To make this project work first add the library for DS3231 which is given below. After that upload the code. Once the code is uploaded the project starts working.

On the first row, Real-Time Clock will be displayed. But on the 2nd-row date, time day and temperature will be displayed each after the interval of 3 seconds.

arduino real time clock ds3231 with lcd display in stock

In this Arduino Tutorial we will learn how to use the DS3231 Real Time Clock Module. You can watch the following video or read the written tutorial below.

The first question that comes here is why we actually need a separate RTC for our Arduino Project when the Arduino itself has built-in timekeeper. Well the point is that the RTC module runs on a battery and can keep track of the time even if we reprogram the microcontroller or disconnect the main power.

The DS3231 is a low-cost, highly accurate Real Time Clock which can maintain hours, minutes and seconds, as well as, day, month and year information. Also, it has automatic compensation for leap-years and for months with fewer than 31 days.

Once we connect the module we need to program the Arduino Board to work with the Real Time Clock. However, when it comes to programing a communication between Arduino and an I2C module the code isn’t that small and easy. Luckily, there are already several libraries for the DS3231 RTC which can be found on the internet.

So once we download and install the library we can use its first demo example to initially activate the clock of the RTC module. In the setup section of the demo example code we can notice that there are three line that we need to uncomment in order to initially set the day of the week, the time and the data.

The first line is for setting the day of the week, the second line is for setting the time in hours, minutes and seconds, and the third line is for setting the date in days, months and years.

Now even if we disconnect the Arduino power and then reconnect it and run the Serial Monitor again we can notice that the time keeps going without being reset.

So now we have our Real Time Clock up and running and we can use in any Arduino Project. As a second example I connected an LCD to the Arduino and printed the time and the date on it.

arduino real time clock ds3231 with lcd display in stock

Time is a critical element of our existence that will never get old, and with technology, we can find better and more intuitive ways to measure it. In one of our past tutorials, we looked at how the DS3231 real time clock module can be used with Arduino to display time on a 16×2 LCD display. Today, we will build an upgrade to that project using an Arduino Due, the DS3231 RTC module and a 3.2″colour TFT display in place of the 16×2 LCD display used in the previous project.

At the heart of today’s project is the DS3231 real time clock module which we will use to obtain the current time, date and temperature of the environment. The DS3231 real time clock module is one of the most popular real-time clock chips among makers and DIY enthusiasts. It is a low-cost, highly accurate, I2Cbased real-time clock (RTC) with a temperature-compensated crystal oscillator (TCXO) and crystal integrated into it.  The module integrates a coin cell battery input which helps it retain date and time even when the main power to the device is interrupted. It maintains seconds, minutes, hours, day, date, month, and year information, automatically adjusting the date for months with fewer than 31 days, including corrections for leap year. It can be set to operate either in the 24-hour or 12-hour format with an active-low AM/PM indicator. It has been used in several projects on this website mostly, due to its accuracy, and its low power requirements which help it keep time accurately, for a longer period of time compared to other real-time clocks (RTC) modules.

Another key part/component that we will use in today’s tutorial is the Arduino Due. One of the important things, when designing electronic systems that have displays is ensuring, that there is no flicker or lag when updating information on the screen and one of the best ways to ensure that, is to use a fast enough micro-controller. Putting this into consideration, for this project, we will use the very fast Arduino Due board. The Arduino Due has one of the fastest CPU in the Arduino family. The Due runs on an 84MHz CPU compared to the 16MHz CPU speed of the Arduino UNO, and as such, it is able to update the screen without any visible flickering.

The most important update to the previous project, however, is the 3.2″color LCD display being used. The display gives us the ability to create a better, bigger and colourful user interface for our clock at a cheap price as it costs about 7$ on banggood.

The goal for this project is to build a real-time clock with a user-friendly interface capable of displaying (without lag or flickering) the current time, date, temperature including the minimum and maximum temperature recorded in a particular environment over time.

The 3.2″ TFT, like most other TFT displays, comes as a shield which can be easily mounted on the Arduino Due. This, however, makes it difficult to access the IOs of the Arduino after the display has been mounted, as it tends to cover the front face of the board. To solve this, so that the DS3231 module can be connected, male headers are used (after bending them as shown in the picture below) to connect the RTC module to the Arduino.

To easily write the code for this project, we will use two libraries: the Bodmer TFT HX8537  library for the TFT display and the Sodaq DS3231 library to easily interface with the DS3231 module. Both libraries can be downloaded via the links attached to their names above. The Bodmer library is a version of the UTFT library specially modified for the Arduino Due as this particular display is incompatible with the UTFT library.

With the libraries installed, relaunch the IDE to begin writing the code. The code for this project is quite simple but bulky, due to the functions used to create the user interface.

Next is the void setup function. We initiate communication with the RTC module and Initialize the display, setting our preferred orientation for the display and print the UI to the display.

With this done, we move to the void loop function. Under this function, we write the code to update all the parameters (after specific intervals) on the display including the min temperature, the max temperature, time and the date.

That’s it for this tutorial guys, there are several useful projects that can be built using this tutorial as a foundation. You could decide to add a buzzer to the project to create an alarm clock or make a to-do list based project, all out of this.

arduino real time clock ds3231 with lcd display in stock

Arduino RTC DS3231 Time and Date display on a 16×2 LCD- In this tutorial, you will learn how to make a real-time clock using Arduino, RTC DS3231 module and a 16×2 LCD. This is my first tutorial on the RTC DS3231 real-time clock and in this tutorial, I will explain the extreme basics.

In this project, the battery voltage is stored in the Arduino along with the date and time information. The information which is stored in the Arduino can be requested through Bluetooth using the cell phone application. The data which is received from the Arduino is stored in the database for the post-analysis.

This is the RTC DS3231 module. The RTC stands for Real-Time Clock. You might be thinking why we need the RTC DS3231 module when the Arduino itself has the built-in timekeeper. Arduino is really powerful and we can make a real-time clock, but the problem comes in when the Arduino is turned off, or the power is disconnected, the time and date information is completely lost.

But if you look at the RTC DS3231 module it has a battery and can keep track of the Time and Date information even if the main power supply is disconnected or we reprogram the microcontroller.

The RTC DS3231is a low-cost, highly accurate Real Time Clock, which can maintain hours, minutes, and seconds. This module can also maintain the day, month, and year information. The RTC DS3231 module also has automatic compensation for leap years and for months with fewer than 31 days.

As you can see clearly in the picture above, the DS3231 module has a total of 6 male headers and are clearly labeled. Out of these 6 Pins, we will be using only 4 Pins which are the SCL, SDA, VCC, and GND.

This is the 16×2 LCD, as you can see I have already soldered some jumper wires. I have a very detailed getting startedtutorial on the 16×2 LCD, which covers the extreme basics like for examples, Soldering, interfacing, and basic programming.

This is the complete circuit diagram explaining how a 16×2 LCD and RTC DS3231 module is connected with the Arduino. This schematic is designed in Cadsoft eagle 9.1.0 version. If you want to learn how to make a schematic and PCB, then watchthe tutorial.

As you can see the ground of the Arduino is connected with pin number 1, 5 and pin number 16 of the LCD…5v from the Arduino is connected with pin number 2 and pin number 15…the middle pin of the variable resistor or potentiometer is connected with pin number 3 of the LCD…while the other two pins are connected with the ground and 5v. Pin’s 4 to 7 of the Arduino are connected with pins D7 to D4 of the LCD.

The Vcc pin of the RTC DS3231 module is connected with the 3.3 volts pin of the Arduino, while the Ground of the DS3231 module is connected with the Arduino’s Ground. The SDA and SCL pins of the RTC DS3231 Real Time Clock module are connected with the Analog pins A4 and A5 of the Arduino. The RTC DS3231 module uses the SPI Protocol.

arduino real time clock ds3231 with lcd display in stock

Sometimes it may be necessary to use a display while making a hardware project, but the size and the type of the display may vary according to the application. In a previous project, we used a 0.96″ I2C OLED display, and in this project we will have an I2C 20×4 character display.

This liquid crystal display has 4 lines, 20 character in each line and cannot be used to display graphics. The main feature of this display that it uses I2C interface, which means that you will need only two wires to connect with Arduino. At the back side of the screen there is a small PCB soldered in the display, this circuit is a serial LCD 20 x 4 module and it also has a small trimpot to adjust the contrast of the LCD.

Display’s backlight is blue and the text is white. It is fully compatible with Arduino and has 5V input voltage. Its I2C address could be 0x27 or 0x3F. You can get it for about $7 from Bangood store.

DS3231 is a low-cost, accurate I2C real-time clock (RTC), with an integrated temperature-compensated crystal oscillator (TCXO) and crystal. The device incorporates a battery input, so that if power is disconnected it maintains accurate time.

RTC maintains seconds, minutes, hours, day, date, month, and year information. Less than 31 days of the month, the end date will be automatically adjusted, including corrections for leap year. The clock operates in either the 24 hours or band / AM / PM indication of the 12-hour format. Provides two configurable alarm clock and a calendar can be set to a square wave output. Address and data are transferred serially through an I2C bidirectional bus.

This RTC module operates at input voltage range between 3.3V and 5.5V, so it can be connected with 3.3V or 5V pins. It is available on Banggood store for about $2.

First we need to download the library of the display, which includes all required functions to configure and write on the display. You can find it here.

Unzip the library and add it to the Arduino libraries folder, then run Arduino IDE and copy the following code. The first two lines are to include both of I2C and LCD libraries.

lcd.setCursor(3,0) will set the cursor of the LCD in the specified location, the first argument for the column and the second for the row starting form 0.

Here we will use a small breadboard to connect the RTC module and display with the Arduino’s I2C pins (A4 and A5). The SCL pins are connected with analog 5 pin and the SDA pins with analog 6 pin. The top rail of the breadboard used as I2C bus and the bottom one is power bus.

In addition to setup and loop function, we will create four other functions to organize the code. As the corners and vertical lines of the frame are special characters, we have to create them manually. So we will use a function to create them and another one to print them on the LCD.

Inside the loop function the time will be read from the real time clock module and the printed to the LCD using a custom function for each of time and date.

At first, we have to include the three libraries, I2C, LCD, and RTC and set the LCD address. Inside the setup function the display is initialized, then we will call createCustomCharacters() function and print them.

Each character can be 5-pixel long in width and 8-pixel in height. So to create a custom character we need to create a new byte. We need 5 characters, the vertical line and the four corners. The yellow pattern shows you how the character will be displayed on the LCD.

Inside createCustomCharacters() function, we called lcd.createChar(#, byte array) function. The LCD supports up to 8 custom characters numbered from 0 to 7. It will assign the index in the first argument to the character given by the byte array. To print this character we can use lcd.write(byte(#)) function.

This function is very simple, it uses lcd.setCursor(#,#) to move the cursor and lcd.print(“”) to print the given string. The function will print the top and bottom horizontal lines, then printing other custom characters.

As we discussed earlier, the loop function will get the current time and date every second and refresh them on the display. First we defined a time element “tm” which has current time data, then if the time is correct and the RTC module working fine the time and date will be printed.

PrintTime function uses three arguments, the column and line where it will print the time, and the time element. lcd.print(tm.Hour) will print the hour, then if the minutes and seconds are less than 10 we will add 0 to the left. And the same method is used to print the date.

Now everything is ready, upload the code to your Arduino and enjoy watching your new clock. You can find the full Arduino sketches and libraries in the attachment below.

arduino real time clock ds3231 with lcd display in stock

Real time clock module with the DS3231 chip. This module ensures that the Arduino knows the exact time at all times. By connecting the Arduino to the ´qw´ pin, it is possible to generate an interrupt every second with which sensor values or a display can be addressed.

This module uses the DS3231, which is the big brother of DS1307. This chip has an integrated timing crystal and temperature sensor, which provides more stability. With this module you have just that little extra precision and reliability that the predecessor is missing. The chip is fully compatible with the predecessor and therefore requires no modification in the source code.

arduino real time clock ds3231 with lcd display in stock

We are all aware that most MCUs used in our projects are time-agnostic; that is, they are unaware of the time around them. It’s fine for most of our projects, but every now and then, when you come across an idea where keeping time is critical, the DS3231 Precision RTC module comes in handy. It is suitable for a wide range of projects, including clocks, timers, and alarms, as well as data logging and time stamping.

This module is built around the highly capable DS3231S RTC chip and the AT24C32 EEPROM, both of which have been around for a while and have good library support.

At the heart of the module is a low-cost, extremely accurate RTC chip from Maxim — the DS3231. It handles all timekeeping functions and communicates with the microcontroller over I2C.

The DS3231 can keep track of seconds, minutes, hours, days, dates, months, and years. For months with fewer than 31 days, it automatically adjusts the date at the end of the month, including leap year corrections (valid up to 2100).

Additionally, the DS3231 outputs a stable (temperature compensated) and accurate reference clock on the 32K pin. This clock output may be useful in some applications for measuring clock timing accuracy or clocking other circuits.

Most RTC modules, such as the DS1307, require an external 32kHz crystal oscillator for timekeeping. The issue with these crystals is that their oscillation frequency is affected by external temperature. This change in frequency is negligible, but it adds up.

To avoid such minor crystal drifts, the DS3231 is powered by a 32kHz temperature compensated crystal oscillator (TCXO), which is highly resistant to external temperature changes.

The TCXO is actually composed of an integrated temperature sensor, a 32kHz crystal oscillator, and control logic. The integrated temperature sensor compensates for frequency changes by adding or removing clock ticks, ensuring that timekeeping remains accurate.

The DS1307 requires an external 32kHz crystal for timekeeping, the frequency of which is easily affected by external temperature. As a result, the clock is usually off by about five minutes per month.

The DS3231, on the other hand, is much more accurate because it has an internal Temperature Compensated Crystal Oscillator (TCXO) that isn’t affected by temperature, making it accurate to a few minutes per year at most.

This doesn’t mean that the DS1307 isn’t accurate; it’s still a great RTC that will serve you well, but if your project needs more accurate timekeeping, the DS3231 is a better choice.

The built-in power-sense circuit continuously monitors the status of VCC to detect power failures and automatically switches to the backup supply. This means that even in the event of a power outage, the IC can still keep time.

Assuming you use a fully charged 220mAh coin cell battery and keep the chip current draw to a minimum of 3µA, the battery should be able to power the RTC for at least 8 years without the need for an external power supply.

The DS3231 RTC module also includes a 32-byte (4K x 8-bits) AT24C32 EEPROM (non-volatile) chip with 1,000,000 write cycles. This chip doesn’t really have anything to do with the RTC, but it can be useful for things like data logging or storing any other data that you want to be non-volatile.

If you are using multiple devices on the same I2C bus, you may need to set a different I2C address for EEPROM so that it does not conflict with another I2C device.

The module has a simple I2C interface that takes up two addresses. The DS3231S RTC chip’s fixed I2C address is 0x68, and the EEPROM’s default I2C address is 0x57 (though the address range is 0x50 to 0x57).

Be aware that some DS3231 modules come with a non-rechargeable CR2032 battery. If this is the case, you must remove the resistor because attempting to charge a non-rechargeable battery can cause serious damage.

Now we are left with the pins that are used for I2C communication. Note that each Arduino board has different I2C pins that must be connected correctly.  On Arduino boards with the R3 layout, the SDA (data line) and SCL (clock line) are on the pin headers close to the AREF pin. They are also referred to as A5 (SCL) and A4 (SDA).

It takes a lot of effort to communicate with an RTC module. Fortunately, the uRTCLib library was created to hide all of the complexities, allowing us to issue simple commands to read the RTC data.

It is a simple yet powerful library that also supports time-of-day alarms and programming the SQW output, which is not supported by many RTC libraries.

The sketch begins by including the Arduino.h and uRTCLib.h libraries for communicating with the module. We then create an uRTCLib library object and define the daysOfTheWeek 2D character array to store the days information.

set(ss, mm, hh, day, dd, mm, yy) function sets the RTC to an explicit date and time. For example, to set January 13, 2022 at 12:56, you would call: rtc.set(0, 56, 12, 5, 13, 1, 22);

As an added bonus, the DS3231 RTC module includes 32 bytes of Electrically Erasable ROM. Its contents will not be erased even if the device’s main power is interrupted.

arduino real time clock ds3231 with lcd display in stock

In this project, I will discuss about DS3231 RTC Module, important components and features of this module and finally show you how to Interface a DS3231 Real Time Clock (RTC) Mo...