WiFi-Connected Clock With Arduino

by amrMAH in Circuits > Arduino

640 Views, 2 Favorites, 0 Comments

WiFi-Connected Clock With Arduino

Digital_man.png

Welcome to my Instructable! In this project, I will show you how to create a WiFi-connected clock using an Arduino Uno R4 WiFi, an RTC module, and an LCD display. This clock will fetch the current time from an NTP server and display it on an LCD screen, updating every second. It's a fun and educational project that combines electronics and programming, perfect for beginners and enthusiasts alike.

Supplies

Components:

  • Arduino Uno R4 WiFi
  • RTC Module (RTC8563)
  • Grove - LCD RGB Backlight
  • Jumper wires
  • Breadboard (optional but recommended if you're not making a PCB)
  • USB-C cable (to power the arduino)

Setting Up the Hardware

Screenshot 2024-06-28 212332.png

Here we connect the RTC module and the LCD to the Arduino. Follow the wiring instructions carefully to ensure everything is connected correctly.


  1. Connect VCC of the RTC to 5V on the Arduino.
  2. Connect GND of the RTC to GND on the Arduino.
  3. Connect SDA of the RTC to SDA on the Arduino.
  4. Connect SCL of the RTC to SCL on the Arduino.
  5. Connect VCC of the LCD to 5V on the Arduino.
  6. Connect GND of the LCD to GND on the Arduino.
  7. Connect SDA of the LCD to SDA on the Arduino.
  8. Connect SCL of the LCD to SCL on the Arduino.

Setting Up the Software - Part 1

What we’re doing here is setting up the Arduino IDE with the necessary libraries to run the project.


Instructions:

  1. Open the Arduino IDE.
  2. Install the required libraries:
  • RTClib
  • WiFi
  • NTPClient
  • rgb_lcd

Setting Up the Software - Part 2

Load the provided code into the Arduino IDE. Don't forget to change the timezone and the wifi network details in the code!

Downloads

Uploading the Code and Getting Up and Running

Here we upload the code to the Arduino and verify the output on the LCD.


Instructions:

  1. Connect the Arduino to your computer using a USB-C cable.
  2. Select the correct board and port in the Arduino IDE.
  3. Click on the Upload button to upload the code.
  4. Open the Serial Monitor to see the WiFi connection status.
  5. Observe the LCD for the current time display.

Final Thoughts

In this project, we learned how to interface different electronic components, including how to use the Real-Time Clock (RTC) module to maintain accurate timekeeping. The RTC module ensures that the clock keeps running accurately even when the device is powered off. We also utilized the WiFi capabilities of the Arduino to synchronize the clock with an NTP (Network Time Protocol) server, which is a method commonly used by our computers and phones to keep their clocks accurate.

Our devices, such as computers and smartphones, frequently connect to NTP servers (aka. nuclear clocks) over the internet to adjust their internal clocks. This synchronization ensures that they always display the correct time, compensating for any drift that might occur in their internal clocks. By implementing a similar mechanism in this project, we have gained a deeper understanding of how these everyday technologies work behind the scenes.


I hope you enjoyed following this project and found it as educational and rewarding as I did. I encourage you to experiment with your own enhancements and share your results.