Clock Set Date Time

5,108

80

6

About: Passionate about electronics and Arduino

Intro: Clock Set Date Time

This clock is the basis of many of my projects.

I was inspired by a friend who has published a tutorial in 2012 (link)

It is a simple clock with LCD display, an RTC (real time clock) and 3 buttons.

For convenience and to save pin dell'Arduino, I used a display with I2C module.

The RTC also uses the I2c protocol.

The 3 buttons, connected to a "pull down" circuit, are used to adjust or change the time and date of the watch, without having to reload the Arduino code.

Step 1: Material

  • Arduino or Arduino standalone
  • RTC DS1307
  • LCD 20x4 I2c
  • 3 buttons
  • 3 Resistor 10k ohm
  • Wires

Step 2: Schematics

The scheme is very simple:

The LCD and RTC communicate with Arduino through the I2C protocol and the library "Wire" and are connected to ARDUINO to Pin A4 and A5.

LCD & RTC---------------------- ARDUINO PIN

SDA ---------------------------------------A4

SLC----------------------------------------A5

Step 3: Arduino Code

Link libraries:

Wire.h :by Arduino IDE

RTClib.h

LiquidCrystal_I2C.h

Code:https://create.arduino.cc/editor/Tittiamo/01f86512-a8a9-4a92-830a-5ab2067c5583/preview

The code is very simple:
In the loop, check if the "menu" button is pressed, if it is not pressed displays the date and time, otherwise it counts how many times you pressed the button and, through the various sets, adjusts the time. In the end, updates the RTC with the new data entered and displays the Date and Time

Step 4: Work in Progress

Share

    Recommendations

    • Audio Contest 2018

      Audio Contest 2018
    • Metalworking Contest

      Metalworking Contest
    • Fix It! Contest

      Fix It! Contest

    6 Discussions

    0
    None
    sebareynoso

    2 months ago

    the lcd turns on without problems, but nothing appears on the screen. I already made the corrections

    1 reply
    0
    None
    tittiamo68sebareynoso

    Reply 2 months ago

    The problem you're having is: LiquidCrystal_I2C LCD (0x3F, 16.2); // I2C display 16 x 2.

    I suggest you read "http://playground.arduino.cc/Main/I2cScanner".
    The address of my Display is: "0x3F", replace this value with yours

    Did you try adjusting the contrast pot, the square blue thing with the screwdriver slot on the back of the backpack?

    Let me know.

    0
    None
    maewert

    1 year ago

    Nice Instructible. I suggest eliminating the pull-down resistors on the buttons and use the arduino's internal pull-up resistors instead to reduce parts. Just change the logic and wiring so you get a ground when the button is pressed.

    Best Wishes.

    1 reply
    0
    None
    tittiamo68maewert

    Reply 1 year ago

    Thank you for your suggestion.

    I take note and I'll do the tests