Skip to content

Pratama Digital

Your Digital Partner

Menu
  • Home
  • Download Area
  • Pratama Digital Net
  • Internet Speed Test
  • About Us
Menu

Building a Running Text Clock with Arduino in 24-Hour Format

Posted on September 20, 2023

Introduction

Creating a clock with a running text display using an Arduino is a fun and educational project. In this tutorial, we will guide you through the process of building a 24-hour format clock that displays the time in a scrolling text format. By the end of this project, you’ll have a unique and functional digital clock.

Components You’ll Need

  1. Arduino board (e.g., Arduino Uno)
  2. 16×2 LCD display (compatible with Hitachi HD44780 controller)
  3. Potentiometer (for adjusting LCD contrast)
  4. Breadboard and jumper wires
  5. Arduino IDE (installed on your computer)

Step 1: Set Up Your Hardware

  1. Connect the 16×2 LCD display to your Arduino as follows:
    • VSS (Ground) to GND on Arduino
    • VDD (Power) to 5V on Arduino
    • VO (LCD Contrast) to the center pin of the potentiometer
    • RS (Register Select) to Digital Pin 7
    • RW (Read/Write) to GND on Arduino
    • E (Enable) to Digital Pin 8
    • D4 to Digital Pin 9
    • D5 to Digital Pin 10
    • D6 to Digital Pin 11
    • D7 to Digital Pin 12
    • A (Anode – LED+) to 5V on Arduino
    • K (Cathode – LED-) to GND on Arduino
  2. Adjust the LCD contrast by turning the potentiometer until the text is visible.

Step 2: Write the Arduino Sketch

Open the Arduino IDE on your computer and create a new sketch. Copy and paste the following code into your sketch:

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

void setup() {
lcd.begin(16, 2); // Set the LCD to 16×2 character display
}

void loop() {
// Get the current time in 24-hour format
unsigned long currentTime = millis();
unsigned long seconds = (currentTime / 1000) % 60;
unsigned long minutes = (currentTime / 60000) % 60;
unsigned long hours = (currentTime / 3600000) % 24;

// Format the time as a string in HH:MM:SS format
String timeString = String(hours) + “:” + (minutes < 10 ? “0” : “”) + String(minutes) + “:” + (seconds < 10 ? “0” : “”) + String(seconds);

// Display the time on the LCD
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(“Time: “);
lcd.setCursor(0, 1);
lcd.print(timeString);

// Delay to control text scrolling speed
delay(500);

// Scroll the text to the left
for (int i = 0; i < 12; i++) {
lcd.scrollDisplayLeft();
delay(500);
}
}

Connect your Arduino to your computer using a USB cable and select the correct board and port in the Arduino IDE. Then, click the “Upload” button to upload the sketch to your Arduino.

Step 4: Watch Your Running Text Clock

Once the upload is complete, you’ll see the time displayed on the LCD. It will scroll the time in a loop, creating a running text effect. The clock will continuously update to reflect the current time.

Conclusion

Congratulations! You’ve successfully built a running text clock using an Arduino in 24-hour format. This project is a great way to learn about interfacing with LCD displays and using Arduino to create functional devices. You can further enhance this project by adding features like date display or alarm functionality. Enjoy your unique digital clock!

Share this:

  • Facebook
  • X

Related

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • 10 Powerful Alternatives to MikroTik for Small to Enterprise Networks
  • LDAP: A Guide for Linux System Administrators
  • Virtual Private Server (VPS): A Guide for Beginners
  • Forward Ports on Your Router for Online Games
  • MikroTik RouterOS 6 vs. RouterOS 7: Key Differences, Advantages, and Disadvantages

Tags

24h clock adobe adobe cc adobe cs master almalinux arduino autodesk basic ip address cad software calculator php connect java dns server download photoshop ecmp formula ipv4 innodb install iptables ipsec iptables java mysql linux firewall linux mint linux security load balance microsoft office myisam mysql mysql engine node.js nodejs nth office alternative openvpn pcc php port game online port mikrotik postgresql postgresql to mysql public dns rocky linux running text script php ubuntu LTS wireguard

Categories

  • Advertising
  • CAD software
  • Computer Component
  • Control Panel
  • Database
  • DNS
  • Download
  • File Server
  • Firewall
  • Graphic Design
  • Internet
  • IP Address
  • Linux OS
  • Load Balance
  • Mikrotik
  • Movie
  • Novel/Book
  • Office
  • OpenWRT
  • Processor & GPU
  • Programming
  • Routing
  • Security
  • Server
  • Tutorial
  • Video Editing
  • VPN
  • Web Programming
  • Windows OS
  • Wordpress

About Us

We are a company specializing in network configuration, MikroTik and computer installation services, as well as wifi setup. With experience dating back to 2017, we have gained the trust of numerous clients from various regions who rely on our services. Our expertise extends to catering to personal, office, institutional, and industrial needs.

Archives

  • December 2024
  • September 2024
  • June 2024
  • May 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023

Recent Posts

  • 10 Powerful Alternatives to MikroTik for Small to Enterprise Networks
  • LDAP: A Guide for Linux System Administrators
  • Virtual Private Server (VPS): A Guide for Beginners
  • Forward Ports on Your Router for Online Games
  • MikroTik RouterOS 6 vs. RouterOS 7: Key Differences, Advantages, and Disadvantages
©2025 Pratama Digital | Design: Newspaperly WordPress Theme