How to Make a 6-Digit Digital Clock at Home Using Arduino & RTC Module With Temperature Display

by ER GREAT in Circuits > Electronics

148 Views, 2 Favorites, 0 Comments

How to Make a 6-Digit Digital Clock at Home Using Arduino & RTC Module With Temperature Display

6 Digit TH-Recovered th3.jpg
6 Digit Digital Clock15.jpg
6 Digit Digital Clock18.jpg
6 Digit Digital Clock25.jpg

Building your own digital clock is one of the most satisfying projects for any electronics enthusiast—and in this tutorial, we will create a precision 6-digit digital clock powered by Arduino and the DS3231 RTC module. This project displays Hours : Minutes : Seconds (HH:MM:SS) in a clean, modern layout while also showing real-time temperature with excellent accuracy.

With the reliability of the DS3231 Real-Time Clock, your clock will keep perfect time even during power failures, and the Arduino makes the interface fully customizable. Whether you are a hobbyist, student, or DIY creator, this project is ideal for learning about RTC communication, multiplexed displays, temperature sensing, and user interface design.

In this step-by-step guide, you will learn everything from circuit connections to uploading the code, assembling the display, and finally achieving a professional-looking digital clock that you can proudly use at home, office, or workshop. Let’s begin crafting your very own Arduino-powered smart digital clock!

Supplies

6 Digit Digital Clock26.jpg
6 Digit Digital Clock30.jpg
6 Digit Digital Clock31.jpg
6 Digit Digital Clock56.jpg
6 Digit Digital Clock55.jpg

Electronic Components

  1. Diffused LEDs × 154
  2. Used to build all segments (A–G) across the 6-digit 7-segment display.
  3. Arduino Uno
  4. Acts as the main microcontroller responsible for driving the display, reading the RTC, and updating the time/temperature.
  5. DS3231 RTC Module
  6. A high-precision real-time clock with built-in temperature sensor and battery backup for accurate timekeeping.
  7. Toggle Switch × 1
  8. Used to switch between Time-Set Mode and Real-Time display mode.
  9. Push Button Switches × 2
  10. Used for adjusting hours and minutes when the clock is in Time-Set Mode.
  11. Ribbon Cable / Connecting Wires
  12. Required for connecting the LED segments, Arduino, and RTC module.

Structural Materials

  1. 6 mm MDF Board
  2. Used to create the front panel, enclosure, and overall structure of the digital clock.

Prepare the MDF Front Panel & Construct a Digit

6 Digit Digital Clock29.jpg
6 Digit Digital Clock28.jpg
6 Digit Digital Clock32.jpg
6 Digit Digital Clock33.jpg
6 Digit Digital Clock34.jpg
6 Digit Digital Clock35.jpg
6 Digit Digital Clock36.jpg
6 Digit Digital Clock41A.jpg
6 Digit Digital Clock41B.jpg
6 Digit Digital Clock41C.jpg

Before starting the display construction, check all LEDs properly using a 3V cell or LED tester to ensure every LED is working. Replace any faulty ones to avoid issues later.

Cut and Prepare the MDF Board

  1. Take a 6 mm MDF board and cut it according to the required dimensions for 6 digits.
  2. Once the base front panel is ready, mark and drill 5mm holes for all 7 segments (A–G) across all 6 digits (HH:MM:SS).

LED Placement Rules

  1. Hour (HH) and Minute (MM) digits:
  2. Each segment contains 4 LEDs grouped together.
  3. Second (SS) digits:
  4. Each segment contains 3 LEDs.

Ensure all drilling points are perfectly aligned so the 6-digit display looks clean, symmetrical, and professional.

2. Build the First Segment

  1. Insert LEDs into the drilled holes of the first segment.
  2. Arrange them such that:
  3. Anodes face outward
  4. Cathodes face inward
  5. Solder all anodes together to form the common anode of the segment.
  6. Solder all cathodes together to form the segment cathode.

This forms one complete LED segment.

3. Build the Second Segment

  1. Insert LEDs into the second segment holes.
  2. Maintain the same orientation:
  3. Anodes → outside
  4. Cathodes → inside
  5. After soldering, connect the anode of the second segment to the anode of the first segment.
  6. Keep the cathode wire of the second segment separate, as each segment has its own cathode.

This creates a common anode line but individual segment cathodes.

4. Complete All 7 Segments (A–G)

Repeat the same process for the remaining segments:

  1. Insert LEDs
  2. Align anode outward & cathode inward
  3. Solder anodes and cathodes
  4. Connect all anodes together to form one single common anode for that digit
  5. Keep all seven cathodes separately mapped for Segments A to G

After completing, you now have one complete digit, with:

  1. 1 common anode
  2. 7 separate cathodes (A–G)


Prepare All 6 Digits and Test Every Segment

6 Digit Digital Clock37.jpg
6 Digit Digital Clock38.jpg
6 Digit Digital Clock39.jpg
6 Digit Digital Clock40.jpg
6 Digit Digital Clock41.jpg

1. Repeat the Same Process for All Digits

Using the same LED orientation and soldering method:

  1. Build Digit-2
  2. Build Digit-3
  3. Build Digit-4
  4. Build Digit-5 &
  5. Build Digit-6

Each digit should have:

  1. 1 Common Anode Line (all segment anodes connected together)
  2. 7 Separate Cathodes for Segments A, B, C, D, E, F, G

By the end of this step, you will have a complete:

6-Digit (HH:MM:SS) 7-Segment Display Module

with 6 Common Anodes and 7 Individual Cathode Lines for the segments.

2. Test All Segments Using a 3V Cell

Before moving ahead, it is very important to check that every LED in every segment is working.

How to Test:

  1. Take a 3V battery cell and two small wires.
  2. Connect:
  3. Positive of the 3V cell to the common anode of any digit
  4. Negative of the cell to each segment cathode (A–G) one by one
  5. Observe whether the segment lights up properly.

3. Check for Faulty LEDs

  1. If any segment does not glow or glows dim, there may be a fused LED in that segment.
  2. Identify the faulty LED and replace it immediately before assembly continues.

Testing at this stage saves a lot of time later and ensures the display is bright, clean, and consistent.

Connect All Digits to Form Common Segment Lines (A–G)

6 Digit Digital Clock42.jpg
6 Digit Digital Clock43.jpg
6 Digit Digital Clock44.jpg
6 Digit Digital Clock45.jpg
6 Digit Digital Clock61.jpg

Now that all 6 digits are completed and tested, the next step is to interconnect the segment cathodes so that each segment (A–G) across all digits shares a common wire. This is essential for multiplexing the 6-digit display with Arduino.

1. Create the Common Segment A Line

  1. Take a wire and connect it from Segment A of Digit-1.
  2. Extend the same wire to Segment A of Digit-2.
  3. Continue connecting the same line to Segment A of Digit-3, Digit-4, Digit-5, and Digit-6.

Now all Segment-A cathodes are connected together, forming one Common Segment-A Wire.

2. Create the Common Segment B Line

  1. Take another wire.
  2. Connect it to Segment B of Digit-1.
  3. Then connect it to Segment B of Digit-2, Digit-3, Digit-4, Digit-5, and Digit-6.

This gives you a second Common Segment-B Wire.

3. Repeat the Same for All Remaining Segments

Similarly, connect all digits for:

  1. Segment C → Common Segment-C Wire
  2. Segment D → Common Segment-D Wire
  3. Segment E → Common Segment-E Wire
  4. Segment F → Common Segment-F Wire
  5. Segment G → Common Segment-G Wire

Final Result

After completing these connections:

  1. You will have 7 Common Cathode Segment Wires:
  2. Segment A
  3. Segment B
  4. Segment C
  5. Segment D
  6. Segment E
  7. Segment F
  8. Segment G


Add Output Wires & Prepare the Display for Arduino Connection

6 Digit Digital Clock46.jpg
6 Digit Digital Clock48.jpg
6 Digit Digital Clock47.jpg
6 Digit Digital Clock52.jpg
CKT-1.jpg

1. Connect Output Wires to the 7 Common Cathode Segment Lines

  1. Take 7 separate wires (preferably different colors for easy identification).
  2. Solder each wire to the common cathode line of:
  3. Segment A
  4. Segment B
  5. Segment C
  6. Segment D
  7. Segment E
  8. Segment F
  9. Segment G

These 7 wires will act as the segment output pins that go to the Arduino segment control pins.

2. Connect Output Wires to All 6 Common Anode Digit Lines

  1. Now take 6 additional wires.
  2. Solder each one to the common anode of:
  3. Digit-1
  4. Digit-2
  5. Digit-3
  6. Digit-4
  7. Digit-5
  8. Digit-6

These wires are used to select each digit during multiplexing.

3. Attach Male Header Pins for Easy Plug-and-Play

To make the display easily pluggable into the Arduino:

  1. Take a male header strip.
  2. Solder:
  3. 7 segment wires (A–G) to the first 7 pins
  4. 6 anode wires (D1–D6) to the next 6 pins

This creates a clean and professional connector that can be plugged directly into your breadboard or Arduino jumper wires. At this point, you now have a fully completed 6-Digit 7-Segment Common Anode Display Module.

Your custom display is now ready to be connected and programmed to show HH:MM:SS with temperature.

Connecting the 6-Digit Display, Switches & DS3231 RTC Module to Arduino Uno

ckt-2.jpg
6 Digit Digital Clock57.jpg
6 Digit Digital Clock59.jpg
Digital clock Ckt-4.jpg
6 Digit Digital Clock60.jpg
6 Digit Digital Clock62.jpg

Next, let’s connect the complete display board to the Arduino Uno as shown in the circuit diagram.

Start by connecting the 7 common cathode segment wires (SegA–SegG):

  1. SegA → D8
  2. SegB → D7
  3. SegC → D6
  4. SegD → D5
  5. SegE → D4
  6. SegF → D3
  7. SegG → D2

Now connect the 6 Common Anode digit wires:

  1. Minute-2 → D9
  2. Minute-1 → D10
  3. Hour-2 → D11
  4. Hour-1 → D12
  5. Second-1 → D13
  6. Second-2 → A3

Connecting the Time-Set Switches & RTC Module

Following the circuit diagram:

  1. Take one side of all three switches (Toggle switch + Minute push button + Hour push button) and connect them commonly to GND.
  2. Now connect the other side of each switch to Arduino pins:
  3. Toggle Switch → A0
  4. Minute Set Button → A1
  5. Hour Set Button → A2

Connecting the DS3231 RTC Module

  1. VCC → 5V
  2. GND → GND
  3. SDA → A4
  4. SCL → A5

Once all the connections are done, your DIY 6-Digit 7-Segment Display Board, all switches, and the DS3231 RTC Module are fully connected to the Arduino.

Now your Arduino is ready to upload the program!

Uploading the Arduino Code to the Board

6 Digit Digital Clock63A.jpg
6 Digit Digital Clock64.jpg
6 Digit Digital Clock64A.jpg
6 Digit Digital Clock64B.jpg
6 Digit Digital Clock64C.jpg
6 Digit Digital Clock63C.jpg
6 Digit Digital Clock63B.jpg
6 Digit Digital Clock63D.jpg
6 Digit Digital Clock64D.jpg
6 Digit Digital Clock64E.jpg
6 Digit Digital Clock64F.jpg
6 Digit Digital Clock64G.jpg
6 Digit Digital Clock64H.jpg
6 Digit Digital Clock65.jpg
6 Digit Digital Clock66.jpg
6 Digit Digital Clock67.jpg

Now take a Type-B USB cable and connect it to the Arduino Uno. Plug the USB side into your laptop.

After powering the Arduino through USB, you will notice that no segments glow yet—this is completely normal because the display will only start working after uploading the program.

1. Open the Arduino IDE & Load the Code

  1. Download the code & circuit diagrams.
  2. Open Arduino IDE.
  3. Go to File → Open and select the downloaded .ino file to load it.

2. Install Required Libraries

At the top of the code, you will see two libraries used:

Wire and RTClib

The Wire library is already built-in, but we need to install RTClib manually.

To install:

  1. Go to Sketch → Include Library → Manage Libraries
  2. In the search bar, type: RTClib
  3. Select the library and click Install
  4. To verify installation, go to
  5. Sketch → Include Library and scroll down — you will see RTClib listed there.

While installing library make sure your laptop should be connected with internet connection.

3. Select the Correct Board & Port

  1. Go to Tools → Board → Arduino AVR Boards → Arduino UNO
  2. Next, go to Tools → Port and select the COM port where your Arduino is connected.
  3. Keep all other settings exactly as shown in the reference image.

4. Upload the Code

  1. Now click the Upload (→) button in the Arduino IDE.
  2. Wait until the code compiles and uploads completely.

Once the upload is finished, your 6-digit display will start showing the current time.

The DS3231 RTC will automatically sync to your laptop’s system time, so the time you see on the display will be accurate.

5. Adjust Any Misaligned Digits

If you find that any digit is glowing incorrectly or segments are mixed, simply flip the anode wire of that digit to correct the display orientation.

Installing 3D-Printed Knobs for Time Adjustment

6 Digit Digital Clock55.jpg
6 Digit Digital Clock53.jpg
6 Digit Digital Clock49.jpg
6 Digit Digital Clock54.jpg
6 Digit Digital Clock50.jpg

For this project, I used three different colored 3D-printed PLA+ knobsYellow, White and Red—to make the time-adjustment controls visually appearing and easy to identify.

Begin by drilling holes on the top side of the MDF back box according to the diameter of each knob’s switch shaft. Make sure the holes are perfectly aligned and smooth for a proper fit.

Next, insert the toggle switch and the two push-button switches into their respective holes. Once placed, solder the switch terminals and secure them firmly using hot glue followed by tightening them with screws to ensure they stay fixed while operating the clock.

I designed these 3D-printed knobs myself for a personalized appearance:

  1. The Yellow knob has the letter “A” (Adjust) extruded on top.
  2. The White knob has the letter “H” (Hour) extruded for hour adjustment.
  3. The Red knob has the letter “M” (Minute) extruded for minute adjustment.

These custom knobs not only enhance functionality but also give the digital clock a premium and attractive look, making the design stand out visually.

Power Connection & Final Enclosure Assembly

6 Digit Digital Clock3.jpg
6 Digit Digital Clock4.jpg
6 Digit Digital Clock5.jpg
6 Digit Digital Clock6.jpg

To power the Arduino Uno inside the clock, I used a Micro USB power port. This port makes it easy to power the clock using any USB adapter or power bank you can use Type-C.

Start by soldering the output wires of the Micro USB port:

  1. +V (positive) → Connect to the VIN pin of the Arduino Uno
  2. GND (negative) → Connect to the GND pin of the Arduino Uno

Make sure the solder joints are tight and insulated to avoid short circuits.

Once the power input is ready, place all components—the 6-digit display, Arduino board, RTC module, switches, knobs, and wiring—neatly inside the MDF enclosure. Arrange the wires properly so that nothing gets pressed when closing the box.

Finally, close the enclosure and secure it using Zipsum screws on all four sides. This gives the clock a strong and clean finish, ensuring the internal components remain fixed and protected.

Setting the Time & Using the Clock

6 Digit Digital Clock9.jpg
6 Digit Digital Clock10.jpg
6 Digit Digital Clock11.jpg
6 Digit Digital Clock12.jpg
6 Digit Digital Clock13.jpg
6 Digit Digital Clock14.jpg
6 Digit Digital Clock17.jpg
6 Digit Digital Clock19.jpg

Now that the clock is fully assembled and running, you can manually set the time using the three control buttons on top of the enclosure.

Entering Time-Set Mode

  1. Press the Adjust (A) button once.
  2. The clock will enter Time-Set Mode, and you will notice that the seconds display turns OFF.
  3. This indicates that the clock is ready for manual time adjustment.

Adjusting the Time

  1. Press the Hour (H) button repeatedly to increase the Hour value.
  2. Press the Minute (M) button repeatedly to increase the Minute value.

Adjust the time until it matches your desired local time.

✅ Saving the Time

  1. Press the Adjust (A) button again to exit Time-Set Mode.
  2. The clock will return to Real-Time Display Mode, and the seconds will start running normally again.

The updated time will be automatically saved inside the DS3231 RTC module, so even if power goes off, the correct time will be retained.

🌡️ Automatic Temperature Display

Every minute for 5 second, the clock will also show the current temperature of your location in degrees Celsius, using the DS3231’s built-in temperature sensor.

This adds a stylish and useful extra feature, making the clock more attractive and informative.

12-Hour Time Format

6 Digit Digital Clock21.jpg
6 Digit Digital Clock23.jpg
6 Digit Digital Clock16.jpg

This DIY digital clock is designed to operate in a 12-hour format.

That means:

  1. The time will run from 1:00 to 12:59
  2. After 12:59, it will return to 1:00

This makes the clock look more traditional and easy to read, just like standard home wall clocks.

Applications of This Clock

How to make 6 Digit 7-Segment Digital Clock at home in Hindi ⏰ DIY: Digital Clock with Arduino
6 Digit Digital Clock24.jpg
6 Digit Digital Clock17.jpg

This 6-Digit Arduino-based digital clock can be used in various real-world applications:

  1. Home & Bedroom Clock:
  2. Works as a stylish modern clock with time + temperature display.
  3. Office Desk Clock:
  4. Shows the time and room temperature—useful for daily work environments.
  5. Electronics Projects & Learning:
  6. A perfect project for learning Arduino, LEDs, RTC modules, and multiplexed displays.
  7. Gifts & Custom Builds:
  8. A unique handmade gift, especially when customized with 3D-printed buttons and a wooden enclosure.
  9. Workshops & DIY Classes:
  10. Great as a teaching project for students learning microcontrollers and digital circuits.
  11. Temperature Monitoring:
  12. Automatically displays room temperature every minute, making it a functional mini weather station.


Conclusion

Building this DIY 6-Digit Arduino Digital Clock using the DS3231 RTC module is not only fun but also an excellent learning experience.

You get hands-on practice with:

  1. LED segment construction
  2. Arduino programming
  3. RTC timekeeping
  4. Custom enclosure design
  5. 3D-printed components
  6. Wiring and circuit assembly

The combination of accurate timekeeping, a 12-hour display, and automatic temperature readings makes this clock both useful and visually impressive.

Once assembled, the clock runs smoothly, looks modern, and becomes a great addition to any room or workspace. It’s truly a rewarding project for electronics enthusiasts and beginners alike.