กลับไปหน้ารวมไฟล์
arduino-clock-with-lcd-20x4-i2c-296a53-en.md

So I had an idea of making a working 'clock' using an Arduino Uno instead of using a RTC module. Though it works but I do encourage you to get the RTC module instead for more accurate date/time.

Watch the video to see how it works!

Big Fonts: The Custom 20x4 LCD Clock

While it is easy to print standard 5x8 pixel text onto an LCD, the Extended 20x4 Custom Font Clock forces you to dig deep into the LiquidCrystal library parameters. The visual goal is to create numbers that take up the entire height of the 4-line display, mimicking a vintage digital clock.

Custom Hexadecimal Character Generation

An LCD module allows you to create up to 8 custom symbols.

  1. The Shapes: You draw 8 custom "Blocks" (e.g., a solid block, a block with a slant on top, a block with a curve on the bottom). You convert these 5x8 pixel grids into byte arrays.
  2. The Font Array: You write a massive 2D array matrix that dictates how to build the number "8" using these blocks across four rows.
  3. The Assembly: To draw the number "8" at cursor position (0,0):
    • Row 1: Curve, Solid, Solid, Curve
    • Row 2: Solid, Empty, Empty, Solid
    • You must write a complex printing algorithm that handles the cursor returns to assemble the giant digit block-by-block!

True I2C Hardware Linking

Because the clock is so complex, timekeeping must be completely offloaded.

  • A DS3231 RTC Module is wired to the SDA/SCL I2C pins.
  • Crucially, the 20x4 LCD must have an I2C Backpack soldered to the back.
  • You connect the LCD's I2C wires directly in parallel to the RTC's wires. The Arduino commands both the timekeeper and the display using only 4 physical wires on the breadboard!

Hardware Components

  • Arduino Uno/Mega: Due to the massive font arrays, a Mega is recommended to avoid filling the Uno's SRAM.
  • 20x4 Text LCD Display (Blue or Green/Yellow) with I2C module.
  • DS3231 Precision Real-Time Clock Module.

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Arduino IDE"
author: "c010rblind3ngineer"
category: "Screens & Displays"
components:
  - "1x Jumper wires (generic)"
  - "1x I2C 16x2 Arduino LCD Display Module"
  - "1x Arduino UNO"
description: "Master the matrix! Program an enormous 20-character by 4-line LCD to display the time with custom-designed, massive font characters spanning multiple lines."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles:
  - "https://github.com/c010rblind3ngineer/clock-LCD2004-I2C.git"
  - "https://projects.arduinocontent.cc/64b1059d-d5b1-48f9-bd46-254ac81b731b.ino"
  - "https://github.com/c010rblind3ngineer/clock-LCD2004-I2C.git"
encryptedPayload: "U2FsdGVkX1806oOJvLkAWlb3dOS1OTe0CWByPgYQKTnk32mFDyS67IwIZCddHAvxzWpDR+QKeLrPqik0gwMj9qKAAzGMoRD+5IUnVgXt0Is="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/arduino-clock-with-lcd-20x4-i2c-296a53_cover.jpg"
lang: "en"
likes: 1
passwordHash: "913caf28905caded6a2aef21bce9803ab5d26bd97998517cbc4472aafc15618a"
price: 1120
seoDescription: "Arduino 'Clock' project using LCD (20x4) I2C. Set date and time via Serial Monitor to start the digital clock display."
tags:
  - "clocks"
title: "Arduino 'Clock' with LCD (20x4) I2C"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/ayGb_MG_Kts"
views: 4653