Displaying time and date on a screen with Arduino!

Introduction

In this project, we’ll see how to display the time and date on an LCD screen. This project can be very useful for making an alarm clock or just a clock. All you need to do is add batteries to the Arduino board and print a box using a 3d printer, and you’ve got a truly autonomous clock.

Difficulty:

Materials required

We will now list the hardware required for the project:

  • Arduino Uno board
  • 16×2 Liquid Crystal LCD display
  • Potentiometer
  • A 220 ohm resistor
  • Connecting wires (about fifteen!)

Schematic diagram

What's the potentiometer for?

The potentiometer adjusts the screen brightness. You can do without it by connecting 5V directly to the brown wire, and the GND that runs from the potentiometer to the screen can be connected directly to the Arduino board.

Project program

Change time and date in the program!

As you can see from the picture, the start date and time is fixed and not necessarily on the right day. You can therefore change this date yourself in the program.

Here’s the line to change:

How can I keep the current time when the Arduino is switched off?

As you can see, the clock and date do not continue to update once the Arduino board has been switched off. This can be annoying if you’re making a clock, for example. To solve this problem, you can add an rtc clock module (like the DS3231) to your project, which will calculate the time even when the Arduino board is switched off, thanks to a battery independent of the Arduino board’s power supply.

Simulation of the project

Here is the project simulation on tinkercad: